mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
Submitted by: Bill Wendling
Reviewed by: Chris Lattner - If the LHS and/or RHS is a reference, then see if they're compatible. If so, the type is that of the LHS. llvm-svn: 39568
This commit is contained in:
@@ -699,6 +699,11 @@ QualType Sema::UsualAssignmentConversions(QualType lhsType, QualType rhsType,
|
||||
} else if (isa<TagType>(lhsType) && isa<TagType>(rhsType)) {
|
||||
if (Type::tagTypesAreCompatible(lhsType, rhsType))
|
||||
return rhsType;
|
||||
} else if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
|
||||
if (Type::referenceTypesAreCompatible(lhsType, rhsType))
|
||||
// C++ 5.17p1: ...the type of the assignment exression is that of its left
|
||||
// operand.
|
||||
return lhsType;
|
||||
}
|
||||
r = Incompatible;
|
||||
return QualType();
|
||||
|
||||
Reference in New Issue
Block a user