------- Comment #12 from janus at gcc dot gnu dot org 2010-08-03 12:59 ------- (In reply to comment #8) > If I run the code in comment 4 with an appended "end" (to make it a complete > program), I (still) get link errors: > > /tmp/cc3J3Ygi.o: In function `__m_MOD_new_bar': > aa3.f90:(.text+0x2c): undefined reference to `vtab$bar.1527'
This error can be fixed by: Index: match.c =================================================================== --- match.c (revision 162839) +++ match.c (working copy) @@ -2902,6 +2902,9 @@ gfc_match_allocate (void) &tail->expr->where); goto cleanup; } + + if (ts.type == BT_DERIVED) + gfc_find_derived_vtab (ts.u.derived); } if (tail->expr->ts.type == BT_DERIVED) Disclaimer: I haven't checked this for regressions. And I'm not sure yet if it really is the proper fix for this issue. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42207