+2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/28152
+ * parser.c (cp_lexer_get_preprocessor_token): Do not store the
+ canonical spelling for keywords.
+ (cp_parser_attribute_list): Use the canonical spelling for
+ keywords in attributes.
+
2009-05-01 Joseph Myers <joseph@codesourcery.com>
* cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
token->type = CPP_KEYWORD;
/* Record which keyword. */
token->keyword = C_RID_CODE (token->u.value);
- /* Update the value. Some keywords are mapped to particular
- entities, rather than simply having the value of the
- corresponding IDENTIFIER_NODE. For example, `__const' is
- mapped to `const'. */
- token->u.value = ridpointers[token->keyword];
}
else
{
/* Save away the identifier that indicates which attribute
this is. */
- identifier = token->u.value;
+ identifier = (token->type == CPP_KEYWORD)
+ /* For keywords, use the canonical spelling, not the
+ parsed identifier. */
+ ? ridpointers[(int) token->keyword]
+ : token->u.value;
+
attribute = build_tree_list (identifier, NULL_TREE);
/* Peek at the next token. */
+2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/28152
+ * g++.dg/parse/parser-pr28152.C: New.
+ * g++.dg/parse/parser-pr28152-2.C: New.
+
2009-05-04 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/attr-alias-5.c, gcc.dg/ucnid-7.c: New tests.
--- /dev/null
+/* PR 28152: error messages should mention __complex__ */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ __complex__ float z;
+
+ z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" }
+ // { dg-error "expected .;. before .__complex__." "" { target *-*-* } 9 }
+ z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" }
+ // { dg-error "expected .;. before '__complex__'" "" { target *-*-* } 11 }
+ // { dg-error "at end of input" "" { target *-*-* } 11 }
--- /dev/null
+/* PR 28152: error messages should mention _Complex */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ _Complex float z;
+
+ z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" }
+ // { dg-error "expected .;. before ._Complex." "" { target *-*-* } 9 }
+ z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" }
+ // { dg-error "expected .;. before '_Complex'" "" { target *-*-* } 11 }
+ // { dg-error "at end of input" "" { target *-*-* } 11 }