c++: add testcase [PR97177]
authorNathan Sidwell <nathan@acm.org>
Thu, 24 Sep 2020 19:13:28 +0000 (12:13 -0700)
committerNathan Sidwell <nathan@acm.org>
Thu, 24 Sep 2020 19:13:28 +0000 (12:13 -0700)
Pr97177 is the local-var duplicate of pr97171.  So just adding the testcase.

gcc/testsuite/
* g++.dg/template/local-var1.C: New.

gcc/testsuite/g++.dg/template/local-var1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/template/local-var1.C b/gcc/testsuite/g++.dg/template/local-var1.C
new file mode 100644 (file)
index 0000000..4b3854b
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/97186, related to c++/97171 but with a variable
+// { dg-do compile { target c++11 } }
+
+namespace
+{
+  template <typename WF>
+  void
+  ml ()
+  {
+    extern WF cr;
+
+    static_assert (sizeof (cr) == 12, "");
+  }
+
+  void
+  qc ()
+  {
+    ml<int[3]> ();
+  }
+}