diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-01-28 02:26:04 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-01-28 02:26:04 +0000 |
| commit | c03a1083afd6b96f46fea4f07e21d3c5d15ddf57 (patch) | |
| tree | 0d40ab6c4cd7732d836b0abdab8d7a01c66ec163 /clang/lib/Sema/SemaExpr.cpp | |
| parent | dd2fe7adb548e8d38e4a685287099ab79ca004be (diff) | |
| download | bcm5719-llvm-c03a1083afd6b96f46fea4f07e21d3c5d15ddf57.tar.gz bcm5719-llvm-c03a1083afd6b96f46fea4f07e21d3c5d15ddf57.zip | |
Give OpaqueValueExpr a source location, because its source location
might be queried in places where we absolutely require a valid
location (e.g., for template instantiation). Fixes some major
brokenness in the use of __is_convertible_to.
llvm-svn: 124465
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 3112ccb55f3..098f5396bb0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -5507,12 +5507,13 @@ Sema::CheckObjCPointerTypesForAssignment(QualType lhsType, QualType rhsType) { } Sema::AssignConvertType -Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) { +Sema::CheckAssignmentConstraints(SourceLocation Loc, + QualType lhsType, QualType rhsType) { // Fake up an opaque expression. We don't actually care about what // cast operations are required, so if CheckAssignmentConstraints // adds casts to this they'll be wasted, but fortunately that doesn't // usually happen on valid code. - OpaqueValueExpr rhs(rhsType, VK_RValue); + OpaqueValueExpr rhs(Loc, rhsType, VK_RValue); Expr *rhsPtr = &rhs; CastKind K = CK_Invalid; @@ -6952,7 +6953,7 @@ QualType Sema::CheckAssignmentOperands(Expr *LHS, Expr *&RHS, } } else { // Compound assignment "x += y" - ConvTy = CheckAssignmentConstraints(LHSType, RHSType); + ConvTy = CheckAssignmentConstraints(Loc, LHSType, RHSType); } if (DiagnoseAssignmentResult(ConvTy, Loc, LHSType, RHSType, |

