This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/20323] optional arguments incorrectly accepted in specification expressions
- From: "tow21 at cam dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2005 16:11:46 -0000
- Subject: [Bug fortran/20323] optional arguments incorrectly accepted in specification expressions
- References: <20050304195657.20323.tow21@cam.ac.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tow21 at cam dot ac dot uk 2005-03-09 16:11 -------
(In reply to comment #1)
> The complaint is a segfault at runtime when
> you actually want to do anything with the
> string whose length depends on a missing
> optional argument. This isn't too bad (the
> same thing happens if you access a missing
> optional argument).
Indeed - but even if the optional argument were present, you're still not
allowed to access it in a specification expression, and this is a constraint
that the compiler is required to detect at compile time. (It's a constraint
that I'd quite like to see partially lifted - it would be very useful to be
able to use present(arg) as part of a specification expression - but it is
forbidden according to the current standard.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20323