- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"A type parameter inquiry is used to inquire about a type parameter of a data object. It applies to both intrinsic and derived types."
IMPLICIT NONE CHARACTER(*), PARAMETER :: const = 'Hello' PRINT *, const%LEN PRINT *, 'This is weird syntax'(:)%LEN END
>ifort /check:all /warn:all /standard-semantics "2014-09-24 kind-param-inquiry.f90" Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 201407 26 Copyright (C) 1985-2014 Intel Corporation. All rights reserved. 2014-09-24 kind-param-inquiry.f90(4): error #5082: Syntax error, found '%' when expecting one of: * ) :: , <END-OF-STATEMENT> ; . (/ + - : ] /) ' ** / // > .LT. < ... PRINT *, 'This is weird syntax'(:)%LEN ----------------------------------^ 2014-09-24 kind-param-inquiry.f90(3): error #6460: This is not a field name that is defined in the encompassing structure. [LEN] PRINT *, const%LEN ---------------^ 2014-09-24 kind-param-inquiry.f90(3): error #6158: The structure-name is invalid or is missing. [CONST] PRINT *, const%LEN ---------^ 2014-09-24 kind-param-inquiry.f90(4): error #6404: This name does not have a type, and must have an explicit type. [LEN] PRINT *, 'This is weird syntax'(:)%LEN -----------------------------------^ 2014-09-24 kind-param-inquiry.f90(4): error #6355: This binary operation is invalid for this data type. ['This is weird syntax'] PRINT *, 'This is weird syntax'(:)%LEN ---------^ 2014-09-24 kind-param-inquiry.f90(4): error #6549: An arithmetic or LOGICAL type is required in this context. PRINT *, 'This is weird syntax'(:)%LEN ----------------------------------^ compilation aborted for 2014-09-24 kind-param-inquiry.f90 (code 1)
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(Obviously LEN isn't a kind param for CHARACTER, I just like naming my files to confuse myself.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I know that we had some issues with type parameter inquiries - we'll take a look at this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as DPD200361370. I agree that syntax is "weird", but it is legal. It seems that ifort doesn't like the inquiry functions on PARAMETER constants or literals.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page