Skip to content

Commit

Permalink
[ExprConstant] Try fixing __builtin_constant_p after D54355 (rC347417)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MaskRay committed Nov 30, 2018
1 parent 1cb18ec commit 81a1a8e
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion clang/lib/AST/ExprConstant.cpp
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 81a1a8e

Please sign in to comment.