plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
chromium
cleanup1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/cleanup1.C
304
utf_8
0f1ff9d8ddbbe6eb6b3651aa40fa79db
// PR c++/13033 // We failed to treat the for increment expression as a full-expression, // which broke gimplification. struct QDomNode { virtual ~QDomNode(); QDomNode nextSibling() const; bool isNull() const; }; void processNode(QDomNode n) { for (; !n.isNull(); n = n.nextSibling()) ; }
google
chromium
struct3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/struct3.C
344
utf_8
22d61e3cdadcbb46755a2e1556954646
/* PR c++/23180. */ /* Initialize a global variable with an expression that attempts to use pointer arithmetic to calculate a structure field offset. */ struct Track { char soundName[15]; }; struct SaveLoadEntry { int offs; int type; int size; }; int foobar = ((long) (__SIZE_TYPE__) (& ((Track *) 42...
google
chromium
struct2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/struct2.C
526
utf_8
4659e4a9f0e209d3efc6a3da61e47a06
/* PR c++/23180. */ /* Initialize a local structure with an expression that attempts to use pointer arithmetic to calculate another structure field offset. */ void saveLoadEntries(const void *); void saveOrLoad() { struct Track { char soundName[15]; }; struct SaveLoadEntry { int offs;...
google
chromium
error2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/error2.C
264
utf_8
9b24982701f589ac53a7c39f92edbce6
/* PR c++/29727 */ /* { dg-do "compile" } */ template<int> struct A { static int a[1]; }; template<int N> int A<N>::a[1] = { X:0 }; /* { dg-error "does not allow designated|was not declared|designated initializer for an array" } */ void foo() { A<0>::a; }
google
chromium
byval1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/byval1.C
323
utf_8
8878c87dba0d0dc5af8198636c9944bc
// PR c++/3948 // Test that the destructor call for a value parameter gets the // right address. // { dg-do run } void *p[2]; int i; int r; struct C { int m; C() { p[i++] = this; } ~C() { if (p[--i] != this) r = 1; } }; void Foo (C c) { p[i++] = &c; } int main () { C c; return r; }
google
chromium
self1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/self1.C
199
utf_8
2ce501fe71f97375e159963b826b5f70
// PR c++/29106 // { dg-do run } int i; void f(__SIZE_TYPE__) { i = 3; } int main() { int* const savepos = sizeof(*savepos) ? 0 : 0; f (sizeof (*savepos)); if (i != 3) return 1; }
google
chromium
array14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array14.C
283
utf_8
46ee7376992213a7ad7da95e9c59931d
// PR c++/12883 // Bug: Destructor of array object not called if no prior // instantiation of the template has happened. // { dg-do run } int ret = 1; template <int> struct X { X(int) { } ~X() { ret = 0; } }; int main() { { X<0> array[] = { 0 }; } return ret; }
google
chromium
inline1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/inline1.C
116
utf_8
41d2d4e5be3c0a2a40a1924f14ac4448
// PR c++/9167 // { dg-options "-finline" } struct A { ~A(); A f(A) { } }; void f(void) { A a; a.f(a); }
google
chromium
synth1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/synth1.C
135
utf_8
ab02e565927ee50b37c774159922e9d9
// PR middle-end/17525 struct A { ~A(); int a; }; struct B : public A { virtual ~B(); }; void run (B& b, B& b1) { b1 = b; }
google
chromium
array19
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array19.C
89
utf_8
db737c897b3b257dcc015a0f7ff35dcc
// { dg-do compile } // { dg-options "" } double a[0] = { }; const double b[0][1] = { };
google
chromium
pm2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/pm2.C
60
utf_8
49c02c7ea8ff817fb850567f5e9bb9d8
struct S { S (); int S::* sp; int i; }; S s[2] = {};
google
chromium
new2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new2.C
255
utf_8
7502916c49c92544e10e7a1d3ce41eea
// { dg-do compile } class bar { public : bar() { } void * operator new ( __SIZE_TYPE__ , void * storage ) { return (void *)1;} }; class foo { public: void mem ( ) { new ( 0 ) bar; } };
google
chromium
new11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new11.C
361
utf_8
6f47ea3d49aa99edd7c65d0f6c52bdf3
// PR c++/17670 // { dg-do run } #include <cstdlib> #include <new> bool abort_new; void *operator new[](size_t bytes) throw (std::bad_alloc) { if (abort_new) abort(); return operator new (bytes); } struct X {}; int main () { // Do not abort until main is running in case startup code uses // operator...
google
chromium
brace5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/brace5.C
122
utf_8
c67cb693c501dfa41dcf719d6d7498f1
// PR c++/27491 // { dg-do compile } // { dg-options "" } int i = (int) { 0 }; int j = (int) { i }; int k = (int) { k };
google
chromium
copy6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy6.C
126
utf_8
5d48182e8fa2907f420bf1ef3d67dba3
// PR c++/11878 struct A { virtual ~A(); }; template<typename T> struct B { T t; }; void foo() { throw B<A>().t; }
google
chromium
new4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new4.C
25
utf_8
19dcda79922ea7017c7e260394e77415
int *x = new int [2] ();
google
chromium
ptrmem3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrmem3.C
134
utf_8
0b090bd78ae8ce905e99bc82ec692b95
// PR c++/28148 struct foo { public: virtual int bar(int); }; void (foo::*__Virtual__foo__Var1)() = (void (foo::*)())(&foo::bar);
google
chromium
save1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/save1.C
236
utf_8
7d8b7ff14410173fd3e1cb0594f72583
// PR c++/8748 // We were wrapping the ARRAY_REF in a SAVE_EXPR, causing us to try to make a bitwise // copy of b[0]. struct A { int i; }; struct B : A { virtual ~B(); }; struct C { B b[1]; }; void foo() { C().b[0].i; }
google
chromium
copy4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy4.C
413
utf_8
28ced8869a7baac26a49e3084bf7d851
// PR c++/9342 // into the reference temp used a bitwise copy. struct QString { QString( const QString & ); QString &operator=( const QString & ); }; struct ServerSettings { QString user; }; extern ServerSettings def(); extern void arg( const QString& a ); void startSession( bool b, QString s ) { arg (b...
google
chromium
reference3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/reference3.C
312
utf_8
c27864857ab3e5f1e467c5292e7069c7
// { dg-do compile } // This code used to be accepted but it is invalid as there is no // value initialization of a reference type. // PR c++/36695 template <typename T> T f() { T a = T(); // { dg-error "value-initialization of reference" } } int &a = f<int&>(); // { dg-message "instantiated from here" }
google
chromium
copy2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy2.C
71
utf_8
c268699333b239c371d1bdc906ea54ad
// { dg-do compile } struct S { S (); }; volatile S s[1] = { S () };
google
chromium
pm3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/pm3.C
175
utf_8
b8f980c062ec4b3f73dffbda8276ec70
// PR c++/12218 // { dg-do run } struct C { int i, j; }; typedef int C::*mPtr; extern const mPtr should_be_0 = &C::i; extern const mPtr should_be_4 = &C::j; int main () { }
google
chromium
static2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/static2.C
273
utf_8
5790ab7ca9ca7303a8c59f3dbcb9058e
// PR 14804 // { dg-do run } struct A { virtual void foo() = 0; }; struct B : public A { virtual void bar() = 0; }; typedef void (A::*mfptr)(); struct D { mfptr p; }; static const D ds[] = { { reinterpret_cast<mfptr>(&B::bar) }, }; int main() { return 0; }
google
chromium
array22
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array22.C
142
utf_8
7f0b825cc0a026b71572eb45075bdc8a
// PR C++/29002 // We ICE trying to set the "zero" initializer on the incomplete // array struct A {}; int A::* x[]; // { dg-error "size" }
google
chromium
static3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/static3.C
258
utf_8
004975a4245800f0c34b34b9565fc427
// { dg-do run } struct T { static void (*handler)(); static void func() {} }; bool fail; struct S { S() { if (T::handler != T::func) fail = true; } }; static S s; void (*T::handler)() = func; int main() { if (fail) return 1; }
google
chromium
switch1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/switch1.C
118
utf_8
fb4e7d34dd521424475c02bd1379d218
int f(int c) { { case d: /* { dg-error "'d' was not declared" } */ int optBzip2 = true; } }
google
chromium
new15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new15.C
214
utf_8
22333fe39f0bec9273096c8bd851c7c4
// PR c++/9782 extern "C" void printf(const char*, ...); template <int> struct A { A() {printf("A::A()\n");} }; struct B { B() {printf("B::B()\n");} }; int main () { new A<0>[1][1]; new B [1][1]; }
google
chromium
array7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array7.C
154
utf_8
02cf876b0b0d2594118addc046b9112a
struct S { virtual void v () {} void f (const float g[3]); float h[3]; }; void g () { S s1, s2; s1 = s2; } void S::f (const float g[3]) {}
google
chromium
float1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/float1.C
224
utf_8
265ea5015e9eb7de8e1c6503d956e086
// PR c++/21089 // { dg-do run } extern "C" void abort(); static const double a = 1.0; struct S { S(); }; static S s; static const double b = a + 1.0; S::S() { if (b < 1.9 || b > 2.1) abort (); } int main () { }
google
chromium
dso_handle1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/dso_handle1.C
231
utf_8
b34354a9fccb98f99f3ac0bc14d8f157
// PR c++/17042 // { dg-do assemble } /* { dg-require-weak "" } */ // { dg-options "-fuse-cxa-atexit" } struct A { A(); ~A(); }; A a; extern "C" { void* __dso_handle __attribute__ ((__weak__)); } void f() { __dso_handle = 0; }
google
chromium
static-init2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/static-init2.C
80
utf_8
c0a507cb8b6bf9a5448427e537d93531
// PR c++/36912 // { dg-options -frounding-math } const double c = .1, d = c+1;
google
chromium
union2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/union2.C
195
utf_8
a2a29bef6924e38f49965c48ff606491
// PR c++/15938 // { dg-do compile } // { dg-options "" } typedef union { struct { int i; }; struct { char c; }; } A; A a = { 0 }; A b = {{ 0 }}; A c = {{{ 0 }}}; // { dg-error "braces" }
google
chromium
const5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const5.C
267
utf_8
d20e9e92d2904deda74fbcf84cb823bb
// PR c++/31449 class Foo {}; class Bar : public Foo {}; static const Foo *foo = 0; static Bar *bar = static_cast<const Bar*>(foo); // { dg-error "conversion" } void func(const Foo *foo) { Bar *bar = static_cast<const Bar*>(foo); // { dg-error "conversion" } }
google
chromium
null1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/null1.C
74
utf_8
554f34a22cd100ecfb39b5c4ab32947f
// PR c++/16489 const int NULL = 0; int main() { double* p = NULL; }
google
chromium
dtor3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/dtor3.C
187
utf_8
5f5e01bbe7cb4844fd36654728665aa4
// PR c++/17976 // { dg-do run } extern "C" void abort(); struct A { static int i; A(){} ~A(){i++;if(i>1)abort();} }; int A::i = 0; A a; extern A a; int main() { return 0; }
google
chromium
ptrfn2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrfn2.C
290
utf_8
c3eaccdcf8e35f944dee4d4b3d720336
// { dg-options "" } // { dg-do compile } // C++/30221 // We would ICE while trying to reshape the pointer to // member function element which is not needed. class abstract {}; typedef void (abstract::*fptr1) (short & s ) const; struct s {}; s array[] = { (fptr1)0 };// { dg-error "" }
google
chromium
const3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const3.C
119
utf_8
88f5c7af426aec933b525e2bb17b1b0d
// { dg-do run } struct S { static const int i = 3; }; const int S::i; int main () { if (!S::i) return 1; }
google
chromium
new26
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new26.C
584
utf_8
d20a83f8968c6c9a1d648762dc1a9e2c
// PR c++/33407 // { dg-do run } // { dg-options "-O2 -fstrict-aliasing" } extern "C" void * malloc(__SIZE_TYPE__); extern "C" void abort(void); void *p; void __attribute__((noinline)) init(void) { p = malloc(4); } inline void *operator new(__SIZE_TYPE__) { return p; } inline void operator delete (void*) {} in...
google
chromium
array8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array8.C
99
utf_8
4ab5bb9dc38b78d749ba584adefbdc33
struct A { A (); }; struct B { A a1; A a2; }; A a; struct B b[] = { { a, a }, { a, a } };
google
chromium
goto1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/goto1.C
229
utf_8
a2c1054568281f6408f992ee29e5680b
// PR c++/14724 // { dg-do run } int j; template <class T> struct C { C() { ++j; } ~C() { --j; } }; int main(int, char **) { { int i = 0; again: C<int> v; if (++i < 10) goto again; } return j; }
google
chromium
copy1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy1.C
195
utf_8
641df0a856e9b4cd6a3fe6823eda796c
// { dg-do compile } class A { public: A(){} A( const A& a ){} }; class B : public A { public: B( int& s) : s_(s){} int& s_; }; int main() { int i; B x1( i ); B x2( x1 ); }
google
chromium
complex1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/complex1.C
136
utf_8
0f7623c102a38caadf3ad160abd647cf
/* PR c++/21210 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ typedef float __complex__ fcomplex; fcomplex cplx = fcomplex();
google
chromium
call1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/call1.C
482
utf_8
37e3aaafda06e7a49338706d936ff70f
// Bug c++/16115 // { dg-options "-O2" } extern "C" void abort(); int count = 0; struct T { T() { count++; } T(const T&) { count++; } ~T() { if (count==0) abort(); --count; } }; struct auto_ptr { T* p; auto_ptr(T* __p) : p(__p) { } ~auto_ptr() { delete p; } T* release()...
google
chromium
vector1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/vector1.C
1,134
utf_8
75fa012514803aa0a98113ff8b7474c6
// PR c++/19263 // { dg-do run } // { dg-options "-O2" } typedef signed char v8qi __attribute__ ((vector_size (8))); extern "C" void abort (void); static unsigned char S[16]; struct A { int i; v8qi j, k; int l; }; void foo (unsigned char v) { A a = { 1, { v, v, v, v, v, v, v, v }, { v + 1, v + 1, v + 1,...
google
chromium
for2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/for2.C
172
utf_8
01eca483f7382cb5c35dcad5558f08b1
// { dg-do compile } // PR 16012: Got the scope of I incorrect in templates only. template<int> void foo() { for (int i=0 ;;) ; int i; } void bar() { foo<0>(); }
google
chromium
ctor4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor4.C
242
utf_8
ff7a81aa376295e56434c493a0738c40
// PR c++/17788 // { dg-do compile } class foo { public: foo(); }; class bar: public foo {// { dg-error "uninitialized" } private: int &a; }; foo::foo() { } int main(int argc, char **argv) { bar x; // { dg-message "synthesized" } }
google
chromium
ptrmem4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrmem4.C
159
utf_8
a044d5ddcfc1b75d76300d577f3b92fb
// PR c++/32245 // { dg-do run } struct foo { int mem1; int foo::* mem2; }; int main () { foo x = { 0 } ; if (x.mem2 != foo().mem2) return 1; }
google
chromium
ref8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref8.C
167
utf_8
7d3e4afff4fce557d4ee66f8d865c7d9
struct A { A operator=(const A&); }; A operator*(A, A); A& operator+=(A& a, const A& b) { return a = a * b; // { dg-error "non-const reference" } }
google
chromium
struct1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/struct1.C
105
utf_8
58b4c5838fafdec40fe718447129945f
struct bug { const char *name; __SIZE_TYPE__ type; }; struct bug s = { 0, (__SIZE_TYPE__) &s | 1 };
google
chromium
array15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array15.C
715
utf_8
4b343cab41b920a5cd17c596fa24cc6f
// { dg-do run } struct foo { unsigned char buffer[4111222]; foo() ; bool check () const; }; foo::foo () : buffer() {} bool foo::check () const { for (unsigned ix = sizeof (buffer); ix--;) if (buffer[ix]) return false; return true; } void *operator new (__SIZE_TYPE__ size, void *p) { return p; }...
google
chromium
new13
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new13.C
272
utf_8
894f537f7b2366df913696980df633b8
// PR c++/22508 // ICE on invalid operator new // { dg-do compile } struct A { void* operator new(__SIZE_TYPE__) throw(X); // { dg-error "" } }; A* p = new A; // { dg-error "no suitable" }
google
chromium
array3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array3.C
373
utf_8
0212d2961b78684e39260cc7bf7ae66a
// PR c++/6331 // Bug: we were generating a badly cv-qualified ARRAY_TYPE in the // synthesized copy constructor for A, which then became the canonical // version, confusing later uses. struct A { virtual ~A(); const float* f(); float fa[3]; }; struct B { B(const A& ai) : a (ai) {} A a; }; void g (const fl...
google
chromium
union1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/union1.C
59
utf_8
a94d2ff7c7a43d0764a116004fa30738
// PR c++/14401 union U { int& i; // { dg-error "" } };
google
chromium
array4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array4.C
429
utf_8
dafd4fb071c88ff21250002b43675816
// { dg-do compile } // PR c++/6944 // Fail to synthesize copy constructor of multi-dimensional // array of class. #include <string> class Array { public: std::string m_array[10][20][30]; }; Array func() { Array result; return result; // sorry, not implemented: cannot initialize multi-dimensional array with in...
google
chromium
new24
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new24.C
402
utf_8
55a9e7ab7780295582670cb7aa2e312f
// PR c++/33025 // { dg-do compile } // { dg-options "-O2" } typedef __SIZE_TYPE__ size_t; inline void *operator new (size_t, void *p) throw () { return p; } extern "C" void abort (); int main() { const unsigned num = 10; unsigned *data = new unsigned[num]; unsigned *ptr = new (data) unsigned (num); static un...
google
chromium
new10
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new10.C
143
utf_8
99032474a76d34492ef006f7c9ae5a81
// PR c++/14452 // We got confused trying to preevaluate the new-initializer. struct S {}; void foo (bool b) { new S(b ? S() : S()); }
google
chromium
value1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value1.C
257
utf_8
3b22bec2d49caa4a26b00f16c19566a8
// Test that with value-initialization, i is initialized to 0 // and the vtable pointer is properly initialized. // { dg-do run } struct A { int i; virtual void f() {} }; void f (A& a) { a.f(); } int main() { A a = A(); f (a); return a.i; }
google
chromium
new14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new14.C
94
utf_8
f61f4940bc97502688606d4b7f1701a2
// PR c++/23491 struct X { int m; }; void f(int n) { const X *p = new const X[1] () ; }
google
chromium
new22
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new22.C
96
utf_8
f7a95da9dc93980c45559b153a887a60
// PR c++/29001 void* operator new (__SIZE_TYPE__) { return; } // { dg-error "with no value" }
google
chromium
aggr3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/aggr3.C
171
utf_8
9f0814e4f47903c340ece647e3a040fa
// PR c++/18793 struct S { S(); S(const S&); void operator=(const S&); }; struct X { int a, b, c, d, e; S s; }; void foobar () { X x = {0}; }
google
chromium
static-init1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/static-init1.C
179
utf_8
3590ad5754f93f2ab00974878ace368e
// Related to the patch for 38880. // Make sure we don't think we can initialize a at compile time. char c; short a[] = { (short)((__PTRDIFF_TYPE__)&c + (__PTRDIFF_TYPE__)&c) };
google
chromium
const1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const1.C
84
utf_8
188aaf9a14e14dfb97cecb6f71b0dd05
// PR c++/20073 template<int> struct A { A(); }; const A<0> x[] = { A<0>() };
google
chromium
array24
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array24.C
126
utf_8
9dbada1a8b5a452dce60326488f1fcc8
// PR c++/29175 // { dg-options "" } void foo(int i) { int x[][i] = { 0 }; // { dg-error "variable-sized|storage size" } }
google
chromium
ref15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref15.C
500
utf_8
feb646ad2c57d80d5e3b523837e1af84
// PR c++/20416. We correctly constructed the temporary S in foo(), // but incorrectly destroyed it every time foo() was called. // { dg-do run } extern "C" void abort (void); extern "C" void _exit (int); int c, exiting; struct S { S() { ++c; } S(const S &) { ++c; } ~S() { if (!exiting) abort (); _exi...
google
chromium
ref4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref4.C
245
utf_8
f21f65304dbc9a97b63efafb7bb1a6df
// { dg-do run } int c; struct Base { Base() {} Base(const Base &) { ++c; } Base & operator = (const Base &); }; struct Derived : public Base {}; const Base &b = Derived(); int main() { return c; // No copies should be required. }
google
chromium
value4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value4.C
561
utf_8
90318580a1a76223ffd321c5049365e7
// PR c++/38233 template<class _T1, class _T2> struct pair { _T1 first; _T2 second; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 265. std::pair::pair() effects overly restrictive * respective default constructors. */ pair() : first(), second() { } }; class a { public: a(); }; class b { pub...
google
chromium
ref2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref2.C
172
utf_8
753ffddceb5ce125cebb945a65a73cdf
struct Base { Base(); Base(const Base &); Base & operator = (const Base &); }; struct Derived : public Base {}; Derived derived(); const Base &b = derived();
google
chromium
ref11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref11.C
125
utf_8
d0d8fbd7155549c25221fd9539a9ffc5
// PR c++/14230 struct A { A (); A (const A&); A& operator= (const A&); }; struct D { A a; }; const A& z = D().a;
google
chromium
new23
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new23.C
452
utf_8
c6bfe3c407b3ca0eac5cfe23b9a35d23
// PR c++/33025 // { dg-do run } // { dg-options "-O2" } typedef __SIZE_TYPE__ size_t; inline void *operator new (size_t, void *p) throw () { return p; } extern "C" void abort (); int main() { const unsigned num = 10; unsigned *data = new unsigned[2 * num]; unsigned *ptr = data; for (unsigned i = 0; i < 2 * n...
google
chromium
ctor2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor2.C
515
utf_8
c92e60dfdc4e6ad1fcc8d9290be36f5f
// { dg-do run } // PR 9629. The vtable is not set up until the base initializers have // run. struct A { static A *a; A (); }; A *A::a; A::A () {a = this;} struct B { static A *a; B (A *); }; A *B::a; B::B(A *a_) {a = a_;} struct C : virtual public A, public B { C(); }; C::C () : B(this) {} struct D : virtua...
google
chromium
new27
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new27.C
570
utf_8
d5a5bcf8bba7f46ab8feba49e73be0f0
// PR c++/34862 // { dg-do run } // { dg-options "-O2" } typedef __SIZE_TYPE__ size_t; extern "C" void abort (); struct T { void *operator new (size_t, char *&); T () { i[0] = 1; i[1] = 2; } int i[2]; }; void * T::operator new (size_t size, char *&p) { void *o = (void *) p; p += size; return o; } T * f ...
google
chromium
volatile1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/volatile1.C
267
utf_8
6a507132cbee807fabd3c9dfd0f81093
// PR c++/26577 // The call to bar() was causing an inappropriate dereference of *this, // which led to an abort in cp_expr_size. struct A { A(const A&); A& operator=(const A&); static void bar(); void baz() volatile; }; void A::baz() volatile { bar(); }
google
chromium
array0
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array0.C
222
utf_8
73cffa4fc460568d6244b242fb867fb5
// { dg-do compile } // { dg-options "" } // PR C++/24138 void foo() { typedef struct { unsigned char dir; int data[0]; } yanito; static const yanito horse = { 1, { 2, 3 } }; // { dg-error "too many" } }
google
chromium
new3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new3.C
142
utf_8
2326f60a4e882ff67a8dd2802f7a0b8b
// Test that new-expressions at file scope work properly. struct A { static char* p; }; int i = 1; char* A::p = new char[i]; void foo() {}
google
chromium
ctor3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor3.C
74
utf_8
5922ec5514343fd09b90bff2a9853e0d
// PR c++/14401 struct S { S() {} // { dg-error "" } const int i; };
google
chromium
init-ref2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/init-ref2.C
573
utf_8
c2e29d2071e0ec0563f5e74c45da4ecd
// Test for proper handling of local static references. // { dg-do run } int r; int c; int f () { // Test that we only initialize i once. if (++c > 1) ++r; return 42; } const int *p; void g () { static const int &i = f(); // Test that i points to the same place in both calls. if (p && p != &i) ++r; ...
google
chromium
cleanup3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/cleanup3.C
394
utf_8
509f15d49c50b3d63a59c36aae604afa
// Check that on targets with "__cxa_atexit" we use destructors, // rather than cleanup functions, to destroy objects with static // storage duration. // { dg-require-effective-target "cxa_atexit" } // Cleanup functions generated by G++ have the "_tcf" prefix. // { dg-final { scan-assembler-not "_tcf" } } struct S { ...
google
chromium
goto2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/goto2.C
170
utf_8
e00c10f6c51c0fe0e298cd7214a51a46
// PR c++/20721 bool f(); void g(int i) { if (i) goto bad; // { dg-error "from" } bool a = f(); // { dg-error "initialization" } bad: // { dg-error "jump" } ; }
google
chromium
ref1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref1.C
52
utf_8
1b51fdd73c1758c6564cee1de0ae7aff
void f(void) { short x = 0; const int &y = x; }
google
chromium
array11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array11.C
507
utf_8
277d5eaa0119e28a1c7aaa014f13a7c9
/* PR 11665 The problem was in initializer_constant_valid_p, "for a CONSTRUCTOR, only the last element of the CONSTRUCTOR was being checked" (from the email of the patch which fixed this). This used to ICE because GCC thought gdt_table was a constant value when it is not. */ int x; typedef __SIZ...
google
chromium
ref17
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref17.C
253
utf_8
61cc30ef4dd5f1a079dafd8b1d39caea
// PR c++/35650 // { dg-do compile } void f1 (); namespace N { using::f1; void f2 (); void f3 (); } using N::f3; void test () { void (&a) () = f1; void (&b) () = N::f1; void (&c) () = N::f2; void (&d) () = f3; void (&e) () = ::f3; }
google
chromium
init-ref1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/init-ref1.C
553
utf_8
61b6e6a5b24a1cf0c1d82d1bad6d7600
// Test case for GNATS bug 787. // { dg-do run } #include <stdio.h> #include <stdlib.h> static int calls; int &foo (int &arg) { calls++; arg=0; return arg; } int &identity (int &x) { return x; } int main() { int a; calls = 0; int &b = ++foo (a); if (calls > 1) abort (); if (&a != &b) abort ();...
google
chromium
const7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const7.C
356
utf_8
f694cbd4095c7b8994036f80614d6f8b
// { dg-do compile } // { dg-options "-fdump-tree-gimple" } struct s { int x, y; }; short offsets[1] = { ((char*) &(((struct s*)16)->y) - (char *)16), }; // This ensures that we get a dump whether or not the bug is present. void fn() { } // { dg-final { scan-tree-dump-not "initialization" "gimple" } } // { dg-fin...
google
chromium
array21
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array21.C
83
utf_8
29350f6365c2db72182d063771d0bc06
// PR c++/27722 void foo() { const int x[] = 0; // { dg-error "size" } ++x; }
google
chromium
ref5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref5.C
126
utf_8
e7fdc3fa73fd7411222a32862636796b
struct A { }; struct B : public A { }; struct X { operator B(); }; X x; int main() { const A& r = x; return 0; }
google
chromium
reference2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/reference2.C
339
utf_8
0960bd0fd309b441dfe952c9d328620e
// { dg-do compile } // This code used to be accepted but it is invalid as there is no // value initialization of a reference type. // PR c++/36695 // We should we able to diagnostic this without instantiating the template template <int a1> int f() { typedef int& T; T a = T(); // { dg-error "value-initialization ...
google
chromium
ref7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref7.C
93
utf_8
c83b7aed233d6150603f6551e858ddf3
class hop { public: hop operator* () const; }; int main(void) { const hop &x = *x; }
google
chromium
value6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value6.C
96
utf_8
ca385abd9d6b36d0667c2ad521a0233e
// PR c++/39109 struct N { private: virtual ~N (); }; N * foo () { return new N (); }
google
chromium
copy7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy7.C
344
utf_8
2cc24a78ed1faef56f750718ff083f29
// PR c++/39480 // It isn't always safe to call memcpy with identical arguments. // { dg-do run } extern "C" void abort(); extern "C" void * memcpy(void *dest, void *src, __SIZE_TYPE__ n) { abort(); } struct A { double d[10]; }; struct B: public A { char bc; }; B b; void f(B *a1, B* a2) { *a1 = *a2; } int...
google
chromium
array2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array2.C
218
utf_8
fa5767203bb04480dc89d15d55d04ad1
// Check that the type of an array is set correctly when flat initializers // are used. // { dg-do compile } struct s { int a; int b; }; struct s x[] = { 1, 2, 3, 4 }; int y[sizeof (x) == 2 * sizeof (x[0])? 1 : -1];
google
chromium
placement3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/placement3.C
384
utf_8
61be8418b83a05d14bee83b0c4c26ff7
typedef __SIZE_TYPE__ size_t; extern "C" void *malloc (size_t); int i; struct S { S(int) { throw 3; } void *operator new(size_t s, int) { ++i; return malloc (s); } void operator delete(void *, int) { --i; } void operator delete(void *, int, int) ; }; int main () { try { new...
google
chromium
placement1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/placement1.C
255
utf_8
ef95eb29955e54a2310be36a0828b0cb
// PR c++/11266 // We were expanding the same TARGET_EXPR twice, for placement new and // delete. void* operator new (__SIZE_TYPE__, void*) throw(); void operator delete (void*, void*) throw(); struct A { A(); }; void foo() { new(new A)A; }
google
chromium
bitfield1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/bitfield1.C
370
utf_8
f3383f08918eed93161c080f618e55e8
// Check that we handle bitfields as complex lvalues properly. struct A { int i: 2; int j: 2; int k: 2; }; A a, a2; bool b; void f (); int main () { (f(), a.j) = 1; (f(), a).j = 2; // { dg-warning "overflow" } (b ? a.j : a2.k) = 3; // { dg-warning "overflow" } (b ? a : a2).j = 0; ++(a.j) = 1; (a....
google
chromium
elide1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/elide1.C
1,072
utf_8
fb8a48266ab2a995a88943828c7a824f
// { dg-do run } // Test that the destructor for a temporary passed by value isn't run // until end of full-expression, as per [class.copy]: // Whenever a temporary class object is copied using a copy constructor, // and this object and the copy have the same cv-unqualified type, an // implementation is permitte...
google
chromium
array20
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array20.C
77
utf_8
05bc363be69870e155aaf88f43671076
// PR c++/27385 struct A {}; A a[] = { 0 }; // { dg-error "initializer" }
google
chromium
array5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array5.C
720
utf_8
0f2710d39e547bff2dfc21c51a8173ff
// { dg-do run } // Incorrect construction and destruction of multi-dimensional // array of class. extern "C" void abort(); extern "C" int printf(const char *, ...); int count; int num; struct A { A() { if (count == num) throw ""; count++; #ifdef PRINT printf("ctor %p\n", static_cast<void *>(this)); #endif ...
google
chromium
dtor1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/dtor1.C
517
utf_8
0282b33cfb0b201499908c95a2e9b57d
// { dg-do run } extern "C" void abort (); int d = 5; struct B { int x; B (int i) : x (i) { } ~B () { if (d-- != x) abort (); } }; struct C1 : public B { C1 (int i) : B (i) {} }; struct C2 : public B { C2 (int i) : B (i) {} }; struct D : public B { D (int i) : B (i) {} }; struct E : public B { E (i...
google
chromium
for1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/for1.C
342
utf_8
f93dc3d9c3bb926cb7922031698ecfef
// PR c++/13865 // Bug: We were destroying 'a' before executing the loop. #include <stdio.h> int i; int r; class A { public: A() { printf("A ctor\n"); } ~A() { printf("A dtor\n"); if (i != 1) r = 1; } }; int main(int argc, char **argv) { for (A a; i < 2; ++i) { printf("iteration %d\n", i...
google
chromium
new1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new1.C
300
utf_8
3dd2b2682d04e72fb7a9a8d137ec7e9d
// { dg-do compile } typedef __SIZE_TYPE__ size_t; class bar { int i; public : void * operator new ( size_t , void * storage ); }; class foo { int storage[ 5 ]; public: void mem ( ) { bar *s = new ( ( void * ) & storage ) bar; } };
google
chromium
ptrfn3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrfn3.C
279
utf_8
111716aa5bd4c456321772f776bd97d1
// { dg-options "" } // { dg-do compile } // C++/30221 // We would ICE while trying to reshape the pointer to // member function element which is not needed. class abstract {}; typedef void (abstract::*fptr1) (short & s ) const; struct s {fptr1 f;}; s array[] = { (fptr1)0 };