Template instantiation for __builtin_va_arg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72144 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d268658..d72d56f 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5253,11 +5253,13 @@
} else {
// Otherwise, the va_list argument must be an l-value because
// it is modified by va_arg.
- if (CheckForModifiableLvalue(E, BuiltinLoc, *this))
+ if (!E->isTypeDependent() &&
+ CheckForModifiableLvalue(E, BuiltinLoc, *this))
return ExprError();
}
- if (!Context.hasSameType(VaListType, E->getType())) {
+ if (!E->isTypeDependent() &&
+ !Context.hasSameType(VaListType, E->getType())) {
return ExprError(Diag(E->getLocStart(),
diag::err_first_argument_to_va_arg_not_of_type_va_list)
<< OrigExpr->getType() << E->getSourceRange());