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

            Bug ID: 86883
           Summary: Unexpected error: expansion pattern '<anonymous>'
                    contains no argument packs
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: v.reshetnikov at gmail dot com
  Target Milestone: ---

/****************** BEGIN SOURCE ******************/
template<class... T>
struct A {
    template<template<T...> class Head, T... Args>
    static constexpr Head<Args...> foo = { };
};

template<int x>
struct C { 
    static constexpr auto value = x;
};

using type = decltype(A<int>::foo<C, 1>);

static_assert(type::value == 1);
/******************* END SOURCE *******************/

The g++ 8.2.0 compiler rejects this code:

/****************** BEGIN OUTPUT ******************/
<source>:4:34: error: expansion pattern '<anonymous>' contains no argument
packs

     static constexpr Head<Args...> foo = { };
                                  ^
/******************* END OUTPUT *******************/

I believe the code is correct and should be compiled successfully. For
comparison, Clang accepts it.

Reply via email to