[clang] [clang][sema]`no address_space attribute found at the expected location!` assertion fail (PR #216348)

Akash Manna via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 10:41:38 PDT 2026


akash-manna-sky wrote:

> Your PR removed the assertion. Please provide a clear and widely accepted reason.
> 
> BTW, was LLM involved in this PR?

You're right, removing the assertion wasn't the way to go — I've updated the PR to keep it.

The assertion assumed the address_space attribute is always stored on the declarator chunk being visited. That's what #196982 disproves: an attribute written after the declarator-id stays on the Declarator itself and wraps the outermost type, so the chunk-only search came up empty and the unreachable fired. The fix now searches all the attribute lists a declarator carries (chunk, declarator, decl-spec, declaration), skipping invalid/malformed ones since those never produce a type. With that, the attribute is always findable and the original llvm_unreachable stays as-is.

And yes, I did use an AI assistant while working on this. I've reviewed, built, and tested the change myself before push on github. Please have a look @TPPPP72 

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


More information about the cfe-commits mailing list