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]

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;

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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]