diff options
| author | Daniel Jasper <djasper@google.com> | 2013-04-11 08:48:20 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-04-11 08:48:20 +0000 |
| commit | 6e8f4edf2d0ce63bb17dc77a006b94b3812eb335 (patch) | |
| tree | 4062b7a7796e304be4d3cf179d9c5493507cc126 /clang/lib/Format/TokenAnnotator.cpp | |
| parent | 8c4c1266533ae0640a3a593f0edb82eba562f8c2 (diff) | |
| download | bcm5719-llvm-6e8f4edf2d0ce63bb17dc77a006b94b3812eb335.tar.gz bcm5719-llvm-6e8f4edf2d0ce63bb17dc77a006b94b3812eb335.zip | |
Fix formatting of overloaded assignment operators.
Before: SomeType &operator=(const SomeType & S);
After: SomeType &operator=(const SomeType &S);
llvm-svn: 179270
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 42cbf04aec9..08d9b10694a 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -563,7 +563,8 @@ private: }; void determineTokenType(AnnotatedToken &Current) { - if (getPrecedence(Current) == prec::Assignment) { + if (getPrecedence(Current) == prec::Assignment && + (!Current.Parent || Current.Parent->isNot(tok::kw_operator))) { Contexts.back().IsExpression = true; for (AnnotatedToken *Previous = Current.Parent; Previous && Previous->isNot(tok::comma); |

