https://bugs.llvm.org/show_bug.cgi?id=47466

            Bug ID: 47466
           Summary: comments to the right of an include not allowed
           Product: flang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedb...@nondot.org
          Reporter: narom...@anl.gov
                CC: david.tr...@arm.com, jper...@nvidia.com,
                    kirankuma...@gmail.com, llvm-bugs@lists.llvm.org,
                    sscalp...@nvidia.com

Created attachment 23939
  --> https://bugs.llvm.org/attachment.cgi?id=23939&action=edit
Test include header file with comment

A comment to the right of include line is not supported by the Flang front-end. 
  #include "simpleheader.fh"      ! Simple header

[naromero@naromero-desktop bugs]$
/nfs/gce/projects/naromero-workspace/llvm-master/bin/flang -c
testheadercomments.F 
/nfs/gce/projects/naromero-workspace/llvm-master/bin/f18: could not scan
testheadercomments.F
testheadercomments.F:2:10: error: #include: expected name of file to include
  #include "simpleheader.fh"      ! Simple header
           ^^^^^^^^^^^^^^^^^

I am not sure if this is part of the Fortran language standard or not, but
ifort supports it without warnings. PGI and Gfortran support it, but issue a
warning.


[naromero@naromero-desktop bugs]$ pgfortran -c testheadercomments.F 
PGF90-W-0951-Extraneous tokens ignored following # directive
(testheadercomments.F: 2)

GFortran
[naromero@naromero-desktop bugs]$ gfortran -c testheadercomments.F 
testheadercomments.F:2:0:

 #include "simpleheader.fh"      ! Simple header

Warning: extra tokens at end of #include directive

I am not sure if this is part of the Fortran standard or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to