aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 1821937ec3..d234006a25 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -1749,6 +1749,10 @@ private:
unsigned Limit) {
if (!Style.AllowShortIfStatementsOnASingleLine)
return;
+ if ((I + 1)->InPPDirective != I->InPPDirective ||
+ ((I + 1)->InPPDirective &&
+ (I + 1)->First.FormatTok.HasUnescapedNewline))
+ return;
AnnotatedLine &Line = *I;
if (Line.Last->isNot(tok::r_paren))
return;