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:
Bill Wendling 2007-06-02 23:29:59 +00:00
parent 93efb22993
commit db4f06ed2c
1 changed files with 5 additions and 0 deletions

View File

@ -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();