From: Patrick Palka Date: Fri, 16 Feb 2024 17:44:27 +0000 (-0500) Subject: c++: add fixed testcase [PR111682] X-Git-Tag: basepoints/gcc-15~1104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c95dc611a6203f0564722975acff4ad866b9c45e;p=thirdparty%2Fgcc.git c++: add fixed testcase [PR111682] Fixed by the PR113612 fix r14-8960-g19ac327de421fe. PR c++/111682 gcc/testsuite/ChangeLog: * g++.dg/cpp1y/var-templ86.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ86.C b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C new file mode 100644 index 000000000000..0c933cac26c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C @@ -0,0 +1,23 @@ +// PR c++/111682 +// { dg-do compile { target c++14 } } + +template struct A { + template struct B; + template struct B; +}; +template template struct A::B {}; +template struct A; +A::B b; + + +template struct B { + template static const int var1; + template static const int var1; + + template static const int var2; +}; +template template const int B::var1 = 1; +template template const int B::var2 = 1; +template struct B; +int b_test1[B::var1]; +int b_test2[B::var2];