[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / ms-const-member-expr.cpp
blob72cfe76fbe43a2a951722465b16594f7d2de5efd
1 // RUN: %clang_cc1 %s -std=c++11 -fms-compatibility -fsyntax-only -verify
3 struct S {
4 enum { E = 1 };
5 static const int sdm = 1;
6 };
8 void f(S *s) {
9 char array[s->E] = { 0 };
12 extern S *s;
13 constexpr int e1 = s->E;
15 S *side_effect(); // expected-note{{declared here}}
16 constexpr int e2 = // expected-error{{must be initialized by a constant expression}}
17 side_effect()->E; // expected-note{{cannot be used in a constant expression}}
19 constexpr int e4 = s->sdm;