[PATCH] D47057: [ASTImporter] Fix missing implict CXXRecordDecl in ClassTemplateSpecializationDecl

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 22 06:35:48 PDT 2018

martong added inline comments.

Comment at: lib/AST/ASTImporter.cpp:1962
   TagDecl *Definition = D->getDefinition();
-  if (Definition && Definition != D) {
+  if (!D->isImplicit() && Definition && Definition != D) {
     Decl *ImportedDef = Importer.Import(Definition);
a.sidorin wrote:
> We are changing import if RecordDecl. Is it possible to add a test that doesn't require templates?
> I tried and found that the implicit CXXRecordDecl of ClassTemplateSpecializationDecl is its redeclaration. That's not true for normal CXXRecordDecls, as I see, so this deserves a comment.
Yes, I've added a new test which exercises only a RecordDecl.
Also, added a comment about the specialization re-declaration.

  rC Clang


More information about the cfe-commits mailing list