re PR c++/49176 ([c++0x] valid code rejected with "error: uninitialized const")
authorJason Merrill <jason@redhat.com>
Fri, 27 May 2011 19:32:22 +0000 (15:32 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 27 May 2011 19:32:22 +0000 (15:32 -0400)
PR c++/49176
* g++.dg/template/const5.C: New.

From-SVN: r174356

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/const5.C [new file with mode: 0644]

index 319fc28e05981c81f9d56c71c3973bd2f57eb628..a9e31ce77fc103794982a803795b029eab0cfdbd 100644 (file)
@@ -1,5 +1,8 @@
 2011-05-27  Jason Merrill  <jason@redhat.com>
 
+       PR c++/49176
+       * g++.dg/template/const5.C: New.
+
        * g++.dg/cpp0x/enum18.C: New.
 
        * g++.dg/cpp0x/lambda/lambda-nested4.C: New.
diff --git a/gcc/testsuite/g++.dg/template/const5.C b/gcc/testsuite/g++.dg/template/const5.C
new file mode 100644 (file)
index 0000000..5d3ec5b
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/49176
+// { dg-options -std=c++0x }
+
+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();