[all-commits] [llvm/llvm-project] a37105: [Clang] Diagnose ill-formed constant expression wh...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Wed Jul 27 15:03:28 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a3710589f285de0bb22ff92b1fc24df9411e986f
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2022-07-27 (Wed, 27 Jul 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/Basic/DiagnosticASTKinds.td
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/test/Sema/aarch64-sve-intrinsics/acle_sve_imm.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaTemplate/temp_arg_enum_printing.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values

DR2338 clarified that it was undefined behavior to set the value outside the
range of the enumerations values for an enum without a fixed underlying type.

We should diagnose this with a constant expression context.

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

More information about the All-commits mailing list