[clang] Don't short-circuit constant evaluation for array or record types
authorCharles Magahern <cmagahern@apple.com>
Mon, 9 Jan 2023 22:28:29 +0000 (14:28 -0800)
committerCharles Magahern <cmagahern@apple.com>
Fri, 20 Jan 2023 02:04:00 +0000 (18:04 -0800)
commit3ac4299d3798eb7078905d5fc8f23781556c90a1
treef9e69104d692f74f2d4b083999f27cc7ba939d8b
parent333ffafb4500cad19aec81e841686ade1f31f67f
[clang] Don't short-circuit constant evaluation for array or record types

FastEvaluateAsRValue returns `true` without setting a result value for when a
given constant expression is an array or record type.

Clang attributes must be able to support constant expressions that are array or
record types, so proceed with the slower path for evaluation in the case where
`FastEvaluateAsRValue` does not yield an evaluation result.

Differential Revision: https://reviews.llvm.org/D141745
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGen/2007-06-15-AnnotateAttribute.c