p3.cpp revision 011323d90dd2c1ff2db6e1871154831885f2d7cb
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); 7 f<int,char*>("aa",3.0); // Z is deduced to be double 8 f<int>("aa",3.0); // Y is deduced to be char*, and 9 // Z is deduced to be double 10 f("aa",3.0); // expected-error{{no matching}} 11} 12 13// PR5910 14namespace PR5910 { 15 template <typename T> 16 void Func() {} 17 18 template <typename R> 19 void Foo(R (*fp)()); 20 21 void Test() { 22 Foo(Func<int>); 23 } 24} 25 26// PR5949 27namespace PR5949 { 28 struct Bar; 29 30 template <class Container> 31 void quuz(const Container &cont) { 32 } 33 34 template<typename T> 35 int Foo(Bar *b, void (*Baz)(const T &t), T * = 0) { 36 return 0; 37 } 38 39 template<typename T> 40 int Quux(Bar *b, T * = 0) 41 { 42 return Foo<T>(b, quuz); 43 } 44} 45