- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Zero sized array constructors for derived types used to work, didn't they? They syntax for them appears to be in the compiler docs.
[fortran]PROGRAM WhereDidZeroSizedArrayConstructorsGo
IMPLICIT NONE
TYPE :: my_type
END TYPE my_type
TYPE(my_type), ALLOCATABLE :: array(:)
array = [ my_type :: ]
PRINT *, SIZE(array)
END PROGRAM WhereDidZeroSizedArrayConstructorsGo
[/fortran]
[plain]>ifort /check:all /warn:all /standard-semantics ArrayConstructors.f90
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.1.119 Build 20121008
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
ArrayConstructors.f90(8): error #5082: Syntax error, found '::' when expecting one of: , (/ : ]
array = [ my_type :: ]
--------------------^
ArrayConstructors.f90(8): error #6478: A type-name must not be used as a variable. [MY_TYPE]
array = [ my_type :: ]
------------^
compilation aborted for ArrayConstructors.f90 (code 1)[/plain]
Or am I imagining things? I would have sworn that they were in active use in our code base, but now I can't find any examples.
Yours in deluded confusion,
IanH
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page