[all-commits] [llvm/llvm-project] f4e14b: [Sema] Warn about omitting deprecated enumerator i...

Hans Wennborg via All-commits all-commits at lists.llvm.org
Fri May 23 00:41:10 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4e14bf213972053d6ee4ca0269e42ba2dd2ceba
      https://github.com/llvm/llvm-project/commit/f4e14bf213972053d6ee4ca0269e42ba2dd2ceba
  Author: Hans Wennborg <hans at hanshq.net>
  Date:   2025-05-23 (Fri, 23 May 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Parse/ParseExpr.cpp
    M clang/lib/Sema/SemaAvailability.cpp
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/Sema/switch-availability.c

  Log Message:
  -----------
  [Sema] Warn about omitting deprecated enumerator in switch (#138562)

This undoes part of 3e4e3b17c14c15c23c0ed18ca9165b42b1b13ae3 which added
the "Omitting a deprecated constant is ok; it should never materialize."
logic.

That seems wrong: deprecated means the enumerator is likely to be
removed in future versions, not that it cannot materialize.

Also move warnings about the use of deprecated enumerators in switch cases
behind a separate flag, -Wdeprecated-switch-case, for users who wish to
handle such enums explicitly and suppress the warning.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list