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++/51373] [C++0x] ICE for static pointer to member initialized in-class


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.


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