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

            Bug ID: 93085
           Summary: ICE in get_class_binding_direct and alias_ctad_tweaks,
                    with C++20 NTTP + CTAD + alias template
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

// https://godbolt.org/z/KhiNKJ
template<template<class> class A>
struct G {
    template<class T> using B = A<T>;
    template<B> static int foo();
    int x = foo<42>();
};

test.cc:5:21: internal compiler error: in get_class_binding_direct, at
cp/name-lookup.c:1221
    5 |     int x = foo<42>();
      |                     ^


And here's a second ICE in the same general area...

// https://godbolt.org/z/W3Fgku
template<template<class> class A>
struct G {
    template<class... T> using B = A<T...>;
    template<B> int foo();
    int x = foo<42>();
};
template<class T> struct A { constexpr A(T) {} };
G<A> g;

test.cc: In instantiation of 'constexpr G<A>::G()':
test.cc:8:6:   required from here
test.cc:5:20: internal compiler error: in alias_ctad_tweaks, at cp/pt.c:28181
    5 |     int x = foo<42>();
      |             ~~~~~~~^~

Both of these are ice-on-valid-code, as far as I'm aware (relative to the C++2a
draft). Bug #91365 is related.

Reply via email to