aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-28 02:26:04 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-28 02:26:04 +0000
commitb608b987718c6d841115464f79ab2d1820a63e17 (patch)
tree2c72e1dddc574cb24d3d9a3e9dde350ea5637be7 /lib/Sema/SemaExpr.cpp
parent70a21de5b4c6ca4883ed58093e71e7884d5218fb (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3112ccb55f..098f5396bb 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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,