summaryrefslogtreecommitdiff
path: root/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp')
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp b/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp
new file mode 100644
index 0000000..b2a6219
--- /dev/null
+++ b/clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template<class T> struct A { A(); };
+template<class T> int &f(T);
+template<class T> float &f(T*);
+template<class T> double &f(const T*);
+
+template<class T> void g(T); // expected-note{{candidate}}
+template<class T> void g(T&); // expected-note{{candidate}}
+
+template<class T> int &h(const T&);
+template<class T> float &h(A<T>&);
+
+void m() {
+ const int *p;
+ double &dr1 = f(p);
+ float x;
+ g(x); // expected-error{{ambiguous}}
+ A<int> z;
+ float &fr1 = h(z);
+ const A<int> z2;
+ int &ir1 = h(z2);
+}