From 0391e4a3b3c1095d2f74ef8bbcef29fb31706813 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 9 Nov 2016 23:56:35 +0100 Subject: [PATCH] re PR c++/78283 (-Wc++1z-compat warning is sticky) 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 | 5 +++++ gcc/cp/mangle.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C | 14 ++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2e3b15d5579..49561fc6832 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-11-09 Jakub Jelinek + + PR c++/78283 + * mangle.c (start_mangling): Reset G.need_cxx1z_warning. + 2016-11-09 Jason Merrill * parser.c (cp_parser_simple_type_specifier): Allow placeholder diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a354ec5ead3..2dcec3b1968 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0418e76fa24..43bbdf9eb61 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-09 Jakub Jelinek + + PR c++/78283 + * g++.dg/cpp1z/noexcept-type13.C: New test. + 2016-11-09 Toma Tabacu * 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 index 00000000000..8eb3be0bd61 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/noexcept-type13.C @@ -0,0 +1,14 @@ +// PR c++/78283 +// { dg-do compile } +// { dg-options "-Wall" } + +void foo () throw () {} // { dg-bogus "mangled name" } + +template +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" } -- 2.30.2