re PR c++/23426 (Too large array problem gives two error message)
2005-10-28 Andrew Pinski <pinskia@physics.uc.edu> PR C++/23426 * decl.c (start_decl): Check that the decl is an error_mark_node before getting the type. Remove the check for the decl's type being an error_mark_node. 2005-10-28 Andrew Pinski <pinskia@physics.uc.edu> PR C++/23426 * g++.dg/other/large-size-array.C: New test. From-SVN: r105936
This commit is contained in:
parent
1b9f940b0c
commit
2d00b4f207
4 changed files with 38 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR C++/23426
|
||||
* decl.c (start_decl): Check that the decl is an
|
||||
error_mark_node before getting the type.
|
||||
Remove the check for the decl's type being an
|
||||
error_mark_node.
|
||||
|
||||
2005-10-21 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/24260
|
||||
|
|
|
@ -3640,14 +3640,12 @@ start_decl (const cp_declarator *declarator,
|
|||
|
||||
deprecated_state = DEPRECATED_NORMAL;
|
||||
|
||||
if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE)
|
||||
if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE
|
||||
|| decl == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
type = TREE_TYPE (decl);
|
||||
|
||||
if (type == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
context = DECL_CONTEXT (decl);
|
||||
|
||||
if (context)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR C++/23426
|
||||
* g++.dg/other/large-size-array.C: New test.
|
||||
|
||||
2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR middle-end/24362
|
||||
|
|
23
gcc/testsuite/g++.dg/other/large-size-array.C
Normal file
23
gcc/testsuite/g++.dg/other/large-size-array.C
Normal file
|
@ -0,0 +1,23 @@
|
|||
/* { dg-do compile } */
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef __LP64__
|
||||
#define DIM UINT_MAX>>1
|
||||
#else
|
||||
#define DIM USHRT_MAX>>1
|
||||
#endif
|
||||
|
||||
int
|
||||
sub (int *a)
|
||||
{
|
||||
return a[0];
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */
|
||||
return sub (&a[0][0]);
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue