aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2024-07-19 11:08:09 -0400
committerPatrick Palka <ppalka@redhat.com>2024-07-19 11:08:09 -0400
commit58a9f3ded1a0ccc2c8b0a42f976950041734798e (patch)
tree91dd161053a685d646a5797014d48b90965a9525 /gcc/testsuite
parent8fbc386c12385378b01a744c6764b5660d4b4310 (diff)
downloadgcc-58a9f3ded1a0ccc2c8b0a42f976950041734798e.zip
gcc-58a9f3ded1a0ccc2c8b0a42f976950041734798e.tar.gz
gcc-58a9f3ded1a0ccc2c8b0a42f976950041734798e.tar.bz2
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.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-instantiation8.C24
1 files changed, 24 insertions, 0 deletions
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 0000000..92152a2
--- /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<typename T>
+struct shallow
+ {
+ int len;
+ constexpr shallow() : len(0) { }
+ };
+
+template<typename T>
+struct use_shallow
+ {
+ static constexpr shallow<T> s_zstr = { };
+ static_assert(s_zstr.len == 0, "");
+ };
+
+extern template struct shallow<char>;
+extern template struct use_shallow<char>;
+
+template struct shallow<char>;
+template struct use_shallow<char>;
+
+// { dg-final { scan-assembler "_ZN7shallowIcEC2Ev" } }