summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-28 10:06:05 +0000
committerDaniel Jasper <djasper@google.com>2013-02-28 10:06:05 +0000
commit57d4a5821d7099ab85475b535d80ee952d8f3f12 (patch)
tree52d017f76e79dbefd06af23562f85f365ce2d6e4
parent0d89178ba313c8481672bc4c31532bb48fb86a0a (diff)
downloadbcm5719-llvm-57d4a5821d7099ab85475b535d80ee952d8f3f12.tar.gz
bcm5719-llvm-57d4a5821d7099ab85475b535d80ee952d8f3f12.zip
Fix bug when formatting "A<A<A>>".
Before: A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaa); Before: A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 176244
-rw-r--r--clang/lib/Format/Format.cpp1
-rw-r--r--clang/unittests/Format/FormatTest.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index e3f7b4b2e27..18a853f1e4b 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -999,6 +999,7 @@ public:
if (FormatTok.Tok.is(tok::greatergreater)) {
FormatTok.Tok.setKind(tok::greater);
+ FormatTok.TokenLength = 1;
GreaterStashed = true;
}
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 929e3c20ba0..cc68bcb9473 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2002,6 +2002,8 @@ TEST_F(FormatTest, BreaksLongDeclarations) {
verifyGoogleFormat("template <typename T>\n"
"aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa>\n"
"aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {}");
+ verifyGoogleFormat("A<A<A>> aaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
+ " int aaaaaaaaaaaaaaaaaaaaaaa);");
}
TEST_F(FormatTest, LineStartsWithSpecialCharacter) {
OpenPOWER on IntegriCloud