[all-commits] [llvm/llvm-project] 5282d0: [Clang] Skip invalid fields when synthesizing defa...

Akash Manna via All-commits all-commits at lists.llvm.org
Wed Sep 9 06:43:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5282d0c073beba1c2569222ede55ff943d46fcef
      https://github.com/llvm/llvm-project/commit/5282d0c073beba1c2569222ede55ff943d46fcef
  Author: Akash Manna <akash.manna.mymail at gmail.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/test/SemaCXX/cxx20-default-compare.cpp

  Log Message:
  -----------
  [Clang] Skip invalid fields when synthesizing defaulted comparisons (#221570)

Fixes #194605

`CheckFieldDecl` already rejects `int [[clang::address_space(1)]] i;`
and marks the field invalid, but `DefaultedComparisonVisitor` still
visited it when synthesizing the defaulted `operator==`.
`BuildFieldReferenceExpr` then tripped the
`!MemberQuals.hasAddressSpace()` assertion. Both
`__is_trivially_equality_comparable(S)` and a plain `a == b` reach that
path.

`visitSubobjects` now skips invalid fields, the same way
`SpecialMemberVisitor` and the copy-assignment synthesis already do.
That covers the analyzer and the synthesizer together, and the assertion
stays in place since it still holds for valid code.



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