Adapted from patch by Tim Northover.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69566
91177308-0d34-0410-b5e6-
96231b3b80d8
if (E->isArgumentType()) {
// sizeof(type) - make sure to emit the VLA size.
CGF.EmitVLASize(TypeToSize);
+ } else {
+ // C99 6.5.3.4p2: If the argument is an expression of type
+ // VLA, it is evaluated.
+ CGF.EmitAnyExpr(E->getArgumentExpr());
}
return CGF.GetVLASize(VAT);
--- /dev/null
+// RUN: clang-cc -emit-llvm < %s | grep puts
+
+int a(int x)
+{
+ int (*y)[x];
+ return sizeof(*(puts("asdf"),y));
+}