The following program fails because when the new-expression is instantiated
with no arguments in "args", k is not value-initialized (although it should
be).
#include <assert.h>
#include <new>
int k = 5;
template< class... Args > void f( Args... args )
{
new( &k ) int( args... );
}
int main()
{
f();
assert( k == 0 );
}
--
Summary: New operation with empty parameter pack does not value-
initialize
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: dgregor at gcc dot gnu dot org
ReportedBy: dgregor at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32597