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: unassignedb...@nondot.org
          Reporter: riccardo.berto...@gmail.com
                CC: david.tr...@arm.com, jper...@nvidia.com,
                    kirankuma...@gmail.com, llvm-bugs@lists.llvm.org,
                    sscalp...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to