Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / PR9572.cpp
blobd0ba32eb1ab1019ef5385f3252c7e88be0f5027c
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 class Base {
6 virtual ~Base();
7 #if __cplusplus <= 199711L
8 // expected-note@-2 {{implicitly declared private here}}
9 #else
10 // expected-note@-4 {{overridden virtual function is here}}
11 #endif
14 struct Foo : public Base {
15 #if __cplusplus <= 199711L
16 // expected-error@-2 {{base class 'Base' has private destructor}}
17 #else
18 // expected-error@-4 {{deleted function '~Foo' cannot override a non-deleted function}}
19 // expected-note@-5 3{{destructor of 'Foo' is implicitly deleted because base class 'Base' has an inaccessible destructor}}
20 #endif
22 const int kBlah = 3;
23 #if __cplusplus <= 199711L
24 // expected-warning@-2 {{default member initializer for non-static data member is a C++11 extension}}
25 #endif
27 Foo();
30 struct Bar : public Foo {
31 Bar() { }
32 #if __cplusplus <= 199711L
33 // expected-note@-2 {{implicit destructor for 'Foo' first required here}}
34 #else
35 // expected-error@-4 {{attempt to use a deleted function}}
36 #endif
39 struct Baz {
40 Foo f;
41 Baz() { }
42 #if __cplusplus >= 201103L
43 // expected-error@-2 {{attempt to use a deleted function}}
44 #endif