balazske added a comment.

The following ASTImporterTest reproduces the assert:

  TEST_P(ASTImporterOptionSpecificTestBase, SourceLocationDifferentTU) {
    TranslationUnitDecl *ToTU = getToTuDecl("void f1();", Lang_CXX11);
    Decl *FromTU = getTuDecl("void f2();", Lang_CXX11, "input.cc");
    auto *ToF1 = FirstDeclMatcher<FunctionDecl>().match(ToTU, functionDecl());
    auto *FromF2 = FirstDeclMatcher<FunctionDecl>().match(FromTU, 
functionDecl());
  
    auto *ToF2 = Import(FromF2, Lang_CXX11);
  
    bool Before1 = 
ToTU->getASTContext().getSourceManager().isBeforeInTranslationUnit(ToF1->getLocation(),
 ToF2->getLocation());
    bool Before2 = 
ToTU->getASTContext().getSourceManager().isBeforeInTranslationUnit(ToF2->getLocation(),
 ToF1->getLocation());
    EXPECT_NE(Before1, Before2);
  }


Repository:
  rC Clang

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

https://reviews.llvm.org/D59934



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

Reply via email to