[clang] [clang] Instantiate attributes on other decl types (PR #115924)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 14 11:36:47 PST 2024
================
@@ -52,7 +52,7 @@ struct ExampleAttrInfo : public ParsedAttrInfo {
AttrHandling handleDeclAttribute(Sema &S, Decl *D,
const ParsedAttr &Attr) const override {
// Check if the decl is at file scope.
- if (!D->getDeclContext()->isFileContext()) {
+ if (!D->getDeclContext()->isFileContext() && !isa<LabelDecl>(D)) {
----------------
erichkeane wrote:
What is happening here? I wouldn't expect a `LabelDecl` to appear at file scope anyway, it isn't really possible.
https://github.com/llvm/llvm-project/pull/115924
More information about the cfe-commits
mailing list