diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-26 17:47:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-26 17:47:49 +0000 |
commit | b2f8aa9556bf9ca74e4e796bf3096083f6d9a9b0 (patch) | |
tree | b735843a784e1fc7dbb65ccdace29c7bbcc61b99 /clang/lib/Sema/SemaOverload.cpp | |
parent | f3ea1ed1ad2d72f472ed672dd0118ad1a7cf39f4 (diff) | |
download | bcm5719-llvm-b2f8aa9556bf9ca74e4e796bf3096083f6d9a9b0.tar.gz bcm5719-llvm-b2f8aa9556bf9ca74e4e796bf3096083f6d9a9b0.zip |
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.
llvm-svn: 124297
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 602a118c3b7..6c25893758c 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/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. |