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.cpp
blobbfe08a67a416772eaf49f1d9be3b0350dc42c363
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 template<class X, class Y, class Z> X f(Y,Z); // expected-note {{candidate template ignored: couldn't infer template argument 'X'}}
7 void g() {
8 f<int,char*,double>("aa",3.0);
9 #if __cplusplus <= 199711L // C++03 or earlier modes
10 // expected-warning@-2{{conversion from string literal to 'char *' is deprecated}}
11 #else
12 // expected-warning@-4{{ISO C++11 does not allow conversion from string literal to 'char *'}}
13 #endif
15 f<int,char*>("aa",3.0); // Z is deduced to be double
16 #if __cplusplus <= 199711L
17 // expected-warning@-2{{conversion from string literal to 'char *' is deprecated}}
18 #else
19 // expected-warning@-4{{ISO C++11 does not allow conversion from string literal to 'char *'}}
20 #endif
22 f<int>("aa",3.0); // Y is deduced to be char*, and
23 // Z is deduced to be double
24 f("aa",3.0); // expected-error{{no matching}}
27 // PR5910
28 namespace PR5910 {
29 template <typename T>
30 void Func() {}
32 template <typename R>
33 void Foo(R (*fp)());
35 void Test() {
36 Foo(Func<int>);
40 // PR5949
41 namespace PR5949 {
42 struct Bar;
44 template <class Container>
45 void quuz(const Container &cont) {
48 template<typename T>
49 int Foo(Bar *b, void (*Baz)(const T &t), T * = 0) {
50 return 0;
53 template<typename T>
54 int Quux(Bar *b, T * = 0)
56 return Foo<T>(b, quuz);
60 // PR7641
61 namespace PR7641 {
62 namespace N2
64 template<class>
65 int f0(int);
67 namespace N
69 using N2::f0;
72 template<class R,class B1>
73 int
74 f1(R(a)(B1));
76 void f2()
77 { f1(N::f0<int>); }