diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-14 07:06:31 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-14 07:06:31 +0000 |
commit | 4a030228d1bfa0cab89114a18d6b50b44eb3a1a8 (patch) | |
tree | e3acf3f0441d8843f9f80c79c219e7ca3d2f9186 /test/SemaTemplate | |
parent | 38c5d0a8f33f11661501760c67398e66e327e501 (diff) |
When we have a MemberExpr referring to an overloaded static member function,
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
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/instantiate-overload-candidates.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-overload-candidates.cpp b/test/SemaTemplate/instantiate-overload-candidates.cpp index 5b7e60dccf..5c892aab37 100644 --- a/test/SemaTemplate/instantiate-overload-candidates.cpp +++ b/test/SemaTemplate/instantiate-overload-candidates.cpp @@ -19,3 +19,11 @@ template <typename T> S_<NoDefinition>::type f(T*, NoDefinition*); // expected-n 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}} |