clang-format: Correctly mark preprocessor lines in child blocks.
authorDaniel Jasper <djasper@google.com>
Sun, 8 Feb 2015 09:34:49 +0000 (09:34 +0000)
committerDaniel Jasper <djasper@google.com>
Sun, 8 Feb 2015 09:34:49 +0000 (09:34 +0000)
commit29d39d54e7398610126f15f1f3fb97f9575a80f9
tree0e510d14fb29848b45841ebb110d2cd2e7838f93
parent23a485a4ed803e4870e4b85546ae678acfdbd682
clang-format: Correctly mark preprocessor lines in child blocks.

This prevents contracting:
  auto lambda = []() {
    int a = 2
  #if A
            + 2
  #endif
        ;
  };

into:
  auto lambda = []() { int a = 2
  #if A + 2
  #endif ; };

Which is obviously BAD.

This fixes llvm.org/PR22496.

llvm-svn: 228522
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp