summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash41.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash41.C')
-rw-r--r--gcc/testsuite/g++.dg/template/crash41.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash41.C b/gcc/testsuite/g++.dg/template/crash41.C
new file mode 100644
index 000000000..9a440b076
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash41.C
@@ -0,0 +1,18 @@
+// PR c++/22464
+
+template<typename T>
+void do_something(const T* A) // { dg-error "declared" }
+{
+ struct helper_t{
+ helper_t() {
+ A[0]; // { dg-error "use" }
+ }
+ } helper;
+}
+
+void sub1() {
+ double A[7];
+ do_something (A);
+}
+
+