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

            Bug ID: 123590
           Summary: [REGRESSION] error: ‘...’ resolves to ‘...’, which is
                    not a class type
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jonathan.poelen at gmail dot com
  Target Milestone: ---

```cpp
template<bool>
struct something
{
  template<class TC>
  using f = TC;
};

template<int... i>
struct iota_c_result
{
  template<class C>
  using f = typename something<sizeof...(i) < 1000>
    ::template f<C>
    ::template f<i...>;  // HERE
};

struct numbers
{
  template<int... n>
  struct f {};
};

using seq = iota_c_result<0,1,2>::f<numbers>;
```

test.cpp: In instantiation of ‘struct iota_c_result<0, 1, 2>’:
test.cpp:23:33:   required from here
   23 | using seq = iota_c_result<0,1,2>::f<numbers>;
      |                                 ^~
test.cpp:12:9: error: ‘class something<(sizeof... (i) < 1000)>::f<C>’ resolves
to ‘something<true>::f<TC>’, which is not a class type
   12 |   using f = typename something<sizeof...(i) < 1000>
      |         ^

This code works with 15.2 and trunk (16.0.1 20260114), but gives compilation
error with 15.2.1 20251112 (compiler explorer does not offer 15.2.1)
(https://godbolt.org/z/avM3s4a65)

Reply via email to