summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp2
-rw-r--r--clang/test/SemaCXX/addr-of-overloaded-function.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 3e89a6413a2..ce004b8d05d 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -4062,7 +4062,7 @@ Sema::ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType,
// diagnostic below. FIXME: we could perform the quadratic
// algorithm here, pruning the result set to limit the number of
// candidates output later.
- RemainingMatches.append(Matches.begin(), Matches.end());
+ RemainingMatches.append(Matches.begin(), Matches.end());
}
// [...] After such eliminations, if any, there shall remain exactly one
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function.cpp b/clang/test/SemaCXX/addr-of-overloaded-function.cpp
index 9c9f0e19ef3..e49b4776126 100644
--- a/clang/test/SemaCXX/addr-of-overloaded-function.cpp
+++ b/clang/test/SemaCXX/addr-of-overloaded-function.cpp
@@ -23,7 +23,22 @@ int g1(char);
int g2(int);
int g2(double);
+template<typename T> T g3(T);
+int g3(int);
+int g3(char);
+
void g_test() {
g(g1);
g(g2); // expected-error{{call to 'g' is ambiguous; candidates are:}}
+ g(g3);
+}
+
+template<typename T> T h1(T);
+template<typename R, typename A1> R h1(A1);
+int h2(char);
+
+void h(int (*fp)(int));
+
+void h_test() {
+ h(h1);
}
OpenPOWER on IntegriCloud