aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 40009c2..fa18e20 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -443,6 +443,20 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
}
else
{
+ if (warn_cxx0x_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 (0, "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 this
+ particular identifier-turned-keyword again. */
+ C_RID_CODE (token->u.value) = RID_MAX;
+ }
+
token->ambiguous_p = false;
token->keyword = RID_MAX;
}