[all-commits] [llvm/llvm-project] 6fb23a: [C] Do not diagnose unions with -Wdefault-const-in...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue May 20 10:04:45 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6fb23afb8dfa1c9244aa1f30df947ad201a1c934
      https://github.com/llvm/llvm-project/commit/6fb23afb8dfa1c9244aa1f30df947ad201a1c934
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2025-05-20 (Tue, 20 May 2025)

  Changed paths:
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/Sema/warn-default-const-init.c

  Log Message:
  -----------
  [C] Do not diagnose unions with -Wdefault-const-init (#140725)

A default-initialized union with a const member is generally reasonable
in C and isn't necessarily incompatible with C++, so we now silence the
diagnostic in that case. However, we do still diagnose a const-
qualified, default-initialized union as that is incompatible with C++.



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