[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / expr / expr.prim / expr.prim.general / p12-0x.cpp
blob249c976460897a2b0954d27b3f45d2d051ba7671
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 struct S {
4 int *j = &nonexistent; // expected-error {{use of undeclared identifier 'nonexistent'}}
5 int *m = &n; // ok
7 int n = f(); // ok
8 int f();
9 };
11 int i = sizeof(S::m); // ok
12 int j = sizeof(S::m + 42); // ok
15 struct T {
16 int n;
17 static void f() {
18 int a[n]; // expected-error {{invalid use of member 'n' in static member function}}
19 int b[sizeof n]; // ok
23 // Make sure the rule for unevaluated operands works correctly with typeid.
24 namespace std {
25 class type_info;
27 class Poly { virtual ~Poly(); };
28 const std::type_info& k = typeid(S::m);
29 const std::type_info& m = typeid(*(Poly*)S::m); // expected-error {{invalid use of non-static data member}}
30 const std::type_info& n = typeid(*(Poly*)(0*sizeof S::m));
32 namespace PR11956 {
33 struct X { char a; };
34 struct Y { int f() { return sizeof(X::a); } }; // ok
36 struct A { enum E {} E; };
37 struct B { int f() { return sizeof(A::E); } }; // ok