From: Fangrui Song Date: Fri, 30 Nov 2018 21:15:41 +0000 (+0000) Subject: [ExprConstant] Try fixing __builtin_constant_p after D54355 (rC347417) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9842e28a419f27a7956afc6353c4414898ac25cd;p=clang [ExprConstant] Try fixing __builtin_constant_p after D54355 (rC347417) Summary: Reinstate the original behavior (Success(false, E)) before D54355 when this branch is taken. This fixes spurious error of the following snippet: extern char extern_var; struct { int a; } a = {__builtin_constant_p(extern_var)}; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348037 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 5eb2f2e7b8..91b3fbfa46 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -8199,7 +8199,6 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, // We can delay calculation of __builtin_constant_p until after // inlining. Note: This diagnostic won't be shown to the user. Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr); - return false; } return Success(false, E); }