Commit 2d00b4f2 by Andrew Pinski Committed by Andrew Pinski

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
parent 1b9f940b
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)
......
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
* g++.dg/opt/complex4.C: New test.
/* { 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]);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment