[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / SemaCXX / dr1301.cpp
blobb7dc91d563300058a74db3b5038dd825a5717163
1 // RUN: %clang_cc1 -std=c++11 -verify %s
2 struct A { // expected-note 2{{candidate}}
3 A(int); // expected-note {{candidate}}
4 int n;
5 };
6 int a = A().n; // expected-error {{no matching constructor}}
8 struct B {
9 B() = delete; // expected-note 4{{here}}
10 int n;
12 int b = B().n; // expected-error {{call to deleted}}
14 struct C {
15 B b; // expected-note {{deleted default constructor}}
17 int c = C().b.n; // expected-error {{call to implicitly-deleted default}}
19 struct D {
20 D() = default; // expected-note {{here}} expected-warning {{implicitly deleted}}
21 B b; // expected-note 2{{'b' has a deleted default constructor}}
23 int d = D().b.n; // expected-error {{call to implicitly-deleted default}}
25 struct E {
26 E() = default;
27 int n;
29 int e = E().n; // ok
31 struct F {
32 F();
33 int n;
35 int f = F().n; // ok
37 union G {
38 F f; // expected-note {{non-trivial default constructor}}
40 int g = G().f.n; // expected-error {{call to implicitly-deleted default}}
42 struct H {
43 int n;
44 private:
45 H(); // expected-note {{here}}
47 int h = H().n; // expected-error {{private constructor}}
49 struct I {
50 H h; // expected-note {{inaccessible default constructor}}
52 int i = I().h.n; // expected-error {{call to implicitly-deleted default}}
54 struct J {
55 J();
56 virtual int f();
57 int n;
59 int j1 = J().n; // ok
60 int j2 = J().f(); // ok
62 union K {
63 J j; // expected-note 2{{non-trivial default constructor}}
64 int m;
66 int k1 = K().j.n; // expected-error {{call to implicitly-deleted default}}
67 int k2 = K().j.f(); // expected-error {{call to implicitly-deleted default}}