p3.cpp revision a9bff30776888977f580c9cac212fd1583ee963e
1// RUN: %clang_cc1 -fsyntax-only -verify %s 2 3template<class X, class Y, class Z> X f(Y,Z); // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} 4 5void g() { 6 f<int,char*,double>("aa",3.0); // expected-warning{{conversion from string literal to 'char *' is deprecated}} 7 f<int,char*>("aa",3.0); // Z is deduced to be double \ 8 // expected-warning{{conversion from string literal to 'char *' is deprecated}} 9 f<int>("aa",3.0); // Y is deduced to be char*, and 10 // Z is deduced to be double 11 f("aa",3.0); // expected-error{{no matching}} 12} 13 14// PR5910 15namespace PR5910 { 16 template <typename T> 17 void Func() {} 18 19 template <typename R> 20 void Foo(R (*fp)()); 21 22 void Test() { 23 Foo(Func<int>); 24 } 25} 26 27// PR5949 28namespace PR5949 { 29 struct Bar; 30 31 template <class Container> 32 void quuz(const Container &cont) { 33 } 34 35 template<typename T> 36 int Foo(Bar *b, void (*Baz)(const T &t), T * = 0) { 37 return 0; 38 } 39 40 template<typename T> 41 int Quux(Bar *b, T * = 0) 42 { 43 return Foo<T>(b, quuz); 44 } 45} 46