summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 6772c894dc0..220da707b15 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -853,6 +853,10 @@ public:
/// \brief Parse expressions with the given operatore precedence.
void parse(int Precedence = 0) {
+ // Skip 'return' as it is not part of a binary expression.
+ while (Current && Current->is(tok::kw_return))
+ next();
+
if (Current == NULL || Precedence > PrecedenceArrowAndPeriod)
return;
OpenPOWER on IntegriCloud