[PATCH] D65445: [CrossTU] Handle case when no USR could be generated during Decl search.
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 30 23:43:38 PDT 2019
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.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits