================
@@ -1238,6 +1243,18 @@ void UnwrappedLineParser::parsePPUnknown() {
     nextToken();
   if (Style.IndentPPDirectives != FormatStyle::PPDIS_None)
     Line->Level += PPBranchLevel + 1;
+  // For BeforeHashWithCode, PP directives inside unreachable branches must
+  // not be emitted: in multi-pass formatting the surrounding C++ braces may
+  // have been skipped (PP_Unreachable code is not parsed), leaving
+  // Line->Level too low.  The resulting incorrect replacement would conflict
+  // with the correct one produced by the reachable pass, causing an
+  // "overlapping replacement" error and an empty output.  Simply discard the
+  // accumulated tokens so the reachable pass wins.
----------------
turgu1 wrote:

Done

https://github.com/llvm/llvm-project/pull/186686
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to