diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-23 12:58:14 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-23 12:58:14 +0000 |
commit | 420d7d333e593320613889eadb66bfe16b591908 (patch) | |
tree | 4ca0960707b62c359795df4c2a8be49142768bbc /clang/lib | |
parent | 4766fe6f10ba99add6f8237c49072a4a766beeff (diff) | |
download | bcm5719-llvm-420d7d333e593320613889eadb66bfe16b591908.tar.gz bcm5719-llvm-420d7d333e593320613889eadb66bfe16b591908.zip |
Fix the formatting of pointer/reference types in range-based for loops.
Before: for (int & a : Values) {}
After: for (int &a : Values) {}
llvm-svn: 173259
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/Format.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index c75b8ef834b..d95deb57046 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1262,7 +1262,8 @@ private: } } if (Current.is(tok::kw_return) || Current.is(tok::kw_throw) || - (Current.is(tok::l_paren) && !Line.MustBeDeclaration)) + (Current.is(tok::l_paren) && !Line.MustBeDeclaration && + (Current.Parent == NULL || Current.Parent->isNot(tok::kw_for)))) IsExpression = true; if (Current.Type == TT_Unknown) { |