diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/virtual4.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/virtual4.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/virtual4.C b/gcc/testsuite/g++.old-deja/g++.other/virtual4.C new file mode 100644 index 000000000..6933755ab --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/virtual4.C @@ -0,0 +1,25 @@ +// { dg-do assemble } + +class A { +public: + virtual int foo() = 0; // { dg-error "" } original definition +}; + +class B { +public: + virtual double foo() = 0; +}; + +class C + : public A, public B +{ +public: + virtual double foo() { return 2; } // { dg-error "" } conflicting return type +}; + +class D + : public B, public A +{ +public: + virtual double foo() { return 2; } // { dg-error "" } conflicting return type +}; |