]> granicus.if.org Git - clang/commitdiff
[ExprConstant] Try fixing __builtin_constant_p after D54355 (rC347417)
authorFangrui Song <maskray@google.com>
Fri, 30 Nov 2018 21:15:41 +0000 (21:15 +0000)
committerFangrui Song <maskray@google.com>
Fri, 30 Nov 2018 21:15:41 +0000 (21:15 +0000)
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

index 5eb2f2e7b84b7c546db1f62b6d8f7ffb295a0ee4..91b3fbfa4663c42388064bdc2a6070145d9418a6 100644 (file)
@@ -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);
   }