Skip to content

Commit 3162775

Browse files
committed
--Fix for issue #127426
1 parent eafe31b commit 3162775

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

flang/lib/Parser/prescan.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ void Prescanner::LabelField(TokenSequence &token) {
435435
int outCol{1};
436436
const char *start{at_};
437437
std::optional<int> badColumn;
438+
SkipCComments();
438439
for (; *at_ != '\n' && column_ <= 6; ++at_) {
439440
if (*at_ == '\t') {
440441
++at_;

flang/test/Parser/inc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Old style C comments
2+
*comments
3+
*/
4+
#define VAL 1

flang/test/Parser/test.F

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
! RUN: %flang_fc1 -fdebug-unparse-no-sema %s 2>&1 | FileCheck %s
2+
3+
!CHECK: SUBROUTINE foo
4+
!CHECK: INTEGER i
5+
!CHECK: i = 1
6+
!CHECK: PRINT *, i
7+
!CHECK: END SUBROUTINE foo
8+
9+
subroutine foo ()
10+
#include "inc.h"
11+
integer :: i
12+
i = VAL
13+
print *,i
14+
end subroutine foo

0 commit comments

Comments
 (0)