[all-commits] [llvm/llvm-project] 3632e2: Diagnose incorrect use of scoped enumerations in f...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Jun 16 12:03:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3632e2f5179a420ea8ab84e6ca33747ff6130fa2
      https://github.com/llvm/llvm-project/commit/3632e2f5179a420ea8ab84e6ca33747ff6130fa2
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/FormatString.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/SemaCXX/format-strings.cpp

  Log Message:
  -----------
  Diagnose incorrect use of scoped enumerations in format strings

Scoped enumerations in C++ do not undergo conversion to their
underlying type as part of default argument promotion, and so these
uses are UB. GCC correctly diagnoses them, and now Clang matches.

Fixes https://github.com/llvm/llvm-project/issues/38717




More information about the All-commits mailing list