You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
461 B
24 lines
461 B
4 months ago
|
// RUN: %clang_cc1 -std=c++1z -verify %s
|
||
|
|
||
|
// no objects of an abstract class can be created except as subobjects of a
|
||
|
// class derived from it
|
||
|
|
||
|
struct A {
|
||
|
A() {}
|
||
|
A(int) : A() {} // ok
|
||
|
|
||
|
virtual void f() = 0; // expected-note 1+{{unimplemented}}
|
||
|
};
|
||
|
|
||
|
void f(A &&a);
|
||
|
|
||
|
void g() {
|
||
|
f({}); // expected-error {{abstract class}}
|
||
|
f({0}); // expected-error {{abstract class}}
|
||
|
f(0); // expected-error {{abstract class}}
|
||
|
}
|
||
|
|
||
|
struct B : A {
|
||
|
B() : A() {} // ok
|
||
|
};
|