diff options
author | Haojian Wu <hokein@google.com> | 2016-03-02 14:12:17 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-03-02 14:12:17 +0000 |
commit | 7d08ba274959e110dfd4929cd2318a26083e6185 (patch) | |
tree | e64a1098f2c12211ded0ad91be42e4646c4d26e4 /clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp | |
parent | 8f3381ed315604ff3a7853f22587d9115dd95a58 (diff) | |
download | bcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.tar.gz bcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.zip |
[clang-tidy] Fix an assertion failure of "SLocEntry::getExpansion()" when IncludeInserter handles macro header file.
Summary: Also Fixes PR24749.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17805
llvm-svn: 262484
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp index 8f4bee6ad90..d128c691110 100644 --- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp +++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "IncludeInserter.h" +#include "clang/Lex/Token.h" namespace clang { namespace tidy { @@ -19,14 +20,14 @@ public: // Implements PPCallbacks::InclusionDerective(). Records the names and source // locations of the inclusions in the main source file being processed. void InclusionDirective(SourceLocation HashLocation, - const Token & /*include_token*/, + const Token & IncludeToken, StringRef FileNameRef, bool IsAngled, CharSourceRange FileNameRange, const FileEntry * /*IncludedFile*/, StringRef /*SearchPath*/, StringRef /*RelativePath*/, const Module * /*ImportedModule*/) override { Inserter->AddInclude(FileNameRef, IsAngled, HashLocation, - FileNameRange.getEnd()); + IncludeToken.getEndLoc()); } private: |