Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / FixIt / fixit-constrained-structured-binding.cpp
blob3f21c1da45a4aaac77abfcb80c4a28717f496f3a
1 // RUN: not %clang_cc1 -std=c++20 -fdiagnostics-parseable-fixits -x c++ %s 2> %t
2 // RUN: FileCheck %s < %t
4 template<typename T>
5 concept UnaryC = true;
6 template<typename T, typename U>
7 concept BinaryC = true;
9 struct S{ int i, j; };
10 S get_S();
12 template<typename T>
13 T get_T();
15 void use() {
16 UnaryC auto [a, b] = get_S();
17 // CHECK: error: decomposition declaration cannot be declared with constrained 'auto'
18 // CHECK: fix-it:{{.*}}:{16:3-16:10}:""
19 BinaryC<int> auto [c, d] = get_S();
20 // CHECK: error: decomposition declaration cannot be declared with constrained 'auto'
21 // CHECK: fix-it:{{.*}}:{19:3-19:16}:""
24 template<typename T>
25 void TemplUse() {
26 UnaryC auto [a, b] = get_T<T>();
27 // CHECK: error: decomposition declaration cannot be declared with constrained 'auto'
28 // XCHECK: fix-it:{{.*}}:{26:3-26:10}:""
29 BinaryC<T> auto [c, d] = get_T<T>();
30 // CHECK: error: decomposition declaration cannot be declared with constrained 'auto'
31 // XCHECK: fix-it:{{.*}}:{29:3-29:14}:""