This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53150] [C++0x] g++ crashes if struct member initializer references to local variable


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]