blob: 72cfe76fbe43a2a951722465b16594f7d2de5efd [file] [log] [blame]
David Majnemere9807b22016-02-26 04:23:19 +00001// RUN: %clang_cc1 %s -std=c++11 -fms-compatibility -fsyntax-only -verify
2
3struct S {
4 enum { E = 1 };
5 static const int sdm = 1;
6};
7
8void f(S *s) {
9 char array[s->E] = { 0 };
10}
11
12extern S *s;
13constexpr int e1 = s->E;
14
15S *side_effect(); // expected-note{{declared here}}
16constexpr int e2 = // expected-error{{must be initialized by a constant expression}}
17 side_effect()->E; // expected-note{{cannot be used in a constant expression}}
18
19constexpr int e4 = s->sdm;