brintos

brintos / llvm-project-archived public Read only

0
0
Text · 911 B · 9e8d243 Raw
38 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-inaccessible-base %s2struct A {3  virtual void f() = 0; // expected-note 2{{overridden virtual function}}4};5 6struct Aprime : virtual A {7  virtual void f();8};9 10struct B : Aprime {11  virtual void f(); // expected-note 3{{final overrider of 'A::f'}}12};13 14struct C : virtual A {15  virtual void f(); // expected-note{{final overrider of 'A::f'}}16};17 18struct D : B, C { }; // expected-error{{virtual function 'A::f' has more than one final overrider in 'D'}}19 20struct B2 : B { };21 22struct E : B, B2 { }; //expected-error{{virtual function 'A::f' has more than one final overrider in 'E'}}23 24struct F : B, B2 {25  virtual void f(); // okay26};27 28struct G : F { }; // okay29 30struct H : G, A { }; // okay31 32namespace MultipleSubobjects {33  struct A { virtual void f(); };34  struct B : A { virtual void f(); };35  struct C : A { virtual void f(); };36  struct D : B, C { }; // okay37}38