From 9842e28a419f27a7956afc6353c4414898ac25cd Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 30 Nov 2018 21:15:41 +0000 Subject: [PATCH] [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 --- lib/AST/ExprConstant.cpp | 1 - 1 file changed, 1 deletion(-) 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); } -- 2.40.0