OSDN Git Service

PR c++/28250
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Aug 2006 23:45:11 +0000 (23:45 +0000)
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Aug 2006 23:45:11 +0000 (23:45 +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.

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

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 8cf2670..aaba0cc 100644 (file)
@@ -1,3 +1,13 @@
+2006-08-01  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/28250
+       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-08-01  Stuart Hastings  <stuart@apple.com>
 
        * rtl.h (UINTVAL) New.
index 606cd75..2568502 100644 (file)
@@ -1018,6 +1018,9 @@ cgraph_finalize_compilation_unit (void)
   static struct cgraph_node *first_analyzed;
   static struct cgraph_varpool_node *first_analyzed_var;
 
+  if (errorcount || sorrycount)
+    return;
+
   finish_aliases_1 ();
 
   if (!flag_unit_at_a_time)
@@ -1466,6 +1469,9 @@ ipa_passes (void)
 void
 cgraph_optimize (void)
 {
+  if (errorcount || sorrycount)
+    return;
+
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
 #endif
index 1e1effc..48701d0 100644 (file)
@@ -1,3 +1,21 @@
+2006-08-01  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.
+
 2006-07-31  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/28523
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 cc71dea..1521b65 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 95c6a08..9e72fb5 100644 (file)
@@ -10,5 +10,4 @@ public:
 
 A &f(A &a) {// { dg-error "" }  new decl.*
   std::cout << "Blah\n";
-} // { dg-warning "" } no return
-
+}
index 77fd7c3..e2d805e 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 f6ff302..55019ed 100644 (file)
@@ -1006,7 +1006,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 ();