From: Patrick Palka Date: Fri, 19 Jul 2024 15:08:09 +0000 (-0400) Subject: c++: add fixed testcase [PR109464] X-Git-Tag: basepoints/gcc-16~7399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a9f3ded1a0ccc2c8b0a42f976950041734798e;p=thirdparty%2Fgcc.git c++: add fixed testcase [PR109464] Seems to be fixed by r15-521-g6ad7ca1bb90573. PR c++/109464 gcc/testsuite/ChangeLog: * g++.dg/template/explicit-instantiation8.C: New test. --- diff --git a/gcc/testsuite/g++.dg/template/explicit-instantiation8.C b/gcc/testsuite/g++.dg/template/explicit-instantiation8.C new file mode 100644 index 00000000000..92152a2992e --- /dev/null +++ b/gcc/testsuite/g++.dg/template/explicit-instantiation8.C @@ -0,0 +1,24 @@ +// PR c++/109464 +// { dg-do compile { target c++11 } } + +template +struct shallow + { + int len; + constexpr shallow() : len(0) { } + }; + +template +struct use_shallow + { + static constexpr shallow s_zstr = { }; + static_assert(s_zstr.len == 0, ""); + }; + +extern template struct shallow; +extern template struct use_shallow; + +template struct shallow; +template struct use_shallow; + +// { dg-final { scan-assembler "_ZN7shallowIcEC2Ev" } }