diff options
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 5 | ||||
-rw-r--r-- | clang/unittests/AST/ASTImporterTest.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 759f9da30bf..0e3756265e5 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2554,7 +2554,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { D->isInlineSpecified(), FromConversion->isExplicit(), D->isConstexpr(), - Importer.Import(D->getLocEnd())); + SourceLocation()); } else if (auto *Method = dyn_cast<CXXMethodDecl>(D)) { ToFunction = CXXMethodDecl::Create(Importer.getToContext(), cast<CXXRecordDecl>(DC), @@ -2563,7 +2563,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { Method->getStorageClass(), Method->isInlineSpecified(), D->isConstexpr(), - Importer.Import(D->getLocEnd())); + SourceLocation()); } else { ToFunction = FunctionDecl::Create(Importer.getToContext(), DC, InnerLocStart, @@ -2580,6 +2580,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { ToFunction->setVirtualAsWritten(D->isVirtualAsWritten()); ToFunction->setTrivial(D->isTrivial()); ToFunction->setPure(D->isPure()); + ToFunction->setRangeEnd(Importer.Import(D->getLocEnd())); Importer.Imported(D, ToFunction); // Set the parameters. diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp index 1f86b91a88d..34ed5b93a89 100644 --- a/clang/unittests/AST/ASTImporterTest.cpp +++ b/clang/unittests/AST/ASTImporterTest.cpp @@ -1620,7 +1620,7 @@ TEST_P(ASTImporterTestBase, ImportSourceLocs) { FromSM); } -TEST_P(ASTImporterTestBase, DISABLED_ImportNestedMacro) { +TEST_P(ASTImporterTestBase, ImportNestedMacro) { Decl *FromTU = getTuDecl( R"( #define FUNC_INT void declToImport |