The following code compiles fine with clang 3.5.0, but does not compile with gcc 4.9.0 (with the -Wall -Wextra -pedantic-errors flags and with any signs -std=c++03 , -std=c++11 and -std=c++14 ):
-Wall -Wextra -pedantic-errors
-std=c++03
-std=c++11
-std=c++14
struct S { S(const float(&)[12]) { } }; float v[12]; S f() { return v; } int main() { }
MS VC 2013 also compiles this code .
Which compiler is right and what is standard behavior?
No one has answered this question yet.
See similar questions:
or similar:
Source: https://habr.com/ru/post/975892/More articles:Error loading project: Include unrecognized attribute - gitError registering in the OWIN host - loggingExternal Reagent Access - architectureTemplate output is not performed for std: map as a template parameter - c ++ 11Open a Sequel Pro connection from the command line - mysqlSpring @Value property for custom class - springbest way to configure sql preferences - sqlHow to make the target "private" in GNU make only for internal use? OR: how to best apply target values โโof variables? - makefileSemantics of declarators in C99 - cEWS Exchange Get a calendar for a room - c #All Articles