Janus Weil wrote:
the attached patch fixes this accepts-valid OOP PR. It consists of two parts: 1) resolve_structure_cons is being extended to check the interface of proc-ptr components (comment #7). 2) A small fix to allow for correct parsing of structure constructors including proc-ptr components (comment #8).
Thanks for the patch!
+ if (s2&& !gfc_compare_interfaces (comp->ts.interface, s2, name, 0, 1, + err, sizeof(err)))
Space after sizeof.
+ gfc_error ("In derived type constructor at %L: Interface mismatch" + " in procedure pointer component '%s': %s", + &cons->expr->where, comp->name, err);
Somehow, I find the words clumsy with too many colons. "derived type constructor" - I'd use a hyphen ("derived-type") and I want to note that the standard calls it "structure constructor"; I also would use "for ... component" and not "in ... component" and add a hyphen to "procedure pointer".
How about a simpler: "Interface mismatch for procedure-pointer component '%s' at %L: %s"? I think it should be clear from the context that it is about a structure constructor. Or for the long version, how about: "Interface mismatch for procedure-pointer component '%s' in structure constructor at %L: %s"?
OK with fixing the sizeof nit and after considering the text changes. Tobias