aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-14 15:52:06 +0000
committerDaniel Jasper <djasper@google.com>2013-01-14 15:52:06 +0000
commit2b9c10bd8f80c004756308a5163fa7eda27eb5ce (patch)
tree2249d69db98e8fdfb5d72caf6f7192e40531b2fc /lib/Format/Format.cpp
parente0b15ea7edeceb41decddfeabaf6fac935ed7baf (diff)
Fix bug that would lead to joining preprocessor directives.
Before: #include "a.h" #include "b.h" After: #include "a.h" #include "b.h" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index c8dc7bf55c..742b9a8d1c 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -1427,7 +1427,8 @@ private:
std::vector<AnnotatedLine>::iterator E,
unsigned Limit) {
AnnotatedLine &Line = *I;
- if (!(I + 1)->InPPDirective) return;
+ if (!(I + 1)->InPPDirective || (I + 1)->First.FormatTok.HasUnescapedNewline)
+ return;
if (I + 2 != E && (I + 2)->InPPDirective &&
!(I + 2)->First.FormatTok.HasUnescapedNewline)
return;