diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-28 21:47:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-28 21:47:39 +0000 |
commit | f641166066c7053300cada4ca5c9e69ad1cd2358 (patch) | |
tree | d5ae3d4ffe830591c1e18ecbf4970893a238af6f /test/SemaTemplate | |
parent | 2cbdd7d21e3902e568ce2a51a7459ab5a4fc236c (diff) |
PR13098: If we're instantiating an overloaded binary operator and we could
determine which member function would be the callee from within the template
definition, don't pass that function as a "non-member function" to
CreateOverloadedBinOp. Instead, just rely on it to select the member function
for itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r-- | test/SemaTemplate/instantiate-overload-candidates.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-overload-candidates.cpp b/test/SemaTemplate/instantiate-overload-candidates.cpp index 5c892aab37..7542dbd8ab 100644 --- a/test/SemaTemplate/instantiate-overload-candidates.cpp +++ b/test/SemaTemplate/instantiate-overload-candidates.cpp @@ -27,3 +27,25 @@ template<typename T> struct X { static T f(bool); }; void (*p)() = &X<void>().f; // expected-note {{instantiation of}} + +namespace PR13098 { + struct A { + A(int); + void operator++() {} + void operator+(int) {} + void operator+(A) {} + void operator[](int) {} + void operator[](A) {} + }; + struct B : A { + using A::operator++; + using A::operator+; + using A::operator[]; + }; + template<typename T> void f(B b) { + ++b; + b + 0; + b[0]; + } + template void f<void>(B); +} |