[clang] [Clang] include attribute scope in diagnostics (PR #144619)
Oleksandr T. via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 27 05:15:40 PDT 2025
================
@@ -1382,6 +1382,15 @@ bool SemaHLSL::handleResourceTypeAttr(QualType T, const ParsedAttr &AL) {
return false;
Attr *A = nullptr;
+
+ AttributeCommonInfo ACI(
----------------
a-tarasyuk wrote:
I'll double-check to be sure, but my understanding is that `AttributeCommonInfo` is copied during attribute creation. Since the attribute itself is allocated via the `ASTContext` allocator, I assumed this temporary `ACI` would be safe to use here.
```cpp
HLSLResourceClassAttr *HLSLResourceClassAttr::Create(ASTContext &Ctx, llvm::hlsl::ResourceClass ResourceClass, const AttributeCommonInfo &CommonInfo) {
auto *A = new (Ctx) HLSLResourceClassAttr(Ctx, CommonInfo, ResourceClass);
if (!A->isAttributeSpellingListCalculated() && !A->getAttrName())
A->setAttributeSpellingListIndex(0);
return A;
}
```
https://github.com/llvm/llvm-project/pull/144619
More information about the cfe-commits
mailing list