brintos

brintos / llvm-project-archived public Read only

0
0
Text · 583 B · 8312f84 Raw
21 lines · cpp
1// RUN: %clang_cc1 %s -std=c++11 -fms-compatibility -fsyntax-only -verify2// RUN: %clang_cc1 %s -std=c++11 -fms-compatibility -fsyntax-only -verify -fexperimental-new-constant-interpreter3 4struct S {5  enum { E = 1 };6  static const int sdm = 1;7};8 9void f(S *s) {10  char array[s->E] = { 0 };11}12 13extern S *s;14constexpr int e1 = s->E;15 16S *side_effect();  // expected-note{{declared here}}17constexpr int e2 = // expected-error{{must be initialized by a constant expression}}18    side_effect()->E; // expected-note{{cannot be used in a constant expression}}19 20constexpr int e4 = s->sdm;21