re PR c++/28152 (Diagnostic about wrong use _Complex prints __complex__)

2008-08-08  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

        PR c/28152
	* c-parser.c (c_lex_one_token): Do not store the canonical spelling
	for keywords.
testsuite/
	* gcc.dg/parser-pr28152.c: New.
	* gcc.dg/parser-pr28152-2.c: New.

From-SVN: r139097
This commit is contained in:
Manuel López-Ibáñez 2008-08-14 13:01:58 +00:00
parent 32ff12435e
commit 4265559a69
5 changed files with 34 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2008-08-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/28152
* c-parser.c (c_lex_one_token): Do not store the canonical spelling
for keywords.
2008-08-14 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_create_epilog_for_reduction): Takes an

View file

@ -241,8 +241,6 @@ c_lex_one_token (c_parser *parser, c_token *token)
}
else
{
/* Return the canonical spelling for this keyword. */
token->value = ridpointers[(int) rid_code];
token->type = CPP_KEYWORD;
token->keyword = rid_code;
break;

View file

@ -1,3 +1,9 @@
2008-08-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/28152
* gcc.dg/parser-pr28152.c: New.
* gcc.dg/parser-pr28152-2.c: New.
2008-08-14 Dorit Nuzman <dorit@il.ibm.com>
* gcc.dg/vect/vect-outer-4g.c: Change loop bound.

View file

@ -0,0 +1,11 @@
/* 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 "__complex__" } */
z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" } */
/* { dg-error "at end of input" "" { target *-*-* } 10 } */

View file

@ -0,0 +1,11 @@
/* 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 "_Complex" } */
z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" } */
/* { dg-error "at end of input" "" { target *-*-* } 10 } */