[all-commits] [llvm/llvm-project] 2608f5: [Clang] Tighten restrictions on enum out of range ...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Thu Aug 11 13:44:41 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2608f553b8fd02bfd5a81d9e45406cee0c2dfe26
      https://github.com/llvm/llvm-project/commit/2608f553b8fd02bfd5a81d9e45406cee0c2dfe26
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2022-08-11 (Thu, 11 Aug 2022)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp

  Log Message:
  -----------
  [Clang] Tighten restrictions on enum out of range diagnostic

In D131528 using Info.EvalMode == EvalInfo::EM_ConstantExpression is not strict
enough to restrict the diagnostic to only constant expression contexts. It is
sometimes set in cases where we are still determining if we are in a constant
expression context.

Using InConstantContext will tighten the restriction.

Differential Revision: https://reviews.llvm.org/D131704




More information about the All-commits mailing list