]> granicus.if.org Git - clang/commit
isEvaluatable() implies a constant context.
authorBill Wendling <isanbard@gmail.com>
Sat, 24 Nov 2018 10:45:55 +0000 (10:45 +0000)
committerBill Wendling <isanbard@gmail.com>
Sat, 24 Nov 2018 10:45:55 +0000 (10:45 +0000)
commit5214b6a606a197556bea852902960314232c8364
treef655c24bec2071d049103f3ee0bd96f1ad905231
parent3327c0a90f08c737986976551fa0a7617e966e6d
isEvaluatable() implies a constant context.

Assume that we're in a constant context if we're asking if the expression can
be compiled into a constant initializer. This fixes the issue where a
__builtin_constant_p() in a compound literal was diagnosed as not being
constant, even though it's always possible to convert the builtin into a
constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347512 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Expr.h
lib/AST/ExprConstant.cpp
lib/Sema/SemaExpr.cpp
test/CodeGen/builtin-constant-p.c
test/SemaCXX/compound-literal.cpp