Skip to content

Commit 54528c6

Browse files
committed
fix intrinsic module parsing in the next line
1 parent 7f3f7ad commit 54528c6

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/fpm_source_parsing.f90

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,17 @@ subroutine parse_use_statement(f_filename,i,line,use_stmt,is_intrinsic,module_na
690690
has_intrinsic_name = any([(index(module_name,trim(INTRINSIC_NAMES(j)))>0, &
691691
j=1,size(INTRINSIC_NAMES))])
692692
if (intr>0 .and. .not.has_intrinsic_name) then
693-
call file_parse_error(error,f_filename, &
694-
'module '//module_name//' is declared intrinsic but it is not ',i, &
695-
lowercase)
696-
return
693+
694+
! An intrinsic module was not found. Its name could be in the next line,
695+
! in which case, we just skip this check. The compiler will do the job if the name is invalid.
696+
697+
! Module name was not read: it's in the next line
698+
if (index(module_name,'&')<=0) then
699+
call file_parse_error(error,f_filename, &
700+
'module '//module_name//' is declared intrinsic but it is not ',i, &
701+
lowercase)
702+
return
703+
endif
697704
endif
698705

699706
! Should we treat this as an intrinsic module

0 commit comments

Comments
 (0)