From 14c7754a35da9bf6b346e2a6ce4b3d8c3b00b434 Mon Sep 17 00:00:00 2001 From: Jean Perier Date: Thu, 31 Mar 2022 10:54:15 +0200 Subject: [PATCH] [flang] Skip `D` when including D debug line When including debug lines as code, the `D` should be considered as a white space. Currently an error was raised about bad labels because it the `D` remained a `D` when considering the source line as code. Differential Revision: https://reviews.llvm.org/D122711 --- flang/lib/Parser/prescan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp index b4b8a17341f7..17fc090c8c9c 100644 --- a/flang/lib/Parser/prescan.cpp +++ b/flang/lib/Parser/prescan.cpp @@ -144,6 +144,10 @@ void Prescanner::Statement() { case LineClassification::Kind::Source: BeginStatementAndAdvance(); if (inFixedForm_) { + if (features_.IsEnabled(LanguageFeature::OldDebugLines) && + (*at_ == 'D' || *at_ == 'd')) { + NextChar(); + } LabelField(tokens); } else if (skipLeadingAmpersand_) { skipLeadingAmpersand_ = false;