r.stahl created this revision.
r.stahl added reviewers: martong, a.sidorin, balazske, xazax.hun.
Herald added subscribers: cfe-commits, rnkovacs.
On constructors that do not take the end source location, it was not imported.
Fixes test from https://reviews.llvm.org/D47698 /
https://reviews.llvm.org/rC336269.
Repository:
rC Clang
https://reviews.llvm.org/D48941
Files:
lib/AST/ASTImporter.cpp
unittests/AST/ASTImporterTest.cpp
Index: unittests/AST/ASTImporterTest.cpp
===================================================================
--- unittests/AST/ASTImporterTest.cpp
+++ unittests/AST/ASTImporterTest.cpp
@@ -1620,7 +1620,7 @@
FromSM);
}
-TEST_P(ASTImporterTestBase, DISABLED_ImportNestedMacro) {
+TEST_P(ASTImporterTestBase, ImportNestedMacro) {
Decl *FromTU = getTuDecl(
R"(
#define FUNC_INT void declToImport
Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -2533,6 +2533,7 @@
D->isInlineSpecified(),
D->isImplicit(),
D->isConstexpr());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
if (unsigned NumInitializers = FromConstructor->getNumCtorInitializers()) {
SmallVector<CXXCtorInitializer *, 4> CtorInitializers;
for (auto *I : FromConstructor->inits()) {
@@ -2555,6 +2556,7 @@
NameInfo, T, TInfo,
D->isInlineSpecified(),
D->isImplicit());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
} else if (auto *FromConversion = dyn_cast<CXXConversionDecl>(D)) {
ToFunction = CXXConversionDecl::Create(Importer.getToContext(),
cast<CXXRecordDecl>(DC),
@@ -2580,6 +2582,7 @@
D->isInlineSpecified(),
D->hasWrittenPrototype(),
D->isConstexpr());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
}
// Import the qualifier, if any.
Index: unittests/AST/ASTImporterTest.cpp
===================================================================
--- unittests/AST/ASTImporterTest.cpp
+++ unittests/AST/ASTImporterTest.cpp
@@ -1620,7 +1620,7 @@
FromSM);
}
-TEST_P(ASTImporterTestBase, DISABLED_ImportNestedMacro) {
+TEST_P(ASTImporterTestBase, ImportNestedMacro) {
Decl *FromTU = getTuDecl(
R"(
#define FUNC_INT void declToImport
Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -2533,6 +2533,7 @@
D->isInlineSpecified(),
D->isImplicit(),
D->isConstexpr());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
if (unsigned NumInitializers = FromConstructor->getNumCtorInitializers()) {
SmallVector<CXXCtorInitializer *, 4> CtorInitializers;
for (auto *I : FromConstructor->inits()) {
@@ -2555,6 +2556,7 @@
NameInfo, T, TInfo,
D->isInlineSpecified(),
D->isImplicit());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
} else if (auto *FromConversion = dyn_cast<CXXConversionDecl>(D)) {
ToFunction = CXXConversionDecl::Create(Importer.getToContext(),
cast<CXXRecordDecl>(DC),
@@ -2580,6 +2582,7 @@
D->isInlineSpecified(),
D->hasWrittenPrototype(),
D->isConstexpr());
+ ToFunction->setRangeEnd(Importer.Import(D->getLocEnd()));
}
// Import the qualifier, if any.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits