- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Current ifort/ifx are confused by overloaded structure constructors in the face of any sort of module hierarchy. The attached fails to compile...
>ifx /c /standard-semantics /check:all /warn:all broken_constructor_overload.f90
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.2.0 Build 20240602
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
broken_constructor_overload.f90(24): remark #7712: This variable has not been used. [ARG]
FUNCTION construct_c_given_b(arg) RESULT(r)
-------------------------------^
broken_constructor_overload.f90(50): error #6053: Structure constructor may not have components with the PRIVATE attribute [B_ARG]
c_var = type_c(b_arg)
-------------------^
broken_constructor_overload.f90(50): error #8001: The type of the component in a structure-constructor differs from the type of the component in the derived-type-def. [B_ARG]
c_var = type_c(b_arg)
-------------------^
compilation aborted for broken_constructor_overload.f90 (code 1)
But comment out the use statement marked <--- in the proc module procedure, and all is well.
This rather suggests that dependent modules are not correctly passing on the "along with this type there is a generic interface with the same name as the type that is to a function that then supplements/supplants the structure constructor" feature of Fortran 2003.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@IanH
thanks for reporting that, I escalated it to our developers.

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