From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../temp/temp.fct.spec/temp.arg.explicit/p3.cpp | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp (limited to 'clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp') diff --git a/clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp b/clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp new file mode 100644 index 0000000..5556f35 --- /dev/null +++ b/clang/test/CXX/temp/temp.fct.spec/temp.arg.explicit/p3.cpp @@ -0,0 +1,65 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template X f(Y,Z); // expected-note {{candidate template ignored: couldn't infer template argument 'X'}} + +void g() { + f("aa",3.0); // expected-warning{{conversion from string literal to 'char *' is deprecated}} + f("aa",3.0); // Z is deduced to be double \ + // expected-warning{{conversion from string literal to 'char *' is deprecated}} + f("aa",3.0); // Y is deduced to be char*, and + // Z is deduced to be double + f("aa",3.0); // expected-error{{no matching}} +} + +// PR5910 +namespace PR5910 { + template + void Func() {} + + template + void Foo(R (*fp)()); + + void Test() { + Foo(Func); + } +} + +// PR5949 +namespace PR5949 { + struct Bar; + + template + void quuz(const Container &cont) { + } + + template + int Foo(Bar *b, void (*Baz)(const T &t), T * = 0) { + return 0; + } + + template + int Quux(Bar *b, T * = 0) + { + return Foo(b, quuz); + } +} + +// PR7641 +namespace PR7641 { + namespace N2 + { + template + int f0(int); + } + namespace N + { + using N2::f0; + } + + template + int + f1(R(a)(B1)); + + void f2() + { f1(N::f0); } +} -- cgit v1.2.3