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
new10
.C
native_client/pnacl-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
ctor10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ctor10.C
168
utf_8
a7fab26ec8d16e90cb47357e7759a768
// PR c++/48606 // { dg-do compile } // { dg-options "-fkeep-inline-functions" } struct S { int &ref; S() : ref() {}; // { dg-error "value-initialization of" } };
google
chromium
value1
.C
native_client/pnacl-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/pnacl-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/pnacl-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/pnacl-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
array27
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array27.C
126
utf_8
30e0ae9123ab7bb807c4503c3a24b828
// PR c++/42058 // { dg-options "" } struct A {}; struct B { A a; }; B b[1] = (B[]) { 0 }; // { dg-error "initializer" }
google
chromium
static-init1
.C
native_client/pnacl-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/pnacl-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/pnacl-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/pnacl-gcc/gcc/testsuite/g++.dg/init/ref15.C
625
utf_8
4e77248465fbd1b66fa4dc5de150451c
// PR c++/20416. We correctly constructed the temporary S in foo(), // but incorrectly destroyed it every time foo() was called. // When using a wrapped target, there is no way to override the exit // code after returning from main. // { dg-do run { target unwrapped } } extern "C" void abort (void); extern "C" void _e...
google
chromium
ref4
.C
native_client/pnacl-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
synth4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/synth4.C
96
utf_8
1a08d73d34d484903191c07901fa5549
// PR c++/45822 struct A { A(int); }; struct B { B(A = 0); }; struct C { B b; }; C c;
google
chromium
pr43890
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pr43890.C
324
utf_8
89bc34eae0365b381ab82e8d4ca5957f
// PR c++/43890 // { dg-do compile } class Outer { public: Outer() : i(*this) { } class Inner { public: Inner(Outer& o) : o(o) , i(0) { } private: Outer& o; int const i; }; private: Inner i; }; class A { Outer o; }; int main() { A *a = new A; return 0...
google
chromium
value4
.C
native_client/pnacl-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/pnacl-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/pnacl-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
pr44086
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pr44086.C
251
utf_8
bc2b5bfedac32a60afe9f4305bef156a
// PR c++/44086 // { dg-do compile } struct A { int const i : 2; // { dg-message "should be initialized" } }; void f() { A a; // { dg-error "uninitialized const" } new A; // { dg-error "uninitialized const" } A(); new A(); }
google
chromium
new23
.C
native_client/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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
pr29571
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pr29571.C
234
utf_8
7cb97162223a67ec8f8575ee90572694
// PR c++/29571 struct A { static const int i = 0/0 + ""; // { dg-warning "division by zero" } // { dg-error "field initializer is not constant|not a constant-expression" "" { target *-*-* } 5 } static const int j = int(i); };
google
chromium
init-ref2
.C
native_client/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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
new32
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new32.C
159
utf_8
f30d722e5e54dd454d89dcda7f983e4e
// PR c++/48873 #include <new> struct D { private: ~D(); }; template<class T> T& create(); void f() { D* dp = new (((void*) 0)) D(create<D>()); // # }
google
chromium
void1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/void1.C
42
utf_8
4e0802398e368eb04b3feac9c0b1b5d4
// PR c++/48569 int main() { void(); }
google
chromium
array21
.C
native_client/pnacl-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/pnacl-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/pnacl-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
pr48859
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pr48859.C
177
utf_8
880ee6b08cc835f2a1db0bae613e7a23
// PR c++/48859 // { dg-do compile } struct HasConstructor { HasConstructor() {} }; class ConstMember { const HasConstructor empty_; }; void foo() { new ConstMember; }
google
chromium
ref7
.C
native_client/pnacl-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/pnacl-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/pnacl-gcc/gcc/testsuite/g++.dg/init/copy7.C
488
utf_8
7c79b5d6b635ea9f891eaec98904a6d4
// 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) { if (dest == src) abort(); else { __SIZE_TYPE__ i; for (i = 0; i < n; i++) ((char *)dest)[i] = ((c...
google
chromium
array2
.C
native_client/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-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/pnacl-gcc/gcc/testsuite/g++.dg/init/for1.C
360
utf_8
5fbc52a7350737286970a6d4138bcc86
// PR c++/13865 // Bug: We were destroying 'a' before executing the loop. // { dg-do run } #include <stdio.h> int i; int r; class A { public: A() { printf("A ctor\n"); } ~A() { printf("A dtor\n"); if (i != 2) r = 1; } }; int main(int argc, char **argv) { for (A a; i < 2; ++i) { printf("...
google
chromium
new1
.C
native_client/pnacl-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/pnacl-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 };
google
chromium
init-ref4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/init-ref4.C
371
utf_8
3f1579f55c69e948c03b96707c703c8c
// PR c++/11384 // foo<int>::_S_something was not being emitted (as a weak definition). // { dg-do run } // { dg-require-weak "" } template<typename T> struct foo { static const T _S_something; }; template<typename T> const T foo<T>::_S_something = T(); int main() { const int* p = &foo<int>::_S_something...
google
chromium
array9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array9.C
92
utf_8
b1c2a3438d19ab4734ef026ce6aba7fa
struct T { T (); }; void f () { T t[2]; for (int i = 0; i < 10; ++i); int i = 0; }
google
chromium
const6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/const6.C
317
utf_8
1e8e9dc83b9cc3b9c04e15495abf5871
// PR c++/36688 // { dg-do run } // { dg-options "-O2" } struct S { long long a; long long b; long long c; }; struct T { S g; long long h[12]; }; static const S s = { 1, 2, 3 }; static const T t = { s, 0 }; int main () { T x = t; if (__builtin_memcmp (&x, &t, sizeof (T))) __builtin_abort (); }
google
chromium
ref3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref3.C
156
utf_8
e21984c05c21d067e3b20b37c68bec76
struct Base { }; struct Derived : public Base { }; struct Choose { operator Base&(); operator Derived&(); }; void f() { Choose c; Base& ref = c; }
google
chromium
ref12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref12.C
269
utf_8
b5056183793160d509fa082d596ab38f
// PR c++/17435 // { dg-do run } extern "C" void abort (); bool ok; struct A { void func() const { ok = 1; } ~A() { if (!ok) abort (); } }; struct B : public A { }; int main() { A const& r1 = B(); r1.func(); }
google
chromium
value2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/value2.C
224
utf_8
a827a35dd447a4d79aa21373dc3c82c4
// PR c++/35116 // Test that break_out_target_exprs works properly with complex // value-initialization. struct A { virtual void f (); }; struct B { A a; }; struct C { C (int, B = B()); }; void f () { C c (4); }
google
chromium
dtor2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/dtor2.C
191
utf_8
aa6675ad7ca1b7ce6a63c598c59f89a0
// { dg-do run } extern "C" void abort (); struct A { ~A(); }; A::~A () { abort (); } struct B { ~B(); }; B::~B () { if(true) return; A a; } int main() { B b; return 0; }
google
chromium
placement4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/placement4.C
514
utf_8
4e76efb079bdce4887766fb38dfed9eb
// PR c++/34158 typedef __SIZE_TYPE__ size_t; extern "C" void* malloc (size_t); extern "C" void free (void *); template <class T> class undef; struct A { A() { throw 1; } }; template<typename T> class Pool { }; void *operator new(size_t size,Pool<int>& pool) { return malloc(size); } template<typename T> void ...
google
chromium
placement5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/placement5.C
886
utf_8
55d122e9aff50960b79ab1335c523e8d
// 5.3.4/19: If the lookup finds the two-parameter form of a usual // deallocation function (3.7.4.2) and that function, considered as a // placement deallocation function, would have been selected as a match for // the allocation function, the program is ill-formed. // But we should only complain about using op delet...
google
chromium
pmf1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pmf1.C
424
utf_8
19c721af2055386319b10ee94a3d6a81
// PR c++/14089 // { dg-do compile } // // C++ front end generated assignment between types that were not // compatible in any sense visible to the optimizers. struct pair { typedef void (pair::*fp)(); int first; pair::fp second; pair(const int& a, const pair::fp& b) : first(a), second(b) {} void f...
google
chromium
new8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new8.C
300
utf_8
9e9ce794649ccc9a4507b42cb8c4c0d0
typedef __SIZE_TYPE__ size_t; enum Refcount_Type { NO_REFCOUNT }; struct d0_Unknown_Object { void* operator new (size_t, size_t, Refcount_Type type); void operator delete (void*, size_t, Refcount_Type); d0_Unknown_Object (); }; void make () { new (10, NO_REFCOUNT) d0_Unknown_Object; }
google
chromium
array23
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array23.C
150
utf_8
7d6986e89f73715409b343d7a3f5801a
// PR C++/29002 // We ICE trying to set the "zero" initializer on the incomplete // array struct A {A();int A::* t;}; A x[]; // { dg-error "size" }
google
chromium
ref10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref10.C
166
utf_8
bf98e501c2009d025916bc7e43853c8e
// PR c++/13478 struct A {}; struct B : protected A { B() {} B(const A& ) {} private: B(const B& ) {} }; void foo(const A* ap) { const B& br = *ap; }
google
chromium
ref16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref16.C
220
utf_8
f44963a0cd9c1736b28dd8d5a81a4a94
// PR c++/35548 // { dg-do run } int c; struct A { A() { ++c; } A(const A&) { ++c; } ~A() { --c; } }; A f() { return A(); } int i; const A* ap; int main() { const A& ar = i ? *ap : f(); return (c == 0); }
google
chromium
error1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/error1.C
119
utf_8
1b6b87db9a47d5b010067f2e79b87143
// PR c++/12696 struct A { static float b[10]; } // { dg-error "after struct definition" } float A::b[] = {1,2,3};
google
chromium
pr42556
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pr42556.C
236
utf_8
57c7dcb8094fab9f3da6123ee9042419
// { dg-do compile } // { dg-options "-fdump-tree-gimple" } void foo (int a, int b, int c, int d) { int v[4] = {a, b, c, d}; } // { dg-final { scan-tree-dump-not "v = {}" "gimple" } } // { dg-final { cleanup-tree-dump "gimple" } }
google
chromium
array16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array16.C
1,818
utf_8
2c43f5c2d3188d0d5d12bfaab977d248
// Causes timeout for the MMIX simulator on a 3GHz P4 and we can't // have "compile" for some targets and "run" for others. // { dg-do run { target { ! mmix-*-* } } } // { dg-options "-mstructure-size-boundary=8" { target arm*-*-* } } // NOTE: This test assumes that 4M instances of struct ELT can fit into // a 5M...
google
chromium
assign1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/assign1.C
389
utf_8
590b4fffc5e2d0c7af7852413ab82a9e
// PR c++/13009 // { dg-do run } struct A { char a; }; struct B: public virtual A { #if 0 // this piece of code works around the problem B& operator= (const B& other) { A::operator= (other); } #endif }; struct C: public B { char c; }; int main() { B b; b.a = 'b'; C c; c.a = c.c = 'c'; ...
google
chromium
array26
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array26.C
157
utf_8
2f6f753fa1574ed97933b69ee8d44b91
// PR c++/42058 // { dg-options "" } struct A; struct B { A a; // { dg-error "incomplete type" } }; B b[1] = (B[]) { 0 }; // { dg-error "initializer" }
google
chromium
ptrmem1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ptrmem1.C
91
utf_8
d92713305e498425e3152fff2c8acf2d
// PR c++/16853 struct A {}; struct B {}; int B::* b; int A::* a = b; // { dg-error "" }
google
chromium
dtor4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/dtor4.C
99
utf_8
ac285fc50cba27993de1b79c1ca24b82
// { dg-final { scan-assembler-not "_ZN1AD2Ev" } } struct A { }; int main() { A a; a.~A(); }
google
chromium
new28
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new28.C
266
utf_8
7fc4838fffcb429888d20344300ac8d6
// PR c++/43951 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (); class Foo { public: Foo () : xxx (1) {}; const int xxx; }; Foo * bar () { return new Foo; } int main () { Foo *p = bar (); if (p->xxx != 1) abort (); return 0; }
google
chromium
copy5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/copy5.C
525
utf_8
02c689a173b02b7312d282add8f14591
// { dg-options "-O2" } struct BOOL { int nVal:1, bSet:1; BOOL (int i) : nVal(i!=0), bSet(1) {} }; struct Fill { void *d; Fill() : d(0) {} Fill( const Fill& ) {} }; struct SvMetaSlot { Fill aGroupId; BOOL a8; SvMetaSlot() : a8(1) {} SvMetaSlot* MakeClone() const; }; SvMetaSlo...
google
chromium
const8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/const8.C
238
utf_8
f95f725ee79bd108445d875c500d252a
// DR 234 - it should be OK to leave off the initializer of a const // variable if the default constructor fully initializes the object. struct A { }; const A a; struct B { A a; }; const B b; struct C { virtual void f(); }; const C c;
google
chromium
ctor6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ctor6.C
343
utf_8
ecc9c501210a7d0fcb63a6b4e75e71ee
// PR c++/21340 struct Base{}; struct Iterator : virtual Base {}; bool operator==(const Iterator&, const Iterator&); struct IteratorI : Iterator {}; struct Obj { bool operator==(const Obj&) const; }; template <int>bool dummy() { Obj lhs, rhs; return lhs == rhs; } int main(int argc, char** argv) { IteratorI* it...
google
chromium
attrib1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/attrib1.C
128
utf_8
3eee77105967418a88d56f0c30243408
// { dg-do run } void f() __attribute((__constructor__)); int i; void f() { i = 1; } int main(int, char **) { return 1-i; }
google
chromium
ref19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref19.C
150
utf_8
6b586ac561f445fc5a8241684550876b
// PR c++/49528 // { dg-do run } int d; struct A { int i; ~A() { ++d; }; }; int main() { const int &r = A().i; if (d != 1) return 1; }
google
chromium
new16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new16.C
640
utf_8
c52e42cacc9e8e4d847ceae5031544ca
// { dg-do run } // { dg-options "-O2 -fstrict-aliasing" } // Test that we don't let TBAA reorder an assignment across a // placement new. // See PR 29286. typedef __SIZE_TYPE__ size_t; inline void* operator new(size_t, void* __p) throw() { return __p; } void __attribute__((noinline)) bar() {} long __attribute__((...
google
chromium
value5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/value5.C
229
utf_8
a07f29cc13922f46ee402c672bab1763
// PR c++/38232 class base { public: base(); virtual ~base(); private: int& int_ref; // initialized by base ctor, not visible here }; class derived : public base { }; base *make_derived() { return new derived(); }
google
chromium
value8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/value8.C
149
utf_8
8301ee378a2cddfa351a850b83e9542a
// PR c++/45315 struct A { A (); }; template < int > struct B : A { void foo () { new B < 0 > (); } }; int main() { B<1>().foo(); }
google
chromium
new18
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new18.C
1,236
utf_8
5ca2a958aa1a666bff61b9a21c413595
// { dg-do compile } // { dg-options "-O2 -fstrict-aliasing" } // This caused an ICE during placement new. namespace Pooma { typedef int Context_t; namespace Arch { } inline Context_t context() { } inline int contexts() { } } template<class DomT, class T, class NewDom1T> struct DomainTraitsScalar ...
google
chromium
array25
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array25.C
665
utf_8
cd3850e151894462d2f417f022f58b7c
// related to PR c++/38233 // test for value-init of a member array // { dg-do run } struct elt { virtual void f(); char c; }; void elt::f() { } struct foo { elt buffer[500]; foo() ; bool check () const; }; foo::foo () : buffer() {} bool foo::check () const { for (unsigned ix = sizeof (buffer)/ size...
google
chromium
ctor7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ctor7.C
497
utf_8
2c3e5a9bb93285c3f11607173fad5f0e
// { dg-do run } struct B { virtual void Foo (); }; void B::Foo () { } struct D : virtual B { }; struct E { B *ptr; E (B *); }; static B *ptr; E::E (B *ptr_) :ptr (ptr_) { } struct G : D, E { G (); }; G::G () : E (this) { } int main () { G object; return object.ptr != &object; }
google
chromium
array13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array13.C
199
utf_8
d0bb03e714f655f56840d4e660ac77be
template <typename DisjointSet> struct test_disjoint_set { static void do_test() { unsigned int elts[] = { 0, 1, 2, 3 }; const int N = sizeof(elts)/sizeof(*elts); } };
google
chromium
bitfield2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/bitfield2.C
421
utf_8
f93344289d2f2663e5df449820c5dae4
// PR c++/13371 // Bug: We were failing to properly protect the lhs on the line marked // "here" from multiple evaluation. // { dg-do run } extern "C" int printf (const char *, ...); enum E { E1, E2 }; struct A { E e : 8; unsigned char c; }; A ar[2]; int c; int f() { ++c; printf ("f()\n"); return 0; } ...
google
chromium
brace2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/brace2.C
289
utf_8
3766a6e9088c3371c5da62da2dbbfd1a
// { dg-do compile } // [dcl.init] paragraph 13. int x = { 2 }; const char * y = { "hello" }; int a = 2; int b = { 2,3 }; // { dg-error "requires one element in initializer" } int c = { { 2 } } ; // { dg-error "braces around scalar initializer" } int d = {}; // { dg-error "initializer" }
google
chromium
const4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/const4.C
120
utf_8
0ac36de7c095e58a6e1031bab57934e3
// PR c++/27804 // { dg-do compile } bool foo() { const int i = X; // { dg-error "not declared" } return i > 0; }
google
chromium
brace3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/brace3.C
50
utf_8
c46d05cc9ceeb4d3a8a4d25cd908ba7a
int array[2][1] = { {0} {1} }; // { dg-error "" }
google
chromium
ref14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/ref14.C
109
utf_8
79847f23b4ac275a085b4cd88db8ff58
// PR c++/33459 union A { int &i; // { dg-error "may not have reference type" } }; void foo() { A(); }
google
chromium
new29
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/new29.C
302
utf_8
ea98cc4326612e97a8fabdee28dcf0ba
// PR c++/43951 // { dg-do run } // { dg-options "-O2" } extern "C" void abort (); class Foo { public: Foo () : xxx (1) {}; const int xxx; }; struct Foo2 { Foo foo; }; Foo2 * bar () { return new Foo2; } int main () { Foo2 *p = bar (); if (p->foo.xxx != 1) abort (); return 0; }
google
chromium
enum1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/enum1.C
312
utf_8
0fab5264214dd4964a69af401f3e7e7c
/* { dg-options "-Wno-overflow" } */ #ifndef __SIZEOF_INT128__ #define UNACCEPT 0xffffffffffffffffLL #else #define UNACCEPT ~((unsigned __int128) 0) #endif enum test { acceptable = -1, unacceptable = UNACCEPT }; // { dg-error "" } enum test t = acceptable, u = unacceptable; int main() { return 0; }
google
chromium
pm1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/pm1.C
1,382
utf_8
17e13ddd2f4151d2809753d82ad732b3
// { dg-do run } // Contributed by Jason Merrill and Alexandre Oliva // Test zero-initialization of pointers to data members. Their NULL // value is represented with -1, not 0. #include <stdlib.h> struct A { int i; }; int A::* gp; typedef int A::* iApm; iApm gp_zero = 0; iApm gp_dflt = iApm(); iApm gp_cast = (iApm)0...
google
chromium
array6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array6.C
239
utf_8
12f516d0ef7088644b46185bbd83ef4d
// { dg-do compile } char arr [][4] = { "one", "two" }; const char arr2[][4] = { "one", "two" }; signed char arr3[][4] = { "one", "two" }; const unsigned char arr4[][4] = { "one", "two" }; volatile wchar_t arr5[][4] = { L"one", L"two" };
google
chromium
brace1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/brace1.C
69
utf_8
a9c79959ed517bc5d72a6a5d41cbf16b
// { dg-do compile } int i[4] = { { 3 } }; // { dg-error "brace" }
google
chromium
array18
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/array18.C
188
utf_8
2010ab8cabd116e1c5704c568327ae76
// PR c++/20142 // { dg-do run } int n=4; struct A { A() {} A& operator= (const A&) { --n; return *this; } }; struct B { A x[2][2]; }; int main() { B b; b = b; return n; }
google
chromium
placement2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/init/placement2.C
418
utf_8
9c2843f3878e7468a19ecfaa90c8bf5f
// Bug: We were calling f() twice, for both the placement new and placement // delete calls. // { dg-do run } void* operator new (__SIZE_TYPE__ sz, void*) { return operator new (sz); } void operator delete (void* p, void*) { operator delete (p); } struct A { A() { throw 1; } }; int c; void *f() { ++c; r...