diff options
author | Balazs Keri <1.int32@gmail.com> | 2019-03-14 14:20:23 +0000 |
---|---|---|
committer | Balazs Keri <1.int32@gmail.com> | 2019-03-14 14:20:23 +0000 |
commit | 5f4fd8b79bf6a1911f639d541e6b94beaa16151f (patch) | |
tree | c1c0ec9482e39250fdf86712af3d75a1587422c8 /clang/lib/AST/ASTImporter.cpp | |
parent | 989eca62c6b23f15fcc9da5de5f17b628fbde1db (diff) | |
download | bcm5719-llvm-5f4fd8b79bf6a1911f639d541e6b94beaa16151f.tar.gz bcm5719-llvm-5f4fd8b79bf6a1911f639d541e6b94beaa16151f.zip |
[ASTImporter] Fix import of NestedNameSpecifierLoc.
Summary:
Import type location in case of TypeSpec and TypeSpecWithTemplate.
Without this fix the imported NespedNameSpecifierLoc will have an
invalid begin location.
Reviewers: a.sidorin, shafik, a_sidorin, martong
Reviewed By: a_sidorin
Subscribers: rnkovacs, jdoerfert, dkrupp, martong, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D55358
llvm-svn: 356151
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 8a452c26efc..cff5ac66ca6 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -8092,8 +8092,11 @@ ASTImporter::Import_New(NestedNameSpecifierLoc FromNNS) { case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: { + SourceLocation ToTLoc; + if (Error Err = importInto(ToTLoc, NNS.getTypeLoc().getBeginLoc())) + return std::move(Err); TypeSourceInfo *TSI = getToContext().getTrivialTypeSourceInfo( - QualType(Spec->getAsType(), 0)); + QualType(Spec->getAsType(), 0), ToTLoc); Builder.Extend(getToContext(), ToLocalBeginLoc, TSI->getTypeLoc(), ToLocalEndLoc); break; |