Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / PR62533.cpp
blob920ea54d4b00ed3546467327e97986dd11f3e849
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template<typename T>
4 struct test {
5 template<typename> using fun_diff = char; // expected-note 2{{class template declared here}}
6 };
8 template<typename T, typename V>
9 decltype(T::template fun_diff<V>) foo1() {}
10 // expected-note@-1 {{candidate template ignored: substitution failure [with T = test<int>, V = int]: 'test<int>::fun_diff' is expected to be a non-type template, but instantiated to a type alias template}}
12 template<typename T>
13 void foo2() {
14 // expected-error@+1 {{test<int>::fun_diff' is expected to be a non-type template, but instantiated to a type alias template}}
15 int a = test<T>::template fun_diff<int>;
18 template<typename T, typename V>
19 struct has_fun_diff {
20 using type = double;
23 template<typename T>
24 struct has_fun_diff<T, int> {
25 // expected-error@+1 {{'test<int>::fun_diff' is expected to be a non-type template, but instantiated to a type alias template}}
26 using type = decltype(T::template fun_diff<int>);
29 void bar() {
30 foo1<test<int>, int>(); // expected-error {{no matching function for call to 'foo1'}}
31 foo2<int>(); // expected-note {{in instantiation of function template specialization}}
32 has_fun_diff<test<int>, int>::type a; // expected-note {{in instantiation of template class}}