re PR c++/37532 (ICE with decimal floating point data types)

PR c++/37532
	* lex.c (init_reswords): Don't populate ridpointers for D_CONLY
	reserved words.

	* g++.dg/parse/crash46.C: New test.

From-SVN: r140399
This commit is contained in:
Jakub Jelinek 2008-09-17 00:03:57 +02:00 committed by Jakub Jelinek
parent a8d0ab1d24
commit 08222495cc
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/37532
* lex.c (init_reswords): Don't populate ridpointers for D_CONLY
reserved words.
2008-09-15 Aldy Hernandez <aldyh@redhat.com>
* decl.c (duplicate_decls): Call error_at.

View File

@ -172,7 +172,6 @@ init_reswords (void)
tree id;
int mask = 0;
mask |= D_CONLY;
if (cxx_dialect != cxx0x)
mask |= D_CXX0X;
if (flag_no_asm)
@ -186,6 +185,8 @@ init_reswords (void)
ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX);
for (i = 0; i < num_c_common_reswords; i++)
{
if (c_common_reswords[i].disable & D_CONLY)
continue;
id = get_identifier (c_common_reswords[i].word);
C_SET_RID_CODE (id, c_common_reswords[i].rid);
ridpointers [(int) c_common_reswords[i].rid] = id;

View File

@ -1,5 +1,8 @@
2008-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/37532
* g++.dg/parse/crash46.C: New test.
PR testsuite/36889
* lib/fortran-torture.exp (get-fortran-torture-options): Only
set test_tree_vectorize on i?86/x86_64 resp. sparc* if sse2 resp.

View File

@ -0,0 +1,18 @@
// PR c++/37532
// { dg-do compile }
void
foo (_Decimal32) // { dg-error "declared void" }
{
}
// { dg-error "was not declared" "" { target *-*-* } 5 }
void
bar (_Bool) // { dg-error "declared void" }
{
}
// { dg-error "was not declared" "" { target *-*-* } 10 }
void
baz (_Fract) // { dg-error "declared void" }
{
}
// { dg-error "was not declared" "" { target *-*-* } 15 }