[PATCH] D157691: [ASTImporter] Remove extranous FunctionTemplateDecl introduced by templated friend
    Balázs Kéri via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Aug 14 08:52:22 PDT 2023
    
    
  
balazske added a comment.
It is better to add a test to ASTImporterTests.cpp with the same code, and check the properties of DeclContext and LexicalDeclContext in the From and To AST (should be the same in "From" and "To" side).
================
Comment at: clang/lib/AST/ASTImporter.cpp:6451
+  if (D->getFriendObjectKind() == Decl::FOK_None)
+    LexicalDC->addDeclInternal(ToFunc);
 
----------------
`addDeclToContexts(D, ToFunction)` should be better
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157691/new/
https://reviews.llvm.org/D157691
    
    
More information about the cfe-commits
mailing list