From 81a1a8e181f98c07d34559beae6cca2d04873611 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)}; llvm-svn: 348037 --- clang/lib/AST/ExprConstant.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 5eb2f2e..91b3fbf 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/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.7.4