diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-18 21:45:41 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-18 21:45:41 +0000 |
commit | 0f59cb38e7f319ee46b66812b212a5afaa3572bb (patch) | |
tree | ef6fe1ec0a7931fb0fe8a5ab0c1aff79ef4d595f /clang/lib/Sema/SemaExpr.cpp | |
parent | 3f422280f5c3a432f9525df02db710d5d81df239 (diff) | |
download | bcm5719-llvm-0f59cb38e7f319ee46b66812b212a5afaa3572bb.tar.gz bcm5719-llvm-0f59cb38e7f319ee46b66812b212a5afaa3572bb.zip |
Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call
for the derived class into it. This is mostly just a cleanup, but could in
principle be a bugfix if there is some codepath that reaches here and didn't
previously require a complete type (I couldn't find any such codepath, though).
llvm-svn: 256037
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index b8cb50c9aee..d31a816b80d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2595,7 +2595,7 @@ Sema::PerformObjectMemberConversion(Expr *From, // In C++98, the qualifier type doesn't actually have to be a base // type of the object type, in which case we just ignore it. // Otherwise build the appropriate casts. - if (IsDerivedFrom(FromRecordType, QRecordType)) { + if (IsDerivedFrom(FromLoc, FromRecordType, QRecordType)) { CXXCastPath BasePath; if (CheckDerivedToBaseConversion(FromRecordType, QRecordType, FromLoc, FromRange, &BasePath)) @@ -2631,7 +2631,7 @@ Sema::PerformObjectMemberConversion(Expr *From, // We only need to do this if the naming-class to declaring-class // conversion is non-trivial. if (!Context.hasSameUnqualifiedType(FromRecordType, URecordType)) { - assert(IsDerivedFrom(FromRecordType, URecordType)); + assert(IsDerivedFrom(FromLoc, FromRecordType, URecordType)); CXXCastPath BasePath; if (CheckDerivedToBaseConversion(FromRecordType, URecordType, FromLoc, FromRange, &BasePath)) @@ -11313,7 +11313,8 @@ ExprResult Sema::BuildBuiltinOffsetOf(SourceLocation BuiltinLoc, // If the member was found in a base class, introduce OffsetOfNodes for // the base class indirections. CXXBasePaths Paths; - if (IsDerivedFrom(CurrentType, Context.getTypeDeclType(Parent), Paths)) { + if (IsDerivedFrom(OC.LocStart, CurrentType, Context.getTypeDeclType(Parent), + Paths)) { if (Paths.getDetectedVirtual()) { Diag(OC.LocEnd, diag::err_offsetof_field_of_virtual_base) << MemberDecl->getDeclName() |