Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / PCH / cxx2a-bitfield-init.cpp
blobab7c3cea8b481a3f22a5b236a42498d90603fca9
1 // RUN: %clang_cc1 -std=c++2a -include %s -verify %s
2 // RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
3 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s -DPCH
4 // RUN: %clang_cc1 -std=c++2a -emit-pch -fpch-instantiate-templates %s -o %t
5 // RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s -DPCH
7 #ifndef HEADER
8 #define HEADER
10 struct S {
11 unsigned int n : 5 = 49; // expected-warning {{changes value}}
14 int a;
15 template<bool B> struct T {
16 int m : B ? 8 : a = 42;
19 #else
21 // expected-error@-5 {{constant expression}} expected-note@-5 {{cannot modify}}
23 static_assert(S().n == 17);
24 static_assert(T<true>().m == 0);
25 int q = T<false>().m; // expected-note {{instantiation of}}
27 #endif