[clang] [Clang] Fix isWeakImported() to traverse redeclaration chain for avai… (PR #181482)

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 12:52:48 PDT 2026


================
@@ -0,0 +1,8 @@
+// Mimics a class like UTType that has availability attrs for multiple platforms.
+// The 'macos' attr comes before 'ios', so getAttr<AvailabilityAttr>() returns
+// 'macos' first. When mergeInheritableAttributes copies only the first attr
+// across PCM boundaries, the 'ios' attr is lost on the @class redeclaration.
----------------
vsapsai wrote:

I don't think DeclBase.cpp‎ requires any changes as it works correctly. And for ASTReaderDecl.cpp change I'd like to investigate more the adjacent issues. For example, I'm not sure `!D->hasAttr<AvailabilityAttr>()` check is correct.

https://github.com/llvm/llvm-project/pull/181482


More information about the cfe-commits mailing list