[all-commits] [llvm/llvm-project] 3ac1aa: [Clang] Consider preferred_type in bitfield warnin...

Oliver Hunt via All-commits all-commits at lists.llvm.org
Sun Apr 20 14:17:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ac1aa4c88d4fe40166209cad616f4ae867c20a2
      https://github.com/llvm/llvm-project/commit/3ac1aa4c88d4fe40166209cad616f4ae867c20a2
  Author: Oliver Hunt <oliver at apple.com>
  Date:   2025-04-20 (Sun, 20 Apr 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/SemaCXX/bitfield-preferred-type-sizing.cpp

  Log Message:
  -----------
  [Clang] Consider preferred_type in bitfield warnings (#116760) (#116785)

Very simply extends the bitfield sema checks for assignment to fields
with a preferred type specified to consider the preferred type if the
decl storage type is not explicitly an enum type.

This does mean that if the preferred and explicit types have different
storage requirements we may not warn in all possible cases, but that's a
scenario for which the warnings are much more complex and confusing.



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