public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ensadc at mailnesia dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100134] [modules] ICE when using a vector in a module
Date: Sun, 20 Jun 2021 09:03:04 +0000	[thread overview]
Message-ID: <bug-100134-4-qHEf8wDD5H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100134-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100134

--- Comment #1 from ensadc at mailnesia dot com ---
Reduced:

========
vector
--------
namespace std {
template <typename _Tp, typename _Up> struct __replace_first_arg;
template <template <typename, typename...> class _Template, typename _Up,
          typename _Tp, typename... _Types>
struct __replace_first_arg<_Template<_Tp, _Types...>, _Up> {
  using type = _Template<_Up, _Types...>;
};
template <typename _Tp> struct allocator {
  typedef _Tp value_type;
  friend constexpr bool operator==(const allocator &,
                                   const allocator &) noexcept {
    return true;
  }
};
} // namespace std
namespace __gnu_cxx {
template <typename _Alloc, typename = typename _Alloc::value_type>
struct __alloc_traits {
  template <typename _Tp> struct rebind {
    typedef std::__replace_first_arg<_Alloc, _Tp> other;
  };
};
} // namespace __gnu_cxx
namespace std {
template <typename _Tp, typename _Alloc = std::allocator<_Tp>> class vector {
  typedef
      typename __gnu_cxx::__alloc_traits<_Alloc>::template rebind<_Tp>::other
          _Tp_alloc_type;
};
} // namespace std
========
foo.cpp
--------
export module foo;
import <vector>;
export struct Foo {
  std::vector<int> v;
};
========
build commands:

g++ -I . -x c++-system-header -fmodules-ts -std=c++20 vector
g++ -I . -std=c++20 -fmodules-ts foo.cpp

  reply	other threads:[~2021-06-20  9:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18  9:48 [Bug c++/100134] New: ICE when using a vector in a mdoule patrick.kox at commandoregel dot be
2021-06-20  9:03 ` ensadc at mailnesia dot com [this message]
2022-03-10 14:49 ` [Bug c++/100134] [modules] ICE when using a vector in a module sandipan.mohanty at gmail dot com
2022-04-06  7:47 ` sandipan.mohanty at gmail dot com
2022-04-06  7:52 ` sandipan.mohanty at gmail dot com
2022-09-26 23:33 ` pinskia at gcc dot gnu.org
2022-09-26 23:34 ` johelegp at gmail dot com
2022-10-07 19:11 ` ppalka at gcc dot gnu.org
2022-10-11 19:03 ` cvs-commit at gcc dot gnu.org
2022-10-12 14:36 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100134-4-qHEf8wDD5H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).