and we resolve it to a specific function based on the type which it's used as,
don't forget to mark it as referenced.
Fixes a regression introduced in r167514.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167918
91177308-0d34-0410-b5e6-
96231b3b80d8
TemplateArgs,
type, valueKind, OK_Ordinary);
ME->setHadMultipleCandidates(true);
+ MarkMemberReferenced(ME);
return ME;
}
void test(int x) {
f(&x, 0);
}
+
+// Ensure that we instantiate an overloaded function if it's selected by
+// overload resolution when initializing a function pointer.
+template<typename T> struct X {
+ static T f() { T::error; } // expected-error {{has no members}}
+ static T f(bool);
+};
+void (*p)() = &X<void>().f; // expected-note {{instantiation of}}