This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34432] integer(kind=init_expression) function is rejected
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Dec 2007 14:00:04 -0000
- Subject: [Bug fortran/34432] integer(kind=init_expression) function is rejected
- References: <bug-34432-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2007-12-14 14:00 -------
The problem for (...) expressions is:
In match_primary, several gfc_match_* are called, which all return MATCH_NO,
until gfc_match_char ('('), which returns true. (So far so good.)
However, before "gfc_match_char" there is a call to gfc_match_rvalue.
gfc_match_rvalue calls gfc_match_name -- and the latter not only returns
MATCH_NO, but also issues
if (gfc_error_flag_test() == 0)
gfc_error ("Invalid character in name at %C");
which is at the heart of the problem. Without the call to gfc_error, the
program works.
The next question is how to solve this without breaking the diagnostics. I'd
assume this affects much more expressions than this one.
I was thinking of a flag (like "bool match_only"), which means that on needs to
audit all 37 uses of gfc_match_name.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34432