Douglas Gregor - [C++ PATCH] Two trivial tweaks to -Wc++0x-compat (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: Douglas Gregor
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 3 Feb 2007 22:05:44 -0500
- Subject: [C++ PATCH] Two trivial tweaks to -Wc++0x-compat
Hello all,These are two completely trivial patches to tweak the behavior of -Wc+ +0x-compat. The first one turns off -Wc++0x-compat when the C++0x mode is enabled (e.g., via -std=c++0x). The second one makes -Werror=c ++0x-compat work.Tested i386-apple-darwin8.8.1, no regressions.Okay for mainline?
Cheers,
Doug
Index: c-opts.c
--- c-opts.c (revision 121562) +++ c-opts.c (working copy) @@ -1082,6 +1082,11 @@ c_common_post_options (const char **pfil if (flag_isoc99) flag_complex_method = 2;
- /* If we're allowing C++0x constructs, don't warn about C++0x
compatibility problems. */
- if (flag_cpp0x)
- warn_cxx0x_compat = 0;
- if (flag_preprocess_only) { /* Open the output now. We must do so even if flag_no_output is
2007-02-03 Douglas Gregor doug.gregor@gmail.com
* c-opts.c (c_common_post_options): If C++0x mode is enabled, don't
warn about C++0x compatibility.
Index: parser.c
===================================================================
--- parser.c (revision 121562)
+++ parser.c (working copy)
@@ -449,7 +449,8 @@ cp_lexer_get_preprocessor_token (cp_lexe
{
/* Warn about the C++0x keyword (but still treat it as
an identifier). */
- warning (0, "identifier %<%s%> will become a keyword in C++0x",
+ warning (OPT_Wc__0x_compat,
+ "identifier %<%s%> will become a keyword in C+ +0x",
IDENTIFIER_POINTER (token->u.value));
/* Clear out the C_RID_CODE so we don't warn about this2007-02-03 Douglas Gregor doug.gregor@gmail.com
* parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
keyword warning to -Wc++0x-compat.
- Follow-Ups:
- Re: [C++ PATCH] Two trivial tweaks to -Wc++0x-compat
* From: Gabriel Dos Reis
- Re: [C++ PATCH] Two trivial tweaks to -Wc++0x-compat
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |