brintos

brintos / llvm-project-archived public Read only

0
0
Text · 479 B · cdff931 Raw
24 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3struct A {4  virtual void f() = 0; // expected-note{{unimplemented pure virtual method}}5};6 7struct B : A {8  virtual void f();9};10 11struct C : B {12  virtual void f() = 0; // expected-note 2{{unimplemented pure virtual method}}13};14 15struct D : C {16};17 18void test() {19  (void)new A; // expected-error{{abstract class}}20  (void)new B;21  (void)new C; // expected-error{{abstract class}}22  (void)new D; // expected-error{{abstract class}}23}24