https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77285
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- Oops, sorry that's the nm output for the wrong objects, the output for the reduced examples is: nm a.o U _GLOBAL_OFFSET_TABLE_ 0000000000000000 B _Z13gFeelingLuckyB3tag 0000000000000000 W _ZN1XB3tagD1Ev 0000000000000000 W _ZN1XB3tagD2Ev 0000000000000000 n _ZN1XB3tagD5Ev 0000000000000000 T _ZTH13gFeelingLuckyB3tag U __cxa_thread_atexit U __dso_handle 0000000000000004 b __tls_guard 0000000000000000 t __tls_init nm main.o U _GLOBAL_OFFSET_TABLE_ U _Z13gFeelingLuckyB3tag U _ZTH13gFeelingLucky 0000000000000000 W _ZTW13gFeelingLucky 0000000000000000 T main The definition is _ZTH13gFeelingLuckyB3tag but the extern reference is ZTH13gFeelingLucky The wrapper function should probably be tagged too, so it doesn't conflict with a symbol for the untagged object, otherwise a library that contains both _ZTH13gFeelingLuckyB3tag and _ZTH13gFeelingLucky would get the wrong one via the wrapper function.