[flang-commits] [flang] [flang] Accept C-style comments in label fields (PR #207012)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Fri Jul 3 07:42:21 PDT 2026


================
@@ -1366,12 +1400,19 @@ const char *Prescanner::FixedFormContinuationLine(bool atNewline) {
   }
   tabInCurrentLine_ = false;
   char col1{*nextLine_};
+  int trailingSpaces{0};
+  for (int i{4}; i > 0 && nextLine_[i] == ' '; --i) {
+    ++trailingSpaces;
+  }
----------------
luporl wrote:

As mentioned in the other comment, `SkipCComment()` doesn't check for a valid comment start, which led to `* */` being considered a C comment.
Calling it only when `IsCComment()` is true fixed the regression.

https://github.com/llvm/llvm-project/pull/207012


More information about the flang-commits mailing list