[llvm-bugs] [Bug 47546] New: A pure subprogram may not have a variable with the SAVE attribute

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 16 06:50:21 PDT 2020


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

            Bug ID: 47546
           Summary: A pure subprogram may not have a variable with the
                    SAVE attribute
           Product: flang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedbugs at nondot.org
          Reporter: riccardo.bertossa at gmail.com
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    kirankumartp at gmail.com, llvm-bugs at lists.llvm.org,
                    sscalpone at nvidia.com

Both gfortran and ifort compiles the following (and ifort produces a warning,
since the return value is not defined)

MODULE pippo                    
SAVE                            

CONTAINS                        
PURE FUNCTION test( )
   IMPLICIT NONE                
   INTEGER :: test   
   INTEGER :: mc                
END FUNCTION                    

END MODULE                      


$ flang bug.f90 -c
bug.f90:9:15: error: A pure subprogram may not have a variable with the SAVE
attribute          
     INTEGER :: mc                                                              
                ^^                                                              
f18: semantic errors in bug.f90

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200916/59bcf918/attachment-0001.html>


More information about the llvm-bugs mailing list