https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120349

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |16.0
            Summary|[16 regression]             |[16 regression]
                   |std::println link fail with |std::println link fail with
                   |std module                  |std module since
                   |                            |r16-688-gc875748cdc468e
             Blocks|                            |103524
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot 
gnu.org
   Last reconfirmed|                            |2025-05-19
           Keywords|                            |link-failure
                 CC|                            |nshead at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  Minimal reproducer:

  // a.cpp
  module;
  struct S {
    virtual ~S() {}
  };
  struct D : S {};
  export module M;
  export using ::D;

  // b.cpp
  import M;
  int main() { D d; }

$ g++-16 -fmodules a.cpp b.cpp
/usr/bin/ld: /tmp/ccym3Ujw.o: in function `S::~S()':
b.cpp:(.text._ZN1SD2Ev[_ZN1SD5Ev]+0x9): undefined reference to `vtable for S'
collect2: error: ld returned 1 exit status

It looks like I was overzealous in cleaning up some of the special-casing for
vtable linkage.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue

Reply via email to