[Bug c++/49176] New: [4.6 Regression][c++0x] valid code rejected with "error: uninitialized const"

roman at binarylife dot net gcc-bugzilla@gcc.gnu.org
Thu May 26 18:04:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49176

           Summary: [4.6 Regression][c++0x] valid code rejected with
                    "error: uninitialized const"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: roman@binarylife.net


$ cat test.cpp 
struct A { static int a(); };

template<int>
struct B { static int const b; };

int f() { return B<0>::b; }

template<int I> 
int const B<I>::b=A::a();

$ g++ -c -std=c++0x test.cpp 
test.cpp: In instantiation of ‘const int B<0>::b’:
test.cpp:6:24:   instantiated from here
test.cpp:9:11: error: uninitialized const ‘B<0>::b’ [-fpermissive]



More information about the Gcc-bugs mailing list