weiwang added a comment.

In D101793#2760639 <https://reviews.llvm.org/D101793#2760639>, @yaxunl wrote:
> I think the root cause might be duplicated decls are added to 
> Sema::DeclsToCheckForDeferredDiags defined in
>
> https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/Sema.h#L1789
>
> When compiling source codes, a decl is added only once. However if modules 
> are imported, duplicate decls may be added.
>
> We need to avoid adding duplicate decls to 
> Sema::DeclsToCheckForDeferredDiags. However we cannot simply change it to a 
> set since the order is important, otherwise the error message for later code 
> may show up earlier, causing confusion for users. I would suggest to change 
> its type to SetVector, which keeps the order and also avoids duplicates.

Thanks for the suggestion! It does make more sense to use SetVector here. I 
will try this and report back.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101793

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

Reply via email to