1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 struct A {
3 virtual ~A();
4 };
5
6 struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
BB7 B() { } // expected-note {{implicit destructor for 'B' first required here}}
8 void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
9 };
10
11 struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
12 void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
13 };
14
f()15 void f() {
16 (void)new B;
17 (void)new C; // expected-note {{implicit destructor for 'C' first required here}}
18 }
19
20 // Make sure that the key-function computation is consistent when the
21 // first virtual member function of a nested class has an inline body.
22 struct Outer {
23 struct Inner {
fOuter::Inner24 virtual void f() { }
25 void g();
26 };
27 };
28
g()29 void Outer::Inner::g() { }
30