aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-19 17:14:38 +0000
committerDaniel Jasper <djasper@google.com>2013-02-19 17:14:38 +0000
commit34511fb79201ba9ed39c97f3a7ea0f157a79436d (patch)
tree412000941bdd0b10523502d2f8047bce3d807d9e /lib/Format/TokenAnnotator.cpp
parent523806028d812a7f29636c59a8bc0e7e3d3fd9ae (diff)
Correctly format macro with unfinished template declaration.
We can now format: #define A template <typename T> Before this created a segfault :-/. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.cpp')
-rw-r--r--lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp
index bb2e04b66e..d9368c3649 100644
--- a/lib/Format/TokenAnnotator.cpp
+++ b/lib/Format/TokenAnnotator.cpp
@@ -293,7 +293,8 @@ private:
next();
if (!parseAngle())
return false;
- CurrentToken->Parent->ClosesTemplateDeclaration = true;
+ if (CurrentToken != NULL)
+ CurrentToken->Parent->ClosesTemplateDeclaration = true;
return true;
}
return false;