aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C
new file mode 100644
index 0000000..c213c74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto7.C
@@ -0,0 +1,13 @@
+// PR c++/37965
+// Negative test for auto
+// { dg-do compile { target c++11 } }
+
+auto i = 6;
+auto j; // { dg-error "has no initializer" }
+
+template<int> struct A
+{
+ static auto k = 7; // { dg-error "non-const" }
+ static auto l; // { dg-error "has no initializer" }
+ auto m; // { dg-error "non-static data member declared" }
+};