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

Rémi Galan Alfonso <remi.galanalfonso at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |remi.galanalfonso at gmail dot 
com

--- Comment #2 from Rémi Galan Alfonso <remi.galanalfonso at gmail dot com> ---
Hello,

I'm unable to reproduce it on any released gcc-11 or on trunk (but can with a
gcc from 2020-12-20).

Reduction gives me for hello.cc:
    module;
    # 1 "" 1 
    namespace std {
    template<class >
    struct char_traits;
    }
    typedef struct {} mbstate_t;
    namespace std {
    template<>
    struct char_traits<char> {
    mbstate_t state_type;                     
    };
    template<typename _CharT, typename = char_traits<_CharT>>
    class basic_string_view {
    public: basic_string_view(const _CharT* ){};
    };
    using string_view = basic_string_view<char>;                      
    }
    # 3 "" 2
    export module hello;
    export void greeter(std::string_view){}

If we accept invalid test case this and main.cc can be further reduced into:
 - hello.cc
    module;
    # 1 "" 1
    template <class> struct char_traits;
    typedef struct {
    } __mbstate_t;
    template <> struct char_traits<char> { __mbstate_t state_type; };
    template <typename _CharT, typename = char_traits<_CharT>>
    class basic_string_view;
    using string_view = basic_string_view<char>;
    # 3 "" 2
    export module hello;
    void greeter(string_view);

 - main.cc
    import hello;
    greeter

Bisection points me to the following commit as the one fixing the bug:
    commit 47145e6916f58e1cd4f562c06fa7289da49f690c
    Author: Nathan Sidwell <nat...@acm.org>
    Date:   Tue Feb 23 07:08:55 2021 -0800

        c++: typedef for linkage [PR 99208]

As this is the first time I use cvise, you probably want to double check those
informations.
  • [Bug c++/98417] ICE when u... remi.galanalfonso at gmail dot com via Gcc-bugs

Reply via email to