[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / SemaCXX / missing-members.cpp
blob61dddcbe5026b7e0f0fda7c65c09d0456606be13
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 namespace A {
3 namespace B {
4 class C { }; // expected-note {{'A::B::C' declared here}}
5 struct S { };
6 union U { };
10 void f() {
11 A::B::i; // expected-error {{no member named 'i' in namespace 'A::B'}}
12 A::B::C::i; // expected-error {{no member named 'i' in 'A::B::C'}}
13 ::i; // expected-error {{no member named 'i' in the global namespace}}
16 namespace B {
17 class B { };
20 void g() {
21 A::B::D::E; // expected-error-re {{no member named 'D' in namespace 'A::B'{{$}}}}
22 // FIXME: The typo corrections below should be suppressed since A::B::C
23 // doesn't have a member named D.
24 B::B::C::D; // expected-error {{no member named 'C' in 'B::B'; did you mean 'A::B::C'?}} \
25 // expected-error-re {{no member named 'D' in 'A::B::C'{{$}}}}
26 ::C::D; // expected-error-re {{no member named 'C' in the global namespace{{$}}}}
29 int A::B::i = 10; // expected-error {{no member named 'i' in namespace 'A::B'}}
30 int A::B::C::i = 10; // expected-error {{no member named 'i' in 'A::B::C'}}
31 int A::B::S::i = 10; // expected-error {{no member named 'i' in 'A::B::S'}}
32 int A::B::U::i = 10; // expected-error {{no member named 'i' in 'A::B::U'}}
34 using A::B::D; // expected-error {{no member named 'D' in namespace 'A::B'}}
36 struct S : A::B::C {
37 using A::B::C::f; // expected-error {{no member named 'f' in 'A::B::C'}}
41 struct S1 {};
43 struct S2 : S1 {};
45 struct S3 : S2 {
46 void run();
49 struct S4: S3 {};
51 void test(S4 *ptr) {
52 ptr->S1::run(); // expected-error {{no member named 'run' in 'S1'}}