}
}
case CK_ArrayToPointerDecay:
+ // FIXME: Support array-to-pointer decay on array rvalues.
+ if (!SubExpr->isGLValue())
+ return Error(E);
+ return EvaluateLValue(SubExpr, Result, Info);
+
case CK_FunctionToPointerDecay:
- if (SubExpr->isGLValue() || SubExpr->getType()->isFunctionType())
- return EvaluateLValue(SubExpr, Result, Info);
- return Error(E);
+ return EvaluateLValue(SubExpr, Result, Info);
}
return ExprEvaluatorBaseTy::VisitCastExpr(E);
int n = 2;
int intLvalue[*(int*)((long)&n ?: 1)] = { 1, 2 }; // expected-error {{variable length array}}
+
+union u { int a; char b[4]; };
+char c = ((union u)(123456)).b[0]; // expected-error {{not a compile-time constant}}