re PR c++/78283 (-Wc++1z-compat warning is sticky)
authorJakub Jelinek <jakub@redhat.com>
Wed, 9 Nov 2016 22:56:35 +0000 (23:56 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 9 Nov 2016 22:56:35 +0000 (23:56 +0100)
PR c++/78283
* mangle.c (start_mangling): Reset G.need_cxx1z_warning.

* g++.dg/cpp1z/noexcept-type13.C: New test.

From-SVN: r242026

gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C [new file with mode: 0644]

index 2e3b15d55795a72121fbeaa8f792caa831a809b8..49561fc68329ced0587c50b0eab8c218d962f2e9 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/78283
+       * mangle.c (start_mangling): Reset G.need_cxx1z_warning.
+
 2016-11-09  Jason Merrill  <jason@redhat.com>
 
        * parser.c (cp_parser_simple_type_specifier): Allow placeholder
index a354ec5ead3d485aee7b256c0710f4735af1ec8e..2dcec3b1968f5df36e6d696c5681fa5c50f044cc 100644 (file)
@@ -3649,6 +3649,7 @@ start_mangling (const tree entity)
 {
   G.entity = entity;
   G.need_abi_warning = false;
+  G.need_cxx1z_warning = false;
   obstack_free (&name_obstack, name_base);
   mangle_obstack = &name_obstack;
   name_base = obstack_alloc (&name_obstack, 0);
index 0418e76fa248a9675e5349e267f7bf5314559848..43bbdf9eb61bb88f9a011111359d0145140995f2 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/78283
+       * g++.dg/cpp1z/noexcept-type13.C: New test.
+
 2016-11-09  Toma Tabacu  <toma.tabacu@imgtec.com>
 
        * gcc.target/mips/mips.exp (mips-dg-options): Upgrade to MIPS IV if
diff --git a/gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C b/gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C
new file mode 100644 (file)
index 0000000..8eb3be0
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/78283
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+void foo () throw () {}                // { dg-bogus "mangled name" }
+
+template <class T>
+T bar (T x) { return x; }      // { dg-warning "mangled name" "" { target c++14_down } }
+
+void baz () {                  // { dg-bogus "mangled name" }
+  return (bar (foo)) ();
+}
+
+void decl () {}                        // { dg-bogus "mangled name" }