llvm-project
c6eb268d - [Clang] Fix mergeInheritableAttributes() to propagate all AvailabilityAttrs (#181482)

Commit
76 days ago
[Clang] Fix mergeInheritableAttributes() to propagate all AvailabilityAttrs (#181482) `getAttr<AvailabilityAttr>()` only returns the first matching attribute, but a declaration can carry multiple AvailabilityAttrs (one per platform, e.g. macOS + iOS). Use `specific_attrs<AvailabilityAttr>()` to iterate over all of them so every platform's availability is propagated during cross-module redeclaration merging. This aligns the PCM merge path with how `mergeDeclAttributes` already iterates via `specific_attrs<InheritableAttr>()` on the Sema side. Extend clang/test/Modules/decl-attr-merge.mm with a multi-platform case and an iOS triple RUN line that triggers the bug without the fix. Fixes https://github.com/llvm/llvm-project/issues/181298
Author
Parents
Loading