------- Comment #2 from burnus at gcc dot gnu dot org 2007-05-26 23:24 ------- The problem is the resolution happens too early. In decl.c the function is matched and immediately the kind parameter is resolved:
gfc_match_kind_spec (gfc_typespec *ts) n = gfc_match_init_expr (&e); // "has not been declared or is a variable" msg = gfc_extract_int (e, &ts->kind); // "Constant expression required" For character lengths, it is easier as length is an expr and not as typespec's kind an enum. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229