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

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang accepts the reduced testcase in comment #1 but MSVC and ICC both reject
it too.

MSVC:

<source>(18): error C3201: the template parameter list for class template 'Foo'
does not match the template parameter list for template parameter 'TT'
<source>(18): error C2955: 'is_instantiation_of_nontypes<bool,char>::check':
use of class template requires template argument list
<source>(12): note: see declaration of
'is_instantiation_of_nontypes<bool,char>::check'
<source>(18): error C2338: Ouch

ICC:
<source>(11): error: parameter pack "Ts" was referenced but not expanded
    template<template<Ts...> class TT, typename T>
                      ^

<source>(14): error: parameter pack "Ts" was referenced but not expanded
    template<template<Ts...> class TT, Ts... Args>
                      ^

<source>(14): warning #885: constant "Args" is not used in or cannot be deduced
from the template argument list of class template
"is_instantiation_of_nontypes<Ts...>::check<TT, TT<Args...>> [with Ts=<bool,
char>]"
    template<template<Ts...> class TT, Ts... Args>
                                             ^
          detected during instantiation of class
"is_instantiation_of_nontypes<Ts...> [with Ts=<bool, char>]" at line 18

<source>(18): error: static assertion failed with "Ouch"
  static_assert(is_instantiation_of_nontypes<bool, char>::check<Foo, Foo<false,
'x'> >::value, "Ouch");
  ^


GCC rejects it with:
<source>:15:27: error: expansion pattern '<anonymous>' contains no parameter
packs
   15 |   struct check<TT, TT<Args...>> : true_type {};
      |                           ^~~
<source>:15:30: error: template argument 2 is invalid
   15 |   struct check<TT, TT<Args...>> : true_type {};
      |                              ^~
<source>:18:87: error: static assertion failed: Ouch
   18 | static_assert(is_instantiation_of_nontypes<bool, char>::check<Foo,
Foo<false, 'x'> >::value, "Ouch");
      |              
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Reply via email to