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