https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70182
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW CC| |iant at google dot com --- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- trippels@gcc2-power8 ~ % cat down.ii namespace std { template <typename _Tp> struct integral_constant { static constexpr _Tp value = 0; }; template <typename> struct conditional; template <typename...> struct A; template <typename _B1, typename _B2> struct A<_B1, _B2> : conditional<_B1>::type {}; struct B : integral_constant<bool> {}; template <int, typename = void> struct enable_if { typedef int type; }; template <typename> struct conditional { typedef B type; }; struct type_info; template <typename> struct function; template <typename _Functor> struct _Base_manager { static int _M_manager() { ; } }; template <typename, typename> struct C; template <typename _Res, typename _Functor, typename... _ArgTypes> struct C<_Res(_ArgTypes...), _Functor> : _Base_manager<_Functor> {}; template <typename, typename> using __check_func_return_type = int; template <typename _Res, typename... _ArgTypes> struct function<_Res(_ArgTypes...)> { template <typename _Functor> using _Callable = A<_Functor, __check_func_return_type<_Functor, _Res>>; template <typename _Cond, typename> using _Requires = typename enable_if<_Cond::value>::type; template <typename _Functor, typename = _Requires<_Callable<_Functor>, void>> function(_Functor); }; template <typename _Res, typename... _ArgTypes> template <typename _Functor, typename> function<_Res(_ArgTypes...)>::function(_Functor) { C<_Res(), _Functor>::_M_manager; } } struct D { static const int value = 0; }; namespace boost { template <typename T2> struct F { typedef T2 type; }; namespace function_types { template <typename, typename> struct G; template <typename T> struct H : G<T, int> {}; template <typename R, typename T0, typename T1, typename L> struct G<R (T0::*)(T1) const, L> { typedef D function_arity; }; template <typename T> struct function_arity : F<typename H<T>::function_arity>::type {}; } } namespace folly { namespace detail { void addBenchmarkImpl(int, int, std::function<int()>); } template <typename Lambda> typename std::enable_if<boost::function_types::function_arity< decltype(&Lambda::operator())>::value == 2>::type addBenchmark(const char *, const char *, Lambda &&) { auto execute = [](unsigned) {}; detail::addBenchmarkImpl(0, 0, execute); } } int follyBenchmarkUnused2(folly::addBenchmark("", "", [](int) {})); trippels@gcc2-power8 ~ % clang++ -w -std=c++14 down.ii -c trippels@gcc2-power8 ~ % nm -C down.o 0000000000000000 t __cxx_global_var_init 0000000000000000 B follyBenchmarkUnused2 0000000000000070 t _GLOBAL__sub_I_down.ii U .TOC. 0000000000000000 t _ZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcS8_OS3_ U folly::detail::addBenchmarkImpl(int, int, std::function<int ()>) 0000000000000090 t _ZNSt13_Base_managerIZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcS9_OS4_EUljE_E10_M_managerEv 0000000000000070 t _ZNSt8functionIFivEEC2IZN5folly12addBenchmarkI3$_0EENSt9enable_ifIXeqsr5boost14function_types14function_arityIDTadsrT_onclEEE5valueLi2EEvE4typeEPKcSC_OS7_EUljE_iEES7_ trippels@gcc2-power8 ~ % g++ -w -std=c++14 down.ii -c trippels@gcc2-power8 ~ % nm -C down.o 0000000000000000 B follyBenchmarkUnused2 000000000000014c t _GLOBAL__sub_I_follyBenchmarkUnused2 U .TOC. 00000000000000ac t __static_initialization_and_destruction_0(int, int) 0000000000000000 t _ZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSC_OS6_ U folly::detail::addBenchmarkImpl(int, int, std::function<int ()>) 000000000000007c t _ZNSt8functionIFivEEC1IZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSG_OSA_EUljE_iEESA_ 000000000000007c t _ZNSt8functionIFivEEC2IZN5folly12addBenchmarkIUliE_EENSt9enable_ifIXeqsrN5boost14function_types14function_arityIDTadsrT_clEEE5valueLi2EEvE4typeEPKcSG_OSA_EUljE_iEESA_ Ian's go demangler and the libcxxabi demangler also are unable to demangle these symbols.