curdeius added a comment.

That's definitely an unintended behaviour. Please file a bug and possibly mark 
it as release blocker for LLVM 12. Either a fix will be there soon, or we'll 
revert.

FYI, simple reproduce:

  verifyFormat("#include <stdint.h>\n"
               "namespace rep {}",
               Style);

The problem doesn't happen with `#include "stdint.h"`.



================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:374-375
+        if (Previous) {
+          if (Previous->is(tok::greater))
+            return 0;
+          if (Previous->is(tok::identifier)) {
----------------
@leonardchan, it seems this is the culprit. the closing `>` in the `#include 
<...>` is treated as if it were a template closer and so it inhibits line 
merging.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93839

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

Reply via email to