* c.opt (Wnoexcept-type): New.
gcc/cp/
* mangle.c (mangle_decl): Check -Wnoexcept-type instead of
-Wc++1z-compat.
From-SVN: r245894
+2017-03-03 Jason Merrill <jason@redhat.com>
+
+ * c.opt (Wnoexcept-type): New.
+
2017-03-02 Richard Biener <rguenther@suse.de>
PR c/79756
C++ ObjC++ Var(warn_noexcept) Warning
Warn when a noexcept expression evaluates to false even though the expression can't actually throw.
+Wnoexcept-type
+C++ ObjC++ Warning Var(warn_noexcept_type) LangEnabledBy(C++ ObjC++,Wabi || Wc++1z-compat)
+Warn if C++1z noexcept function type will change the mangled name of a symbol.
+
Wnon-template-friend
C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warning
Warn when non-templatized friend functions are declared within a template.
2017-03-03 Jason Merrill <jason@redhat.com>
+ * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
+ -Wc++1z-compat.
+
Core issues 2273 and 2277
* call.c (joust): Adjust using-declaration tiebreaker to handle
the intermediate base case.
if (G.need_cxx1z_warning
&& (TREE_PUBLIC (decl) || DECL_REALLY_EXTERN (decl)))
- warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wc__1z_compat,
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wnoexcept_type,
"mangled name for %qD will change in C++17 because the "
"exception specification is part of a function type",
decl);
-Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol
-Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
-Wnamespaces -Wnarrowing @gol
--Wnoexcept -Wnon-virtual-dtor -Wreorder -Wregister @gol
+-Wnoexcept -Wnoexcept-type -Wnon-virtual-dtor -Wreorder -Wregister @gol
-Weffc++ -Wstrict-null-sentinel -Wtemplates @gol
-Wno-non-template-friend -Wold-style-cast @gol
-Woverloaded-virtual -Wno-pmf-conversions @gol
specification (i.e. @code{throw()} or @code{noexcept}) but is known by
the compiler to never throw an exception.
+@item -Wnoexcept @r{(C++ and Objective-C++ only)}
+@opindex Wnoexcept-type
+@opindex Wno-noexcept-type
+Warn if the C++1z feature making @code{noexcept} part of a function
+type changes the mangled name of a symbol relative to C++14. Enabled
+by @option{-Wabi} and @option{-Wc++1z-compat}.
+
+@smallexample
+template <class T> void f(T t) @{ t(); @};
+void g() noexcept;
+void h() @{ f(g); @} // in C++14 calls f<void(*)()>, in C++1z calls f<void(*)()noexcept>
+@end smallexample
+
+
@item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
@opindex Wnon-virtual-dtor
@opindex Wno-non-virtual-dtor
--- /dev/null
+// { dg-options "-Wall -Wno-noexcept-type -std=c++14" }
+
+void f(int(*)() noexcept) { }