[Bug c++/69958] sizeof... computes wrong size

2016-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #5 from Jason Merrill  ---
Fixed for GCC 6.

[Bug c++/69958] sizeof... computes wrong size

2016-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Fri Feb 26 19:54:33 2016
New Revision: 233758

URL: https://gcc.gnu.org/viewcvs?rev=233758=gcc=rev
Log:
PR c++/69958
* pt.c (make_argument_pack): New.
(tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
(tsubst_copy_and_build): Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-sizeof4.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-sizeof4a.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/69958] sizeof... computes wrong size

2016-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-02-26
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug c++/69958] sizeof... computes wrong size

2016-02-26 Thread yanikibo at yandex dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

--- Comment #3 from Ibrahim Gokhan YANIKLAR  ---
*** Bug 69978 has been marked as a duplicate of this bug. ***

[Bug c++/69958] sizeof... computes wrong size

2016-02-26 Thread yanikibo at yandex dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

Ibrahim Gokhan YANIKLAR  changed:

   What|Removed |Added

 CC||yanikibo at yandex dot com

--- Comment #2 from Ibrahim Gokhan YANIKLAR  ---
#include 

template < std::size_t N >
struct A {  enum : std::size_t {  value = N  };  };

template < class... TL >
using B = A< sizeof...(TL) >;

template < class T >
struct C {  using type = T;  };

template < class... TL >
using D = typename C< B >::type;

template < class T, class U, class... TL >
void foo( T, U, TL... )
{
std::cout << (B::value) << std::endl;
std::cout << (D::value) << std::endl;
std::cout << (C< B >::type::value) << std::endl;
}

int main()
{
foo(10, 20, 30, 40, 50);
}

//---
// output(g++4.7):
//---
// 3
// 3
// 3

//---
// output(g++4.8-g++5.3):
//---
// 5
// 5
// 3

//---
// output(correct)
//---
// 5
// 5
// 5

[Bug c++/69958] sizeof... computes wrong size

2016-02-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69958

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Trunk also fails the two static assertions, clang++ 3.8 accepts it.