This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ Patch] Add PR 31027 Testcase
- From: Paolo Carlini <pcarlini at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Jul 2007 17:54:30 +0200
- Subject: [C++ Patch] Add PR 31027 Testcase
Hi,
this test now certainly passes in mainline and 4_2-branch. I propose to
add it to both branches and remove the 4.2 / 4.3 regression markers.
Tested x86_64-linux, ok?
Paolo.
///////////////////
2007-07-11 Paolo Carlini <pcarlini@suse.de>
PR c++/31027
* g++.dg/inherit/virtual4.C: New.
Index: g++.dg/inherit/virtual4.C
===================================================================
*** g++.dg/inherit/virtual4.C (revision 0)
--- g++.dg/inherit/virtual4.C (revision 0)
***************
*** 0 ****
--- 1,24 ----
+ // PR c++/31027
+
+ struct A {};
+
+ template<typename T>
+ struct C: virtual A {
+ C() {}
+ template<typename T_OTHER> C(const C<T_OTHER>&) {}
+ C func(const class C<long>&) const;
+ operator bool() const;
+ };
+
+ template<typename T>
+ struct D: C<T> {
+ void func2() {
+ C<int>a;
+ a.func(a);
+ }
+ };
+
+ void func3() {
+ C<int>a;
+ a.func(a);
+ }