aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-01-09 22:32:25 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-01-09 22:32:25 +0000
commitb5bc7d04447026252b5181537ab4edcfdbeb3587 (patch)
tree15dc0072cc278ee64384ce9ba9250516ae720a1a
parent12bbc5c92209e0a7db2f71cfe03b84cb32df6adb (diff)
Don't crash if SpecString is an empty string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123134 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/TypePrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp
index 777835640d..ef9704ec85 100644
--- a/lib/AST/TypePrinter.cpp
+++ b/lib/AST/TypePrinter.cpp
@@ -870,7 +870,7 @@ TemplateSpecializationType::PrintTemplateArgumentList(
// If the last character of our string is '>', add another space to
// keep the two '>''s separate tokens. We don't *have* to do this in
// C++0x, but it's still good hygiene.
- if (SpecString[SpecString.size() - 1] == '>')
+ if (!SpecString.empty() && SpecString[SpecString.size() - 1] == '>')
SpecString += ' ';
if (!SkipBrackets)