From: Patrick Palka Date: Tue, 2 May 2023 12:48:59 +0000 (-0400) Subject: c++: Add testcase for already fixed PR [PR109506] X-Git-Tag: basepoints/gcc-15~9746 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a9840cedbdc8be8252fd8f2d31d8fbd36632a2e;p=thirdparty%2Fgcc.git c++: Add testcase for already fixed PR [PR109506] The PR109666 fix r14-386-g07c52d1eec967 incidentally also fixes this PR. PR c++/109506 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template26.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C new file mode 100644 index 000000000000..032b7b616199 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C @@ -0,0 +1,22 @@ +// PR c++/109506 +// { dg-do link { target c++11 } } +// { dg-additional-options "-fchecking=2" } + +template +struct foo { + foo() { }; +}; + +template +class bar { + foo alloc_{}; +}; + +template +bar func1() { + return bar{}; +} + +int main() { + func1(); +}