OSDN Git Service

2005-10-28 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2005 14:57:30 +0000 (14:57 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 2005 14:57:30 +0000 (14:57 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105936 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/large-size-array.C [new file with mode: 0644]

index dee7410..d2ec158 100644 (file)
@@ -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
index 2431877..ef61d17 100644 (file)
@@ -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)
index 7d844ac..bd5ff26 100644 (file)
@@ -1,5 +1,10 @@
 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.
 
diff --git a/gcc/testsuite/g++.dg/other/large-size-array.C b/gcc/testsuite/g++.dg/other/large-size-array.C
new file mode 100644 (file)
index 0000000..900c503
--- /dev/null
@@ -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]);
+}
+
+