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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, the unexpanded packs are diagnosed now:

f.cc:17:23: error: parameter packs not expanded with ‘...’:
            typename = SameSize<B>>
                       ^
f.cc:17:23: note:         ‘B’
f.cc:21:63: error: parameter packs not expanded with ‘...’:
            typename = typename enable_if<SameSize<B>::value>::type>
                                                               ^
f.cc:21:63: note:         ‘B’

And the constructors are not viable, so fixed.


Oddly, if I fixed the error in the original testcase (so trunk accepts it) then
both clang and EDG reject it, but I think they're wrong:

template<bool B>
struct bool_constant
{
  static const bool value = B;
};

template<bool> struct enable_if { };
template<> struct enable_if<true> { typedef void type; };

template<typename... A>
struct F
{
  template<typename... B>
    using SameSize = bool_constant<sizeof...(A) == sizeof...(B)>;

  template<typename... B,
           typename = typename enable_if<SameSize<B...>::value>::type>
  F(B...) { }
};

int main()
{
  F<int, int> f2(2, 3);
}

Reply via email to