http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51314

             Bug #: 51314
           Summary: sizeof... and parentheses
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: marc.gli...@normalesup.org


Hello,

in some cases, g++ accepts sizeof...U (without parentheses) and in some other
cases it doesn't. I was going to report the case where it doesn't as a bug, but
after a look at the standard, it looks like it should always require the
parentheses. Well, I am not so sure, so here is one example of each:

template<int>struct A{};
template<class...U>void f(U...){
    A<sizeof...U> x; // template argument 1 is invalid
}


template<int...> struct Indices;
template<class> struct Next_increasing_indices;
template<int...I> struct Next_increasing_indices<Indices<I...> > {
    typedef Indices<I...,sizeof...I> type; // OK
};

Reply via email to