From 8acf822b6fdebddc08d9f1b3614e83491a43b32c Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 7 May 2014 09:23:05 +0000 Subject: clang-format: Fix corner cases for comments in if conditions. Before: if ( // a x + 3) { .. After: if ( // a x + 3) { .. llvm-svn: 208175 --- clang/lib/Format/TokenAnnotator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Format/TokenAnnotator.cpp') diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index a41992679ad..21cec905a8e 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1667,7 +1667,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return false; if (Left.is(tok::l_paren) && Left.Previous && (Left.Previous->Type == TT_BinaryOperator || - Left.Previous->Type == TT_CastRParen)) + Left.Previous->Type == TT_CastRParen || Left.Previous->is(tok::kw_if))) return false; if (Right.Type == TT_ImplicitStringLiteral) return false; -- cgit v1.2.3