diff mbox

C++ PATCH for c++/79400, confusing suggestion of 'noexcept'

Message ID CADzB+2kA6J3jW_PmnW7HtXeUjcjAeOa2WQzb8_WCpa2AUFmKDA@mail.gmail.com
State New
Headers show

Commit Message

Jason Merrill Feb. 20, 2017, 5:54 a.m. UTC
It was pointed out that suggesting noexcept as an alternative to
throw(type) doesn't make much sense, since throw(type) would imply
noexcept(false), which is the default.  So let's just remove the
suggestion.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 41d5a30463d1f62dfb64ec953b662e1eda5faf74
Author: Jason Merrill <jason@redhat.com>
Date:   Sun Feb 19 14:47:17 2017 -0800

            PR c++/79400 - confusing suggestion of 'noexcept'
    
            * parser.c (cp_parser_exception_specification_opt): Remove
            suggestion for deprecated dynamic exception-specification.
diff mbox

Patch

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 4656b4f..72597f3 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -23926,8 +23926,8 @@  cp_parser_exception_specification_opt (cp_parser* parser)
 	}
       else if (cxx_dialect >= cxx11 && !in_system_header_at (loc))
 	warning_at (loc, OPT_Wdeprecated,
-		    "dynamic exception specifications are deprecated in C++11;"
-		    " use %<noexcept%> instead");
+		    "dynamic exception specifications are deprecated in "
+		    "C++11");
     }
   /* In C++17, throw() is equivalent to noexcept (true).  throw()
      is deprecated in C++11 and above as well, but is still widely used,