c.opt (Wc++11-compat): Make primary.

gcc/c-family/
	* c.opt (Wc++11-compat): Make primary.  Rename var warn_cxx11_compat.
	* c-opts.c: Adjust.
gcc/cp/
	* cp-gimplify.c, parser.c: Adjust.

From-SVN: r222962
This commit is contained in:
Jason Merrill 2015-05-09 00:50:15 -04:00 committed by Jason Merrill
parent fe191308dd
commit 765189ff60
6 changed files with 19 additions and 12 deletions

View File

@ -1,5 +1,8 @@
2015-05-08 Jason Merrill <jason@redhat.com>
* c.opt (Wc++11-compat): Make primary. Rename var warn_cxx11_compat.
* c-opts.c: Adjust.
* c.opt (Wc++0x-compat): Also set cpp_warn_cxx11_compat.
2015-05-08 Marek Polacek <polacek@redhat.com>

View File

@ -900,7 +900,7 @@ c_common_post_options (const char **pfilename)
{
/* If we're allowing C++0x constructs, don't warn about C++98
identifiers which are keywords in C++0x. */
warn_cxx0x_compat = 0;
warn_cxx11_compat = 0;
if (warn_narrowing == -1)
warn_narrowing = 1;

View File

@ -312,11 +312,10 @@ C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPE
Warn about C constructs that are not in the common subset of C and C++
Wc++0x-compat
C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT)
Deprecated in favor of -Wc++11-compat
C++ ObjC++ Warning Alias(Wc++11-compat) Undocumented
Wc++11-compat
C++ ObjC++ Warning Alias(Wc++0x-compat)
C++ ObjC++ Var(warn_cxx11_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT)
Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011
Wc++14-compat
@ -627,7 +626,7 @@ C ObjC C++ ObjC++ CPP(warn_multichar) CppReason(CPP_W_MULTICHAR) Var(cpp_warn_mu
Warn about use of multi-character character constants
Wnarrowing
C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++0x-compat)
C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++11-compat)
Warn about narrowing conversions within { } that are ill-formed in C++11
Wnested-externs

View File

@ -1,3 +1,8 @@
2015-05-08 Jason Merrill <jason@redhat.com>
* cp-gimplify.c, parser.c: Adjust to -Wc++11-compat replacing
-Wc++0x-compat.
2015-05-08 Jason Merrill <jason@redhat.com>
* decl2.c (mangling_aliases): New variable.

View File

@ -1231,13 +1231,13 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
}
else
{
if (warn_cxx0x_compat && cxx_dialect < cxx11
if (warn_cxx11_compat && cxx_dialect < cxx11
&& DECL_DESTRUCTOR_P (current_function_decl)
&& (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl))
== NULL_TREE)
&& (get_defaulted_eh_spec (current_function_decl)
== empty_except_spec))
warning_at (loc, OPT_Wc__0x_compat,
warning_at (loc, OPT_Wc__11_compat,
"in C++11 this throw will terminate because "
"destructors default to noexcept");
}

View File

@ -802,13 +802,13 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
}
else
{
if (warn_cxx0x_compat
if (warn_cxx11_compat
&& C_RID_CODE (token->u.value) >= RID_FIRST_CXX0X
&& C_RID_CODE (token->u.value) <= RID_LAST_CXX0X)
{
/* Warn about the C++0x keyword (but still treat it as
an identifier). */
warning (OPT_Wc__0x_compat,
warning (OPT_Wc__11_compat,
"identifier %qE is a keyword in C++11",
token->u.value);
@ -8162,11 +8162,11 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
/* Get an operator token. */
token = cp_lexer_peek_token (parser->lexer);
if (warn_cxx0x_compat
if (warn_cxx11_compat
&& token->type == CPP_RSHIFT
&& !parser->greater_than_is_operator_p)
{
if (warning_at (token->location, OPT_Wc__0x_compat,
if (warning_at (token->location, OPT_Wc__11_compat,
"%<>>%> operator is treated"
" as two right angle brackets in C++11"))
inform (token->location,
@ -11873,7 +11873,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
/* Complain about `auto' as a storage specifier, if
we're complaining about C++0x compatibility. */
warning_at (token->location, OPT_Wc__0x_compat, "%<auto%>"
warning_at (token->location, OPT_Wc__11_compat, "%<auto%>"
" changes meaning in C++11; please remove it");
/* Set the storage class anyway. */