Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/abstract-default1.C

raw
1 // PR c++/83796
2 // { dg-do compile { target c++11 } }
3
4 struct MyAbstractClass
5 {
6 virtual int foo() const = 0;
7 };
8
9 struct TestClass
10 {
11 TestClass(const MyAbstractClass& m = {}) // { dg-error "abstract type" }
12 : value_(m.foo()) {}
13
14 int value_;
15 };
16
17 int TestFunction(const MyAbstractClass& m = {}) // { dg-error "abstract type" }
18 {
19 return m.foo();
20 }
21
22 int main()
23 {
24 TestClass testInstance; // { dg-error "abstract type" }
25 TestFunction(); // { dg-error "abstract type" }
26 }