Pedwarn about auto parameter even without -Wpedantic.
authorJason Merrill <jason@redhat.com>
Tue, 13 Mar 2018 15:55:44 +0000 (11:55 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 13 Mar 2018 15:55:44 +0000 (11:55 -0400)
* parser.c (cp_parser_simple_type_specifier): Pedwarn about auto
parameter even without -Wpedantic.

From-SVN: r258494

43 files changed:
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/concepts/abbrev1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/abbrev2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/fn-generic-member-ool.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58500.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58534.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58535.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58536.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58548.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr58549.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60052.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60053.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60064.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60065.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60377.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60390.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60391.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr60573.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr80471.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/auto-60626.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/auto-84662.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/fn-generic-member-ool.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58500.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58534.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58535.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58536.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58548.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr58549.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60052.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60053.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60064.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60065.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60377.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60390.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60391.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60573.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr60626.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr80471.C [deleted file]
gcc/testsuite/g++.dg/cpp1y/pr84662.C [deleted file]
gcc/testsuite/g++.dg/cpp1z/abbrev1.C [deleted file]
gcc/testsuite/g++.dg/cpp1z/abbrev2.C [deleted file]
gcc/testsuite/g++.dg/cpp1z/decomp3.C

index d480c1bafba0c9de77bac149d6108d9836cf1a7a..0da60a3e99bf9a09110bdfb66b2e678cb1e38ea4 100644 (file)
@@ -1,5 +1,8 @@
 2018-03-13  Jason Merrill  <jason@redhat.com>
 
+       * parser.c (cp_parser_simple_type_specifier): Pedwarn about auto
+       parameter even without -Wpedantic.
+
        PR c++/84798 - ICE with auto in abstract function declarator.
        * parser.c (cp_parser_parameter_declaration_clause): Check
        parser->default_arg_ok_p.
index 8e8ebceb0d584cd65996c87011fc1b2720744258..0a82f415196c3b77b7984540a9e6d44ee6e2d8c3 100644 (file)
@@ -17049,9 +17049,9 @@ cp_parser_simple_type_specifier (cp_parser* parser,
                     "only available with "
                     "-std=c++14 or -std=gnu++14");
          else if (!flag_concepts)
-           pedwarn (token->location, OPT_Wpedantic,
-                    "ISO C++ forbids use of %<auto%> in parameter "
-                    "declaration");
+           pedwarn (token->location, 0,
+                    "use of %<auto%> in parameter declaration "
+                    "only available with -fconcepts");
        }
       else
        type = make_auto ();
diff --git a/gcc/testsuite/g++.dg/concepts/abbrev1.C b/gcc/testsuite/g++.dg/concepts/abbrev1.C
new file mode 100644 (file)
index 0000000..8de681f
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/64969
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+auto f1(auto x) { return *x; }
+decltype(auto) f2(auto x) { return *x; }
+auto f3(auto x) -> int { return *x; }
+
+int i;
+auto r1 = f1(&i);
+auto r2 = f2(&i);
+auto r3 = f3(&i);
diff --git a/gcc/testsuite/g++.dg/concepts/abbrev2.C b/gcc/testsuite/g++.dg/concepts/abbrev2.C
new file mode 100644 (file)
index 0000000..3100f67
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/66197
+// { dg-do run { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+extern "C" void abort();
+
+auto add_1(auto a, auto b) { return a + b; }
+auto add_2 = [](auto a, auto b) { return a + b; };
+
+int main()
+{
+  if (add_1(3.5, 4) != 7.5
+      || add_1(3, 4.5) != 7.5
+      || add_2(3.5, 4) != 7.5
+      || add_2(3, 4.5) != 7.5)
+    abort();
+}
diff --git a/gcc/testsuite/g++.dg/concepts/fn-generic-member-ool.C b/gcc/testsuite/g++.dg/concepts/fn-generic-member-ool.C
new file mode 100644 (file)
index 0000000..b664ccf
--- /dev/null
@@ -0,0 +1,36 @@
+// Out-of-line generic member function definitions.
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A {
+  void f(auto x);
+};
+
+void A::f(auto x) {}  // injects a new list
+
+template <typename T>
+struct B {
+  void f(auto x);
+};
+
+template <typename T>
+void B<T>::f(auto x) {}  // injects a new list
+
+struct C {
+  template <int N>
+  void f(auto x);
+};
+
+template <int N>
+void C::f(auto x) {}  // extends existing inner list
+
+template <typename T>
+struct D
+{
+  template <int N>
+  void f(auto x);
+};
+
+template <typename T>
+template <int N>
+void D<T>::f(auto x) {}  // extends existing inner list
diff --git a/gcc/testsuite/g++.dg/concepts/pr58500.C b/gcc/testsuite/g++.dg/concepts/pr58500.C
new file mode 100644 (file)
index 0000000..cb74072
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/58500
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A {};
+
+void foo(auto (A::*)());
diff --git a/gcc/testsuite/g++.dg/concepts/pr58534.C b/gcc/testsuite/g++.dg/concepts/pr58534.C
new file mode 100644 (file)
index 0000000..b2c3caa
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/58534
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template<typename> void foo(const auto&) {}
+
+template<typename, typename...T> void foo(const auto&, T...) {}
diff --git a/gcc/testsuite/g++.dg/concepts/pr58535.C b/gcc/testsuite/g++.dg/concepts/pr58535.C
new file mode 100644 (file)
index 0000000..3e212a0
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/58535
+// { dg-do compile { target c++14 } }
+
+struct A
+{
+  virtual void foo(auto); // { dg-error "auto|templates" }
+};
diff --git a/gcc/testsuite/g++.dg/concepts/pr58536.C b/gcc/testsuite/g++.dg/concepts/pr58536.C
new file mode 100644 (file)
index 0000000..99c7ebe
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/58536
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A
+{
+  A(auto);
+};
+
+A::A(auto) {}
diff --git a/gcc/testsuite/g++.dg/concepts/pr58548.C b/gcc/testsuite/g++.dg/concepts/pr58548.C
new file mode 100644 (file)
index 0000000..cd3e6fd
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/58548
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+void foo(auto)
+{
+  struct A { int i; };
+}
diff --git a/gcc/testsuite/g++.dg/concepts/pr58549.C b/gcc/testsuite/g++.dg/concepts/pr58549.C
new file mode 100644 (file)
index 0000000..6b66afc
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/58549
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+void foo(auto)
+{
+  void bar();
+}
diff --git a/gcc/testsuite/g++.dg/concepts/pr60052.C b/gcc/testsuite/g++.dg/concepts/pr60052.C
new file mode 100644 (file)
index 0000000..c5bc28e
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/60052
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A
+{
+  void foo(auto);
+};
+
+void A::foo(auto) {}
+
+struct B
+{
+  void bar(auto);
+};
diff --git a/gcc/testsuite/g++.dg/concepts/pr60053.C b/gcc/testsuite/g++.dg/concepts/pr60053.C
new file mode 100644 (file)
index 0000000..20cf121
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/60053
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A
+{
+  void foo(auto);
+};
+
+void A::foo(auto) {}
+
+template<typename> struct B
+{
+  template<typename T> void bar(auto);
+};
diff --git a/gcc/testsuite/g++.dg/concepts/pr60064.C b/gcc/testsuite/g++.dg/concepts/pr60064.C
new file mode 100644 (file)
index 0000000..b82b560
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/60064
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+class A
+{
+  int m;
+  friend void foo (auto) {}
+  friend void foo2 (auto);
+};
+
+void foo2 (auto i)
+{
+  A a;
+  a.m = i;
+}
+
+int main ()
+{
+  foo2 (7);
+}
diff --git a/gcc/testsuite/g++.dg/concepts/pr60065.C b/gcc/testsuite/g++.dg/concepts/pr60065.C
new file mode 100644 (file)
index 0000000..b2b1aea
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/60065
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template <int> void foo(auto... x);
+template <typename> void foo2(auto... x);
+template <int> void foo3(auto... x, auto y, auto... z);
+template <typename> void foo4(auto... x, auto y, auto... z);
diff --git a/gcc/testsuite/g++.dg/concepts/pr60377.C b/gcc/testsuite/g++.dg/concepts/pr60377.C
new file mode 100644 (file)
index 0000000..5b18717
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/60377
+// { dg-do compile { target c++14 } }
+
+void foo(auto, void (f*)()); // { dg-error "auto|expected" }
+
+struct A
+{
+  int i;
+};
diff --git a/gcc/testsuite/g++.dg/concepts/pr60390.C b/gcc/testsuite/g++.dg/concepts/pr60390.C
new file mode 100644 (file)
index 0000000..a453d1d
--- /dev/null
@@ -0,0 +1,26 @@
+// PR c++/60390
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A
+{
+  void foo (auto);
+};
+
+class B
+{
+  int m;
+  friend void A::foo (auto);
+};
+
+void A::foo (auto i)
+{
+  B b;
+  b.m = i;
+}
+
+int main ()
+{
+  A a;
+  a.foo (7);
+}
diff --git a/gcc/testsuite/g++.dg/concepts/pr60391.C b/gcc/testsuite/g++.dg/concepts/pr60391.C
new file mode 100644 (file)
index 0000000..5c5ca2c
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/60391
+// { dg-do compile { target c++14 } }
+
+namespace N
+{
+  int operator"" _X(auto) {} // { dg-error "auto|invalid" }
+}
+
+namespace N {}
diff --git a/gcc/testsuite/g++.dg/concepts/pr60573.C b/gcc/testsuite/g++.dg/concepts/pr60573.C
new file mode 100644 (file)
index 0000000..5688491
--- /dev/null
@@ -0,0 +1,28 @@
+// PR c++/60573
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+struct A
+{
+  struct B
+  {
+    void foo(auto);
+  };
+
+  void B::foo(auto) {}  // { dg-error "cannot define" }
+
+  struct X
+  {
+    struct Y
+    {
+      struct Z
+      {
+        void foo(auto);
+      };
+    };
+
+    void Y::Z::foo(auto) {}  // { dg-error "cannot define" }
+  };
+
+  void X::Y::Z::foo(auto) {}  // { dg-error "cannot define" }
+};
diff --git a/gcc/testsuite/g++.dg/concepts/pr80471.C b/gcc/testsuite/g++.dg/concepts/pr80471.C
new file mode 100644 (file)
index 0000000..d5fa5a5
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/80471
+// { dg-do compile { target c++14 } }
+// { dg-additional-options "-fconcepts" }
+
+template <class, class>
+constexpr bool is_same = false;
+template <class T>
+constexpr bool is_same<T, T> = true;
+
+template<class T>
+decltype(auto) f(T&& a){return a;}
+
+decltype(auto) g(auto&& a){return a;}
+
+auto z = [](auto&& a) -> decltype(auto) { return a; };
+
+int main()
+{
+  int i;
+  static_assert(is_same< decltype(f(i)), int& >, "");
+  static_assert(is_same< decltype(g(i)), int  >, "");
+  static_assert(is_same< decltype(z(i)), int& >, "");
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto-60626.C b/gcc/testsuite/g++.dg/cpp0x/auto-60626.C
new file mode 100644 (file)
index 0000000..3567192
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/60626
+// { dg-do compile { target c++14 } }
+
+struct A {};
+
+void (*A::p)(auto) = 0;  // { dg-error "auto|static data member|template" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto-84662.C b/gcc/testsuite/g++.dg/cpp0x/auto-84662.C
new file mode 100644 (file)
index 0000000..271fb56
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/84662
+// { dg-do compile { target c++14 } }
+
+double b;
+a (__attribute__((c (0 && int() - ([] {} && b) || auto))));    // { dg-error "auto|expected constructor, destructor, or type conversion before" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/fn-generic-member-ool.C b/gcc/testsuite/g++.dg/cpp1y/fn-generic-member-ool.C
deleted file mode 100644 (file)
index 60ac52e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Out-of-line generic member function definitions.
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A {
-  void f(auto x);
-};
-
-void A::f(auto x) {}  // injects a new list
-
-template <typename T>
-struct B {
-  void f(auto x);
-};
-
-template <typename T>
-void B<T>::f(auto x) {}  // injects a new list
-
-struct C {
-  template <int N>
-  void f(auto x);
-};
-
-template <int N>
-void C::f(auto x) {}  // extends existing inner list
-
-template <typename T>
-struct D
-{
-  template <int N>
-  void f(auto x);
-};
-
-template <typename T>
-template <int N>
-void D<T>::f(auto x) {}  // extends existing inner list
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58500.C b/gcc/testsuite/g++.dg/cpp1y/pr58500.C
deleted file mode 100644 (file)
index bb68cbc..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// PR c++/58500
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A {};
-
-void foo(auto (A::*)());
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58534.C b/gcc/testsuite/g++.dg/cpp1y/pr58534.C
deleted file mode 100644 (file)
index e38e1f3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// PR c++/58534
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-template<typename> void foo(const auto&) {}
-
-template<typename, typename...T> void foo(const auto&, T...) {}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58535.C b/gcc/testsuite/g++.dg/cpp1y/pr58535.C
deleted file mode 100644 (file)
index b36be8f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/58535
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  virtual void foo(auto); // { dg-error "templates" }
-};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58536.C b/gcc/testsuite/g++.dg/cpp1y/pr58536.C
deleted file mode 100644 (file)
index a4b6f55..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR c++/58536
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  A(auto);
-};
-
-A::A(auto) {}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58548.C b/gcc/testsuite/g++.dg/cpp1y/pr58548.C
deleted file mode 100644 (file)
index 6a78de4..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/58548
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-void foo(auto)
-{
-  struct A { int i; };
-}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58549.C b/gcc/testsuite/g++.dg/cpp1y/pr58549.C
deleted file mode 100644 (file)
index 2f76399..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/58549
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-void foo(auto)
-{
-  void bar();
-}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60052.C b/gcc/testsuite/g++.dg/cpp1y/pr60052.C
deleted file mode 100644 (file)
index 25d20ac..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// PR c++/60052
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  void foo(auto);
-};
-
-void A::foo(auto) {}
-
-struct B
-{
-  void bar(auto);
-};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60053.C b/gcc/testsuite/g++.dg/cpp1y/pr60053.C
deleted file mode 100644 (file)
index a8f5ba1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// PR c++/60053
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  void foo(auto);
-};
-
-void A::foo(auto) {}
-
-template<typename> struct B
-{
-  template<typename T> void bar(auto);
-};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60064.C b/gcc/testsuite/g++.dg/cpp1y/pr60064.C
deleted file mode 100644 (file)
index add3f05..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// PR c++/60064
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-class A
-{
-  int m;
-  friend void foo (auto) {}
-  friend void foo2 (auto);
-};
-
-void foo2 (auto i)
-{
-  A a;
-  a.m = i;
-}
-
-int main ()
-{
-  foo2 (7);
-}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60065.C b/gcc/testsuite/g++.dg/cpp1y/pr60065.C
deleted file mode 100644 (file)
index 56505b7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// PR c++/60065
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-template <int> void foo(auto... x);
-template <typename> void foo2(auto... x);
-template <int> void foo3(auto... x, auto y, auto... z);
-template <typename> void foo4(auto... x, auto y, auto... z);
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60377.C b/gcc/testsuite/g++.dg/cpp1y/pr60377.C
deleted file mode 100644 (file)
index ab35ba9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR c++/60377
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-void foo(auto, void (f*)()); // { dg-error "expected" }
-
-struct A
-{
-  int i;
-};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60390.C b/gcc/testsuite/g++.dg/cpp1y/pr60390.C
deleted file mode 100644 (file)
index 38d0e4b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// PR c++/60390
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  void foo (auto);
-};
-
-class B
-{
-  int m;
-  friend void A::foo (auto);
-};
-
-void A::foo (auto i)
-{
-  B b;
-  b.m = i;
-}
-
-int main ()
-{
-  A a;
-  a.foo (7);
-}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60391.C b/gcc/testsuite/g++.dg/cpp1y/pr60391.C
deleted file mode 100644 (file)
index 7e35704..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR c++/60391
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-namespace N
-{
-  int operator"" _X(auto) {} // { dg-error "invalid" }
-}
-
-namespace N {}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60573.C b/gcc/testsuite/g++.dg/cpp1y/pr60573.C
deleted file mode 100644 (file)
index da730f8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// PR c++/60573
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A
-{
-  struct B
-  {
-    void foo(auto);
-  };
-
-  void B::foo(auto) {}  // { dg-error "cannot define" }
-
-  struct X
-  {
-    struct Y
-    {
-      struct Z
-      {
-        void foo(auto);
-      };
-    };
-
-    void Y::Z::foo(auto) {}  // { dg-error "cannot define" }
-  };
-
-  void X::Y::Z::foo(auto) {}  // { dg-error "cannot define" }
-};
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60626.C b/gcc/testsuite/g++.dg/cpp1y/pr60626.C
deleted file mode 100644 (file)
index 3114644..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// PR c++/60626
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-struct A {};
-
-void (*A::p)(auto) = 0;  // { dg-error "static data member|template" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr80471.C b/gcc/testsuite/g++.dg/cpp1y/pr80471.C
deleted file mode 100644 (file)
index bca4022..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// PR c++/80471
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-template <class, class>
-constexpr bool is_same = false;
-template <class T>
-constexpr bool is_same<T, T> = true;
-
-template<class T>
-decltype(auto) f(T&& a){return a;}
-
-decltype(auto) g(auto&& a){return a;}
-
-auto z = [](auto&& a) -> decltype(auto) { return a; };
-
-int main()
-{
-  int i;
-  static_assert(is_same< decltype(f(i)), int& >, "");
-  static_assert(is_same< decltype(g(i)), int  >, "");
-  static_assert(is_same< decltype(z(i)), int& >, "");
-}
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr84662.C b/gcc/testsuite/g++.dg/cpp1y/pr84662.C
deleted file mode 100644 (file)
index 36bd201..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// PR c++/84662
-// { dg-do compile { target c++14 } }
-// { dg-options "" }
-
-double b;
-a (__attribute__((c (0 && int() - ([] {} && b) || auto))));    // { dg-error "expected constructor, destructor, or type conversion before" }
diff --git a/gcc/testsuite/g++.dg/cpp1z/abbrev1.C b/gcc/testsuite/g++.dg/cpp1z/abbrev1.C
deleted file mode 100644 (file)
index 3caa814..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// PR c++/64969
-// { dg-options "-std=c++17" }
-
-auto f1(auto x) { return *x; }
-decltype(auto) f2(auto x) { return *x; }
-auto f3(auto x) -> int { return *x; }
-
-int i;
-auto r1 = f1(&i);
-auto r2 = f2(&i);
-auto r3 = f3(&i);
diff --git a/gcc/testsuite/g++.dg/cpp1z/abbrev2.C b/gcc/testsuite/g++.dg/cpp1z/abbrev2.C
deleted file mode 100644 (file)
index 1dc6af3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// PR c++/66197
-// { dg-do run }
-// { dg-options "-std=c++17" }
-
-extern "C" void abort();
-
-auto add_1(auto a, auto b) { return a + b; }
-auto add_2 = [](auto a, auto b) { return a + b; };
-
-int main()
-{
-  if (add_1(3.5, 4) != 7.5
-      || add_1(3, 4.5) != 7.5
-      || add_2(3.5, 4) != 7.5
-      || add_2(3, 4.5) != 7.5)
-    abort();
-}
index 529f3732fd5db7c77cd764919a4041c6bf417f8d..1886cdbe90d6295acdb0940c6bc764d4d70b9f23 100644 (file)
@@ -43,7 +43,7 @@ test (A &b, B c)
 
 void
 test2 (auto & [ p ] = bar ())          // { dg-error "'p' was not declared in this scope" }
-{
+{                                      // { dg-warning "auto" "" { target { ! concepts } } .-1 }
 }
 
 int arr[4];