balazske added a comment.

It looks like that the problem can happen when the anonymous union is in any 
`DeclContext` and for CTU import the import of a variable is requested and that 
variable is in a related `DeclContext` (it can be at upper or lower level). 
(See code of `findDefInDeclContext`: If used for variables, it goes through 
every `DeclContext` and computes USR for specific `VarDecl`s until the one is 
found. If we have luck it may be found before the union. An anonymous union can 
not be imported because we get no USR for it so it is OK to ignore these.) So 
the test can be written in many other forms but this case (the code of `f`) was 
encountered in protobuf code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65445/new/

https://reviews.llvm.org/D65445



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

Reply via email to