summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-21 00:27:08 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-21 00:27:08 +0000
commitd412fe598be2a31380280fb9012f8876fb099e52 (patch)
treecac7976d3780b567fa6096d7849b204ca2f40c68 /clang/lib/Sema/SemaInit.cpp
parent028ccbfcbfa4bc71a7e17bcb596a8fc3c06a1ea6 (diff)
downloadbcm5719-llvm-d412fe598be2a31380280fb9012f8876fb099e52.tar.gz
bcm5719-llvm-d412fe598be2a31380280fb9012f8876fb099e52.zip
When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind the result to, rather than stripping the reference. llvm-svn: 123950
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 7360eca1e99..e25795de40b 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -2363,11 +2363,6 @@ static OverloadingResult TryRefInitWithConversionFunction(Sema &S,
// functions.
CXXRecordDecl *T2RecordDecl = cast<CXXRecordDecl>(T2RecordType->getDecl());
- // Determine the type we are converting to. If we are allowed to
- // convert to an rvalue, take the type that the destination type
- // refers to.
- QualType ToType = AllowRValues? cv1T1 : DestType;
-
const UnresolvedSetImpl *Conversions
= T2RecordDecl->getVisibleConversionFunctions();
for (UnresolvedSetImpl::const_iterator I = Conversions->begin(),
@@ -2395,10 +2390,10 @@ static OverloadingResult TryRefInitWithConversionFunction(Sema &S,
if (ConvTemplate)
S.AddTemplateConversionCandidate(ConvTemplate, I.getPair(),
ActingDC, Initializer,
- ToType, CandidateSet);
+ DestType, CandidateSet);
else
S.AddConversionCandidate(Conv, I.getPair(), ActingDC,
- Initializer, ToType, CandidateSet);
+ Initializer, DestType, CandidateSet);
}
}
}
OpenPOWER on IntegriCloud