[Bug libstdc++/67632] explicit instantiation omits copy constructor and others
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Sep 19 10:24:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67632
--- Comment #6 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
> Not sure how it can be a libstdc++ issue, the copy constructor exists, the
> library can't force the front-end to instantiate it.
>
> I'm travelling without access to proper computers, but as far as I can tell
> from coliru.stacked-crooked.com it links fine using clang++
> -stdlib=libstdc++ (with libstdc++ 5.2.0).
No, it doesn't for -O0. Higher -O values make the issue go away.
markus@x4 /tmp % clang++ -stdlib=libc++ -O0 -std=c++11 t.cpp x.cpp
markus@x4 /tmp % clang++ -Wl,--no-demangle -O0 -std=c++11 t.cpp x.cpp
/tmp/x-5ef538.o:x.cpp:function
_Z4copyRKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE: error:
undefined reference to
'_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEC1ERKS8_'
clang-3.8: error: linker command failed with exit code 1 (use -v to see
invocation)
markus@x4 /tmp % icpc -Wl,--no-demangle -O0 -std=c++11 t.cpp x.cpp
/tmp/icpcMamJXz.o:x.cpp:function
_Z4copyRKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE: error:
undefined reference to
'_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEC1ERKS8_'
More information about the Gcc-bugs
mailing list