view gcc/testsuite/g++.dg/cpp0x/variadic-new.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do run { target c++11 } }
// Contributed by Peter Dimov
// PR c++/32597
#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 );
}