Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaTemplate / alias-template-nondependent.cpp
blobe8ea16483a09f1df1a58635ae37b03e08cb3e07d
1 // RUN: %clang_cc1 -std=c++20 -verify %s
3 namespace PR46377 {
4 template<typename> using IntPtr = int*;
5 template<typename ...T> auto non_dependent_typedef() {
6 typedef int(*P)(IntPtr<T>...);
7 return P();
9 template<typename ...T> auto non_dependent_alias() {
10 using P = int(*)(IntPtr<T>...);
11 return P();
13 template<typename ...T> auto non_dependent_via_sizeof() {
14 using P = int(*)(int(...pack)[sizeof(sizeof(T))]); // expected-error {{invalid application of 'sizeof'}}
15 return P();
18 using a = int (*)(int*, int*);
19 using a = decltype(non_dependent_typedef<void, void>());
20 using a = decltype(non_dependent_alias<void, void>());
21 using a = decltype(non_dependent_via_sizeof<float, float>());
23 using b = decltype(non_dependent_via_sizeof<float, void>()); // expected-note {{instantiation of}}