forked from OSchip/llvm-project
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:
parent
93efb22993
commit
db4f06ed2c
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue