Support implicit casts from pointers to references.

llvm-svn: 50498
This commit is contained in:
Ted Kremenek 2008-04-30 21:10:19 +00:00
parent 84dea154fc
commit e0e8b535cf
1 changed files with 7 additions and 1 deletions

View File

@ -320,7 +320,13 @@ RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLVal X, QualType T) {
RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, LVal X, QualType T) {
if (IsPointerType(T))
// Casts from pointers -> pointers, just return the lval.
//
// Casts from pointers -> references, just return the lval. These
// can be introduced by the frontend for corner cases, e.g
// casting from va_list* to __builtin_va_list&.
//
if (IsPointerType(T) || T->isReferenceType())
return X;
assert (T->isIntegerType());