Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.fct.spec / temp.arg.explicit / p3-nodeduct.cpp
blobde3b44f1b5130a51ddb68d61e9bac7b8a3e7460f
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // PR5811
4 template <class F> void Call(F f) { f(1); }
5 template <typename T> void f(T);
6 void a() { Call(f<int>); }
8 // Check the conversion of a template-id to a pointer
9 template<typename T, T* Address> struct Constant { };
10 Constant<void(int), &f<int> > constant0;
12 template<typename T, T* Address> void constant_func();
13 void test_constant_func() {
14 constant_func<void(int), &f<int> >();
18 // Check typeof() on a template-id referring to a single function
19 template<typename T, typename U>
20 struct is_same {
21 static const bool value = false;
24 template<typename T>
25 struct is_same<T, T> {
26 static const bool value = true;
29 int typeof0[is_same<__typeof__(f<int>), void (int)>::value? 1 : -1];
30 int typeof1[is_same<__typeof__(&f<int>), void (*)(int)>::value? 1 : -1];
32 template <typename T> void g(T); // expected-note{{possible target for call}}
33 template <typename T> void g(T, T); // expected-note{{possible target for call}}
35 int typeof2[is_same<__typeof__(g<float>), void (int)>::value? 1 : -1]; // \
36 // expected-error{{reference to overloaded function could not be resolved; did you mean to call it?}}