[patch] Add two new C++ testcases

Lee Millward lee.millward@codesourcery.com
Tue Dec 12 21:50:00 GMT 2006


Hi,

My patch for PR29022 actually fixed two other bugs as well (as pointed
out by Volker Reichelt in Bugzilla) - PR28740 and PR27316 however the
testcases from these bugs haven't been added to the testsuite.

The attached patch adds the testcases from these two bugs to the C++
testsuite, ok to apply? Any particular preference for the names of the
new tests?

Cheers,
Lee.

:ADDPATCH c++:

2006-12-12  Lee Millward  <lee.millward@codesourcery.com>

	PR c++27316
	* g++.dg/inherit/error3.C: New test.

	PR c++/28740
	* g++.dg/inherit/error4.C: New test.
-------------- next part --------------
Index: gcc/testsuite/g++.dg/inherit/error3.C
===================================================================
--- gcc/testsuite/g++.dg/inherit/error3.C	(revision 0)
+++ gcc/testsuite/g++.dg/inherit/error3.C	(revision 0)
@@ -0,0 +1,11 @@
+//PR c++/27316
+
+struct A {};
+
+struct B : A
+!               // { dg-error "token" }
+{};
+
+struct B : A
+!               // { dg-error "token" }
+{};
Index: gcc/testsuite/g++.dg/inherit/error4.C
===================================================================
--- gcc/testsuite/g++.dg/inherit/error4.C	(revision 0)
+++ gcc/testsuite/g++.dg/inherit/error4.C	(revision 0)
@@ -0,0 +1,10 @@
+//PR c++/28740
+
+struct A { virtual ~A(); };
+
+struct B : A A {};            // { dg-error "'A'|function definition|extra" }
+
+A foo(const B &b)
+{
+  return b;                   // { dg-error "conversion" }
+}


More information about the Gcc-patches mailing list