Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Bogus error with PROTECTED attribute

$
0
0

Hello,

there is a strange problem when the PROTECTED attribute is used before the actual variable declaration.

Example:

module ifc_protected
  implicit none
  private
  public :: x
  !----------
  protected :: x  ! Error here
  real      :: x
  protected :: x  ! OK here
end module ifc_protected

With the Intel v15 compiler I get:

% ifort -V -c ifc_protected.f90
Intel(R) Fortran Compiler XE for applications running on IA-32, Version 15.0.5.223 Build 20150805
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

 Intel(R) Fortran 15.0-1818
ifc_protected.f90(6): error #6406: Conflicting attributes or multiple declaration of name.   [X]
  protected :: x  ! Error here
---------------^
compilation aborted for ifc_protected.f90 (code 1)

Commenting out the first PROTECTED makes the error go away.

Thanks,

Harald

 


Viewing all articles
Browse latest Browse all 3270

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>