https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124264
Nathaniel Shead <nshead at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-02-26
Ever confirmed|0 |1
CC| |iains at gcc dot gnu.org,
| |nshead at gcc dot gnu.org
Status|UNCONFIRMED |NEW
--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Can reproduce on Linux with the following:
// a.cpp
export module M;
export inline void foo(int) pre(x >= 0) {}
// b.cpp
import M;
int main() { foo(123); }
$ g++ -fmodules -fcontracts [ab].cpp
/usr/bin/ld: /tmp/cccjwTYm.o: in function `foo@M(int)':
b.cpp:(.text._ZW1M3fooi[_ZW1M3fooi]+0x1c): undefined reference to
`__tu_has_violation(__builtin_contract_violation_type const&, unsigned short)'
collect2: error: ld returned 1 exit status
Removing 'inline' from 'foo' allows this to compile successfully. I guess it's
the same issue as with coroutine transform functions which was fixed in
r16-6755-g400e3b66b78228.
Adding Iain to check if there's particular ABI requirements for this symbol,
and how this should behave with modules.