https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119154
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Somewhat reduced testcase: std.C: module; namespace foo { template <typename...> struct common_type; template <typename> using common_type_t = common_type<>; template <typename> using void_t = void; template <typename> bool is_same_v; template <typename...> struct common_reference; template <typename...> using common_reference_t = common_reference<>; template <typename> struct __common_reference_impl; template <typename _Tp1, typename _Tp2> struct common_reference<_Tp1, _Tp2> : __common_reference_impl<_Tp2> {}; template <typename _Tp2> struct __common_reference_impl<void_t<common_type_t<_Tp2>>>; namespace ranges::__detail { template <typename> bool __is_subrange; } namespace __detail { template <typename, typename _Up> concept __same_as = is_same_v<_Up>; } template <typename _Tp, typename _Up> concept same_as = __detail::__same_as<_Up, _Tp>; template <typename, typename> concept common_reference_with = same_as<common_reference_t<>, common_reference_t<>>; namespace __detail { template <typename, typename _Up> concept __weakly_eq_cmp_with = requires(_Up __u) { __u; }; } template <typename _Tp, typename _Up = int> concept three_way_comparable_with = common_reference_with<_Tp, _Up>; template <typename _Tp, typename> concept __eligible_pair_like = ranges::__detail::__is_subrange<_Tp>; template <typename, typename> struct pair { template <__eligible_pair_like<pair>> pair(); }; template <typename _T1, typename _T2, typename _U1, typename _U2> struct common_type<pair<_T1, _T2>, pair<_U1, _U2>>; template <typename _Iter> concept input_or_output_iterator = requires(_Iter __i) { __i; }; template <typename _Sent, typename _Iter> concept sentinel_for = __detail::__weakly_eq_cmp_with<_Sent, _Iter>; struct move_iterator; template <three_way_comparable_with> void operator>(move_iterator, move_iterator); namespace ranges { template <typename> bool enable_borrowed_range; namespace __detail { template <typename _Tp> concept __maybe_borrowed_range = enable_borrowed_range<_Tp>; } template <typename _Tp> concept borrowed_range = __detail::__maybe_borrowed_range<_Tp>; enum subrange_kind {}; template <input_or_output_iterator _It, sentinel_for<_It>, int> struct subrange { template <borrowed_range> subrange(); }; template <typename _Iter, typename _Sent, subrange_kind _Kind> bool __detail::__is_subrange<subrange<_Iter, _Sent, _Kind>>; } } extern "C" __inline __attribute__((__gnu_inline__)) wchar_t * bar(wchar_t *, wchar_t, decltype (sizeof 0)) noexcept { return nullptr; } namespace foo { template <typename> struct char_traits { void assign() { bar; } }; template <typename> struct __new_allocator { void allocate___n() { allocate___n > _M_max_size; } void _M_max_size(); }; template <typename _Tp> using __allocator_base = __new_allocator<_Tp>; template <typename _Tp> struct allocator : __allocator_base<_Tp> { ~allocator() noexcept {} }; template class allocator<wchar_t>; template <typename _CharT, typename = char_traits<_CharT>> class basic_string_view; namespace ranges { template <typename _CharT, typename _Traits> bool enable_borrowed_range<basic_string_view<_CharT, _Traits>>; } } export module foo; pr119154.C: extern "C" wchar_t *bar(wchar_t *, wchar_t, decltype (sizeof 0)) noexcept; namespace foo { template <typename _CharT> struct basic_string_view { using size_type = decltype (sizeof 0); basic_string_view(_CharT, size_type); }; void operatorsv() { char __str; decltype (sizeof 0) __len; basic_string_view{__str, __len}; } } import foo; ./cc1plus -quiet std.C -std=c++23 -fmodules -o std.s; ./cc1plus -quiet pr119154.C -std=c++23 -fmodules