Revert "Reapply "[llvm-jitlink] Use concurrent linking by default." with fixes. ...
[llvm-project.git] / clang / test / CXX / class.derived / class.abstract / p4.cpp
blobb04de213874f3b6c8c09b113eaee0fdcc99248e8
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 namespace PR6631 {
4 struct A {
5 virtual void f() = 0;
6 };
8 struct B : virtual A { };
10 struct C : virtual A {
11 virtual void f();
14 struct D : public B, public C {
15 virtual void f();
18 void f() {
19 (void)new D; // okay
23 // Check cases where we have a virtual function that is pure in one
24 // subobject but not pure in another subobject.
25 namespace PartlyPure {
26 struct A {
27 virtual void f() = 0; // expected-note{{unimplemented pure virtual method}}
30 struct B : A {
31 virtual void f();
34 struct C : virtual A { };
36 struct D : B, C { };
38 void f() {
39 (void) new D; // expected-error{{abstract class}}
43 namespace NonPureAlongOnePath {
44 struct A {
45 virtual void f() = 0;
48 struct B : virtual A {
49 virtual void f();
52 struct C : virtual A { };
54 struct D : B, C { };
56 void f() {
57 (void) new D; // okay
61 namespace NonPureAlongOnePath2 {
62 struct Aprime {
63 virtual void f() = 0;
66 struct A : Aprime {
69 struct B : virtual A {
70 virtual void f();
73 struct C : virtual A { };
75 struct D : B, C { };
77 void f() {
78 (void) new D; // okay