aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-03-22 23:49:27 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-03-22 23:49:27 +0000
commitf2e21e5ad5e816d88e048c89dc775a9d4547c089 (patch)
treee36f53c864c4d99201d2fc8f215284bcc750b3ac /lib/Sema/SemaOverload.cpp
parent04831aa3271edc5f00a651bf7152c2902981d7c3 (diff)
Disallow catching exceptions by rvalue reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 5321935cfc..9f88a87474 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1584,15 +1584,26 @@ Sema::CompareStandardConversionSequences(const StandardConversionSequence& SCS1,
= CompareQualificationConversions(SCS1, SCS2))
return QualCK;
- // C++ [over.ics.rank]p3b4:
- // -- S1 and S2 are reference bindings (8.5.3), and the types to
- // which the references refer are the same type except for
- // top-level cv-qualifiers, and the type to which the reference
- // initialized by S2 refers is more cv-qualified than the type
- // to which the reference initialized by S1 refers.
if (SCS1.ReferenceBinding && SCS2.ReferenceBinding) {
QualType T1 = QualType::getFromOpaquePtr(SCS1.ToTypePtr);
QualType T2 = QualType::getFromOpaquePtr(SCS2.ToTypePtr);
+ // C++0x [over.ics.rank]p3b4:
+ // -- S1 and S2 are reference bindings (8.5.3) and neither refers to an
+ // implicit object parameter of a non-static member function declared
+ // without a ref-qualifier, and S1 binds an rvalue reference to an
+ // rvalue and S2 binds an lvalue reference.
+ // FIXME: We have far too little information for this check. We don't know
+ // if the bound object is an rvalue. We don't know if the binding type is
+ // an rvalue or lvalue reference. We don't know if we're dealing with the
+ // implicit object parameter, or if the member function in this case has
+ // a ref qualifier.
+
+ // C++ [over.ics.rank]p3b4:
+ // -- S1 and S2 are reference bindings (8.5.3), and the types to
+ // which the references refer are the same type except for
+ // top-level cv-qualifiers, and the type to which the reference
+ // initialized by S2 refers is more cv-qualified than the type
+ // to which the reference initialized by S1 refers.
T1 = Context.getCanonicalType(T1);
T2 = Context.getCanonicalType(T2);
if (T1.getUnqualifiedType() == T2.getUnqualifiedType()) {