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 | 4f6a2c4acb5142fda7c5c10f99618cd9de3aff18 (patch) | |
tree | ea546a94e783f3155481d0dfcccc38f4513837ed /clang/test/SemaTemplate/instantiate-overload-candidates.cpp | |
parent | ae1d30047c3bdccb0302d0a9efdb811e17e19228 (diff) | |
download | bcm5719-llvm-4f6a2c4acb5142fda7c5c10f99618cd9de3aff18.tar.gz bcm5719-llvm-4f6a2c4acb5142fda7c5c10f99618cd9de3aff18.zip |
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.
llvm-svn: 167918
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-overload-candidates.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-overload-candidates.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-overload-candidates.cpp b/clang/test/SemaTemplate/instantiate-overload-candidates.cpp index 5b7e60dccfd..5c892aab376 100644 --- a/clang/test/SemaTemplate/instantiate-overload-candidates.cpp +++ b/clang/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}} |