[Bug c++/53150] [C++0x] g++ crashes if struct member initializer references to local variable
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 2 11:04:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53150
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-02 11:04:35 UTC ---
It's invalid
[class.local]/1
Declarations in a local class shall not odr-use (3.2) a variable with automatic
storage duration from an enclosing scope.
It would be valid if foo was declared const, because then it would not be
odr-used.
More information about the Gcc-bugs
mailing list