Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / cxx1z-init-statement-template.cpp
blob09dc1d7d428b04b91642ad0843ad1f75fa59a99d
1 // RUN: %clang_cc1 -std=c++1z -verify -emit-llvm-only %s
2 // expected-no-diagnostics
4 template <unsigned int BUFFER_SIZE> class Buffer {};
6 class A {
7 public:
8 int status;
9 };
11 template <unsigned int N> A parse(Buffer<N> buffer);
13 template<unsigned int N>
14 void init_in_if(Buffer<N> buffer) {
15 if (A a = parse(buffer); a.status > 0) {
19 template<unsigned int N>
20 void init_in_switch(Buffer<N> buffer) {
21 switch (A a = parse(buffer); a.status) {
22 default:
23 break;
27 void test() {
28 Buffer<10> buffer;
29 init_in_if(buffer);
30 init_in_switch(buffer);