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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-03
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-03 
13:17:27 UTC ---
Confirmed, that's a bug.

It works if the array bound is given explicitly:

   const int arr[sizeof...(Args)] = {args...};


Reduced:

template<typename A, typename B>
  struct is_same { static const bool value = false; };

template<typename A>
  struct is_same<A, A> { static const bool value = true; };

template<typename... Args>
void func(Args... args) {
  int arr[] = {args...};
  static_assert(is_same<decltype(arr), int[sizeof...(Args)]>::value,
                "complete type");
}

int main() {
   func(1,2,3,4);
}


for.cc: In instantiation of 'void func(Args ...) [with Args = {int, int, int,
int}]':
for.cc:15:16:   required from here
for.cc:10:3: error: static assertion failed: complete type
   static_assert(is_same<decltype(arr), int[sizeof...(Args)]>::value,
   ^

Reply via email to