Issue 130618
Summary [clang][ASTMatchers] global anonymous union declaration not picked up by ASTConsumer::handleTopLevelDecl
Labels clang
Assignees
Reporter carlosgalvezp
    Hi,

I'm trying to solve an issue with a clang-tidy check on the following example code:

```
static union {
  int global;
};
```

Clearly this shows up in the AST as a `CXXRecordDecl` under the `TranslationUnitDecl`: https://godbolt.org/z/j8GqxvEYd

For debugging, I am overriding the `ASTConsumer::HandleTopLevelDecl` function in `MatchASTConsumer`, and I am just simply dumping the Decls that get picked up by it.

I notice that this `CXXRecordDecl` of the union is **not** picked up by this function. 

Is this intentional? Why are global anonymous unions not registered as a "top level declaration"?

Thanks!

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to