This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Dec 2011 19:17:09 +0000
- Subject: [Bug c++/51373] [C++0x] ICE for static pointer to member initialized in-class
- Auto-submitted: auto-generated
- References: <bug-51373-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51373
Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2011-12-03 19:17:09 UTC ---
(In reply to comment #0)
> gcc version 4.7.0 20111112 (experimental) (GCC)
Also in 4.7.0 20111126 (experimental)
> Two seemingly relate ICEs when dealing with pointer to member:
>
> struct foo {
> int a = 42;
> static int foo::*b = &foo::a;
> };
b needs to have a constexpr specifier here, but it ICEs also with that one
added. Even with the constexpr specifier that declaration should be ill-formed,
because the class definition must be complete for an in-class static data
member initializer. Also, the initializer for a is not needed to reproduce the
error.
> struct foo {
> int a = 42;
> static int foo::*b;
> auto& c = b;
> };
> internal compiler error: in unify_one_argument, at cp/pt.c:15008
The declaration of c cannot use auto (only static data members may do) and the
ICE does no longer occur after the fix. In addition, the declaration of a is
not needed to reproduce the problem.