alexfh added a comment.

This commit changes the behavior of clang -E -P even when no 
-fminimize-whitespace is used. This breaks certain use cases like using clang 
to preprocess files for flex, which turns out to be sensitive to the presence 
of line breaks in places where C++ compilers aren't.

An isolated test case:

  $ clang-old -E -x c++ -P - -o /tmp/pp.good
  #define I(x, ...) \
   x { return X##x; }
  
  
  
  #ifndef A
  #define A(op, x) I(op, x)
  #endif
  
  A(foo, {
  
  
  
  
  
  
  
  })
  A(bar, {})
  $ cat /tmp/pp.good
  foo { return Xfoo; }
  bar { return Xbar; }
  $ clang-new -E -x c++ -P - -o /tmp/pp.bad
  #define I(x, ...) \
   x { return X##x; }
  
  
  
  #ifndef A
  #define A(op, x) I(op, x)
  #endif
  
  A(foo, {
  
  
  
  
  
  
  
  })
  A(bar, {})
  $ cat /tmp/pp.bad
  foo { return Xfoo; }bar { return Xbar; }

Please fix or revert the commit.

Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104601/new/

https://reviews.llvm.org/D104601

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to