brintos

brintos / llvm-project-archived public Read only

0
0
Text · 461 B · 713a526 Raw
24 lines · cpp
1// RUN: %clang_cc1 -std=c++1z -verify %s2 3// no objects of an abstract class can be created except as subobjects of a4// class derived from it5 6struct A {7  A() {}8  A(int) : A() {} // ok9 10  virtual void f() = 0; // expected-note 1+{{unimplemented}}11};12 13void f(A &&a);14 15void g() {16  f({}); // expected-error {{abstract class}}17  f({0}); // expected-error {{abstract class}}18  f(0); // expected-error {{abstract class}}19}20 21struct B : A {22  B() : A() {} // ok23};24