Support implicit casts from pointers to references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index b496f26..aa1dc7e 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -320,7 +320,13 @@
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());