summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/FormatToken.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-10-11 21:25:45 +0000
committerManuel Klimek <klimek@google.com>2013-10-11 21:25:45 +0000
commit71814b44658523f5fc747475ad8b40c9197565e2 (patch)
treefa39904587c053d3ec68c96d7d11de801ddfd182 /clang/lib/Format/FormatToken.cpp
parent4c42732cf869d167e48a15afe280cb847984e7a5 (diff)
downloadbcm5719-llvm-71814b44658523f5fc747475ad8b40c9197565e2.tar.gz
bcm5719-llvm-71814b44658523f5fc747475ad8b40c9197565e2.zip
Support formatting of preprocessor branches.
We now correctly format: void SomeFunction(int param1, #ifdef X NoTemplate param2, #else template < #ifdef A MyType<Some> > #else Type1, Type2> #endif param2, #endif param3) { f(); } llvm-svn: 192503
Diffstat (limited to 'clang/lib/Format/FormatToken.cpp')
-rw-r--r--clang/lib/Format/FormatToken.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp
index 7469216a147..35764ce8823 100644
--- a/clang/lib/Format/FormatToken.cpp
+++ b/clang/lib/Format/FormatToken.cpp
@@ -145,6 +145,7 @@ void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) {
bool HasRowWithSufficientColumns = false;
unsigned Column = 0;
for (unsigned i = 0, e = ItemLengths.size(); i != e; ++i) {
+ assert(i < MustBreakBeforeItem.size());
if (MustBreakBeforeItem[i] || Column == Columns) {
++Format.LineCount;
Column = 0;
OpenPOWER on IntegriCloud