aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-26 17:47:49 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-26 17:47:49 +0000
commit57c9f4f278fe15dc4964f2999486ffdbabce635c (patch)
treefca47f129e7fe2d0c666d26c46a9bab47984eaf9 /lib/Sema/SemaOverload.cpp
parent0a9a6d68979619a621fedc5089674487f720f765 (diff)
Rvalue references for *this: allow functions to be overloaded based on
the presence and form of a ref-qualifier. Note that we do *not* yet implement the restriction in C++0x [over.load]p2 that requires either all non-static functions with a given parameter-type-list to have a ref-qualifier or none of them to have a ref-qualifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 602a118c3b..6c25893758 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -681,7 +681,7 @@ bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old,
return true;
// If the function is a class member, its signature includes the
- // cv-qualifiers (if any) on the function itself.
+ // cv-qualifiers (if any) and ref-qualifier (if any) on the function itself.
//
// As part of this, also check whether one of the member functions
// is static, in which case they are not overloads (C++
@@ -692,7 +692,8 @@ bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old,
CXXMethodDecl* NewMethod = dyn_cast<CXXMethodDecl>(New);
if (OldMethod && NewMethod &&
!OldMethod->isStatic() && !NewMethod->isStatic() &&
- OldMethod->getTypeQualifiers() != NewMethod->getTypeQualifiers())
+ (OldMethod->getTypeQualifiers() != NewMethod->getTypeQualifiers() ||
+ OldMethod->getRefQualifier() != NewMethod->getRefQualifier()))
return true;
// The signatures match; this is not an overload.