This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53150] [C++0x] g++ crashes if struct member initializer references to local variable
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 May 2012 11:04:35 +0000
- Subject: [Bug c++/53150] [C++0x] g++ crashes if struct member initializer references to local variable
- Auto-submitted: auto-generated
- References: <bug-53150-4@http.gcc.gnu.org/bugzilla/>
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.