diff options
Diffstat (limited to 'test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp')
| -rw-r--r-- | test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp b/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp new file mode 100644 index 000000000000..fe42ba41d81e --- /dev/null +++ b/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p4.cpp @@ -0,0 +1,23 @@ +// RUN: clang-cc -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); +} |
