summaryrefslogtreecommitdiffstats
path: root/test/CXX/class.derived/class.abstract/p5.cpp
blob: 207519d17e4e775e376b23de8694e70778e29355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clang_cc1 -fsyntax-only -verify %s

struct A {
  virtual void f() = 0; // expected-note{{pure virtual function}}
};

struct B : A {
  virtual void f();
};

struct C : B {
  virtual void f() = 0; // expected-note 2{{pure virtual function}}
};

struct D : C {
};

void test() {
  (void)new A; // expected-error{{object of abstract type}}
  (void)new B;
  (void)new C; // expected-error{{object of abstract type}}
  (void)new D; // expected-error{{object of abstract type}}
}
OpenPOWER on IntegriCloud