]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28257 (ICE with invalid variable declaration)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Thu, 3 Aug 2006 11:35:52 +0000 (11:35 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 3 Aug 2006 11:35:52 +0000 (11:35 +0000)
PR c++/28257
PR c++/28259
PR c++/28267
* toplev.c (compile_file): Return early on errorcount or sorrycount.
* cgraphunit.c (cgraph_finalize_compilation_unit): Likewise.
(cgraph_optimize): Likewise.

PR c++/28250
* g++.dg/eh/catch4.C: New test.

PR c++/28257
* g++.dg/other/qual1.C: New test.

PR c++/28259
* g++.dg/inherit/error2.C: New test.

PR c++/28267
* g++.dg/other/new1.C: New test.

* g++.dg/warn/pr23075.C: Remove obsolete test.
* g++.old-deja/g++.brendan/crash52.C: Remove dg-warning marker.
* g++.old-deja/g++.jason/report.C: Remove dg-warning marker.

From-SVN: r115901

gcc/ChangeLog
gcc/cgraphunit.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/eh/catch4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/inherit/error2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/new1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/qual1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/pr23075.C
gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
gcc/testsuite/g++.old-deja/g++.jason/report.C
gcc/toplev.c

index 4878692eb3893190229dea2df04ce782b4fef35e..3a45fd0efb228be5d7baa6222899bce02f50d357 100644 (file)
@@ -1,3 +1,12 @@
+2006-08-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/28257
+       PR c++/28259
+       PR c++/28267
+       * toplev.c (compile_file): Return early on errorcount or sorrycount.
+       * cgraphunit.c (cgraph_finalize_compilation_unit): Likewise.
+       (cgraph_optimize): Likewise.
+
 2006-07-30  Roger Sayle  <roger@eyesopen.com>
 
        PR middle-end/28473
index a491d782319305d8eafd75e0f99819939803c83d..c0fd68d12735f354b506aa509942161077fbda94 100644 (file)
@@ -682,6 +682,9 @@ cgraph_finalize_compilation_unit (void)
 {
   struct cgraph_node *node;
 
+  if (errorcount || sorrycount)
+    return;
+
   finish_aliases_1 ();
 
   if (!flag_unit_at_a_time)
@@ -1764,6 +1767,9 @@ cgraph_preserve_function_body_p (tree decl)
 void
 cgraph_optimize (void)
 {
+  if (errorcount || sorrycount)
+    return;
+
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
 #endif
index e342f45901807e43ec6978fa888f4e035ae2b56b..71755d9e65060d90683f2c24e077b3072b4c63a5 100644 (file)
@@ -1,5 +1,21 @@
 2006-08-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/28250
+       * g++.dg/eh/catch4.C: New test.
+
+       PR c++/28257
+       * g++.dg/other/qual1.C: New test.
+
+       PR c++/28259
+       * g++.dg/inherit/error2.C: New test.
+
+       PR c++/28267
+       * g++.dg/other/new1.C: New test.
+
+       * g++.dg/warn/pr23075.C: Remove obsolete test.
+       * g++.old-deja/g++.brendan/crash52.C: Remove dg-warning marker.
+       * g++.old-deja/g++.jason/report.C: Remove dg-warning marker.
+
        PR c++/27508
        * g++.dg/parse/dtor9.C: New test.
        * g++.dg/parse/dtor10.C: New test.
diff --git a/gcc/testsuite/g++.dg/eh/catch4.C b/gcc/testsuite/g++.dg/eh/catch4.C
new file mode 100644 (file)
index 0000000..34cf712
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/28250
+// { dg-do compile }
+
+void foo()
+{
+  try { throw; }
+  catch () {}  // { dg-error "type-specifier" }
+}
diff --git a/gcc/testsuite/g++.dg/inherit/error2.C b/gcc/testsuite/g++.dg/inherit/error2.C
new file mode 100644 (file)
index 0000000..5a7c294
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/28259
+// { dg-do compile }
+
+struct A
+{
+  virtual A* foo();
+};
+
+struct B : virtual A;  // { dg-error "before" }
+
+struct C : A
+{
+  virtual B* foo();
+};
+
+B* C::foo() { return 0; }
diff --git a/gcc/testsuite/g++.dg/other/new1.C b/gcc/testsuite/g++.dg/other/new1.C
new file mode 100644 (file)
index 0000000..30b6513
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/28267
+// { dg-do compile }
+
+struct A
+{
+  A();
+  void* operator new(__SIZE_TYPE__, int = X);  // { dg-error "not declared" }
+  void operator delete(void*, int);
+};
+
+void foo()
+{
+  new A;
+}
diff --git a/gcc/testsuite/g++.dg/other/qual1.C b/gcc/testsuite/g++.dg/other/qual1.C
new file mode 100644 (file)
index 0000000..bd6f234
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/28257
+// { dg-do compile }
+
+struct A
+{
+  int i;
+  void foo()
+  {
+    int A::i = i;  // { dg-error "extra qualification|not a static member" }
+  }
+};
index cc71deada53d904ab6ab3c59007e31e3463871f3..1521b658139c6c8af6371bec0cb4ac25dcde6401 100644 (file)
@@ -7,8 +7,3 @@ foo (void)
 {
   return;      // { dg-error "with no value" }
 }              // { dg-bogus "control reaches end" }
-
-int
-bar (void)
-{
-}              // { dg-warning "control reaches end" }
index 95c6a08322e76268b477db2bdd13bbd3e13d293f..9e72fb5cbb034354639c23f1352f8f8b903605fe 100644 (file)
@@ -10,5 +10,4 @@ public:
 
 A &f(A &a) {// { dg-error "" }  new decl.*
   std::cout << "Blah\n";
-} // { dg-warning "" } no return
-
+}
index c1b9a57bbb0b529f68ca9176476e2e6d0d26d929..7a0ea751fddad96d460ea0c85ef5366145f50ccb 100644 (file)
@@ -56,7 +56,7 @@ bar2 baz (X::Y y)             // { dg-error "" } in this context
   bar2 wa [5];
   wa[0] = baz(f);
   undef2 (1); // { dg-error "" } implicit declaration
-} // { dg-warning "" } no return
+}
 
 int ninny ()
 {
@@ -71,4 +71,4 @@ int ninny ()
 int darg (char X::*p)
 {
    undef3 (1); // { dg-error "" } implicit declaration
-} // { dg-warning "" } no return
+}
index d2d2e752cdfbef39fb0d256c25044a66a0382fea..362db01091b4bf2a39c48463e330db274a923f80 100644 (file)
@@ -1017,7 +1017,7 @@ compile_file (void)
      what's left of the symbol table output.  */
   timevar_pop (TV_PARSE);
 
-  if (flag_syntax_only)
+  if (flag_syntax_only || errorcount || sorrycount)
     return;
 
   lang_hooks.decls.final_write_globals ();