Commit 863878b2 by Jason Merrill

x

From-SVN: r21655
parent 77d7c64b
// Test for default-initialization of POD-structs in functional cast notation.
struct foo { int a[10]; };
int main()
{
foo f = foo();
int r = 0;
for (int i = 0; i < 10; ++i)
r |= f.a[i];
return r;
}
// Build don't link: // Build don't link:
typedef unsigned int size_t; typedef __SIZE_TYPE__ size_t;
inline void * inline void *
operator new(size_t alloc_sz, const char *fname, unsigned lineno) operator new(size_t alloc_sz, const char *fname, unsigned lineno)
{ {
......
//Build don't link: //Build don't link:
typedef unsigned int size_t; typedef __SIZE_TYPE__ size_t;
void *operator new(size_t, unsigned int); void *operator new(size_t, unsigned int);
struct X{ struct X{
......
// Build don't link: // Build don't link:
#include<iostream.h> #include<iostream.h>
#include<stddef.h>
struct A { struct A {
A() { A() {
cerr<<"A constructing\n"; cerr<<"A constructing\n";
throw 1; throw 1;
} }
void *operator new(unsigned sz) { void *operator new(size_t sz) {
cerr<<"A allocated\n"; cerr<<"A allocated\n";
return ::operator new(sz); return ::operator new(sz);
} }
......
// Build don't link: // Build don't link:
typedef unsigned int size_t; typedef __SIZE_TYPE__ size_t;
inline void *operator new(size_t, void *place) throw() { return place; } inline void *operator new(size_t, void *place) throw() { return place; }
struct A struct A
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment