public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95036] New: ICE with variadic type/nttp template templates
@ 2020-05-10 13:29 vince.rev at gmail dot com
  2020-05-11  0:45 ` [Bug c++/95036] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vince.rev at gmail dot com @ 2020-05-10 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95036
           Summary: ICE with variadic type/nttp template templates
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vince.rev at gmail dot com
  Target Milestone: ---

Created attachment 48497
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48497&action=edit
ICE with variadic type/nttp template templates

The following code in std=c++17 (I couldn't make it smaller because I don't
know where the bug is coming from) compiles correctly with gcc 7 and 8, but
fails with gcc 9 and 10. Link to godbolt: https://godbolt.org/z/x_66lB

================================================================================
#include <array>
#include <utility>
#include <type_traits>

template <template <class, auto...> class Template>
struct base {
    template <template <class, auto...> class, class = void>
    struct is_same_template: std::false_type {};
    template <class Dummy>
    struct is_same_template<Template, Dummy>: std::true_type {};
    template <
        template <class, auto...> class X,
        class = std::enable_if_t<is_same_template<X>::value>
    >
    constexpr void function() const noexcept {};
};

template <template <class, auto...> class... Templates>
struct derived: base<Templates>... {
    using base<Templates>::function...;
};

int main(int, char**) {
    derived<std::array, std::integer_sequence> x;
    x.function<std::array>();
}
================================================================================

The error message is :
--------------------------------------------------------------------------------
gcc-ice-2020-05-10.cpp: In substitution of 'template<template<class, auto
...<anonymous> > class X, class> constexpr void
base<std::integer_sequence>::function<X, <template-parameter-1-2> >() const
[with X = std::array; <template-parameter-1-2> = <missing>]':
gcc-ice-2020-05-10.cpp:25:28:   required from here
gcc-ice-2020-05-10.cpp:10:12: internal compiler error: in tsubst, at
cp/pt.c:14592
   10 |     struct is_same_template<Template, Dummy>: std::true_type {};
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
--------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-07-07  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10 13:29 [Bug c++/95036] New: ICE with variadic type/nttp template templates vince.rev at gmail dot com
2020-05-11  0:45 ` [Bug c++/95036] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-05-11  1:01 ` mpolacek at gcc dot gnu.org
2020-05-11  1:06 ` mpolacek at gcc dot gnu.org
2020-05-12 20:23 ` jason at gcc dot gnu.org
2021-06-01  8:17 ` [Bug c++/95036] [9/10/11/12 Regression] ICE with variadic template template parameters rguenth at gcc dot gnu.org
2022-02-15  5:06 ` cvs-commit at gcc dot gnu.org
2022-02-16  0:12 ` [Bug c++/95036] [9/10/11 " jason at gcc dot gnu.org
2022-03-28 19:13 ` cvs-commit at gcc dot gnu.org
2022-05-27  9:42 ` [Bug c++/95036] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-03-15 12:45 ` cvs-commit at gcc dot gnu.org
2023-07-07  8:51 ` rguenth at gcc dot gnu.org

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).