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 | android | value7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/value7.C | 158 | utf_8 | 4487271d3a3d8cbbe87a8aa0dee4b541 | // PR c++/30111
// { dg-do run }
struct pod {
int i;
};
struct inherit : pod {
inherit() : pod() {}
};
int main()
{
inherit i;
return i.i != 0;
}
|
google | android | goto1 | .C | toolchain/gcc/gcc-4.9/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 | android | pr43890 | .C | toolchain/gcc/gcc-4.9/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 | android | static1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/static1.C | 85 | utf_8 | 36c7bdcd9c002a17bbb025dd79e017b7 | struct A {
static const int size = BOGUS; // { dg-error "" }
};
const int A::size;
|
google | android | explicit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/explicit1.C | 99 | utf_8 | 55e9aae31c4321af10be5fd01704a6a6 | // PR c++/60417
struct A { explicit A(int = 0); };
struct B { A a; };
int main()
{
B b = {};
}
|
google | android | aggr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/aggr1.C | 247 | utf_8 | f6bd229ad72e1e0526a7e259faf50163 | // Test that initializing an aggregate with complex copy constructor
// and assignment ops doesn't cause cp_expr_size to abort.
struct A
{
A();
A(const A&);
A& operator=(const A&);
};
struct B
{
A a;
};
int main ()
{
B b = { A() };
}
|
google | android | error1 | .C | toolchain/gcc/gcc-4.9/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 | android | value6 | .C | toolchain/gcc/gcc-4.9/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 | android | array2 | .C | toolchain/gcc/gcc-4.9/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 | android | ptrmem3 | .C | toolchain/gcc/gcc-4.9/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 | android | ref20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref20.C | 133 | utf_8 | 559e18af649d0930e65e2663f043609b | // PR c++/50787
// { dg-do run }
int main() {
const int Ci = 0;
const int &rCi = Ci;
if (!(&Ci == &rCi)) __builtin_abort();
}
|
google | android | array34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array34.C | 345 | utf_8 | b5c490c86478a50e8b4adcab75ef8c1d | // PR c++/53650
// We should loop over array inits if they don't involve temporaries
// that need extending.
// { dg-options "-fdump-tree-gimple" }
// { dg-final { scan-tree-dump-times "Class::Class" 1 "gimple" } }
// { dg-final { cleanup-tree-dump "gimple" } }
struct Class {
Class();
};
int main() {
Class table ... |
google | android | lifetime3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/lifetime3.C | 529 | utf_8 | b280d60771fc613f6363c55c8137a4b8 | // PR c++/26714
// { dg-do run }
extern "C" void abort();
bool ok = false;
struct A {
A() { }
~A() { if (!ok) abort(); }
};
struct B {
static A foo() { return A(); }
};
B b_g;
struct scoped_ptr {
B* operator->() const { return &b_g; }
B* get() const { return &b_g; }
};
B *get() { return &b_g; }
int mai... |
google | android | new8 | .C | toolchain/gcc/gcc-4.9/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 | android | ctor11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor11.C | 168 | utf_8 | 6ee4f7840a21e5a764e2facf94d7e71d | // PR c++/49569
struct A
{
virtual void f() = 0;
};
struct B: A
{
int i;
virtual void f() { }
};
struct C
{
B b;
C(): b() { }
C(const B& b): b(b) { }
};
|
google | android | array27 | .C | toolchain/gcc/gcc-4.9/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 | android | pr25811-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr25811-4.C | 1,012 | utf_8 | 677f7b38b3959f7edf25e66789e0a86a | // { dg-do compile }
// { dg-options "-fpermissive" }
struct A { int const i; };
struct B { int& i; };
struct C { int i; };
template< class T >
class is_constructible_via_new_without_initializer
{
template<int> class size {};
typedef char yes_type;
struct no_type { char data[2]; };
template <class U... |
google | android | pr58811 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr58811.C | 102 | utf_8 | c835d50eaf5fe1a2b052a1579b5ce77f | // PR c++/58811
struct B
{
struct A a; // { dg-error "incomplete type" }
};
void foo()
{
B();
}
|
google | android | ref6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref6.C | 106 | utf_8 | f75e860b2c4af1d147a082d96b6d7806 | struct B {
void g() { }
};
struct A {
void f() {
B &b = b;
b.g();
}
};
int main(void) { }
|
google | android | inline1 | .C | toolchain/gcc/gcc-4.9/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 | android | array16 | .C | toolchain/gcc/gcc-4.9/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 | android | cleanup1 | .C | toolchain/gcc/gcc-4.9/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 | android | ref17 | .C | toolchain/gcc/gcc-4.9/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 | android | pmf1 | .C | toolchain/gcc/gcc-4.9/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 | android | bitfield4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/bitfield4.C | 154 | utf_8 | 3d9dc85d249bab59ebe8894e33879a6f | // PR c++/56235
struct A
{
A (const A &);
};
struct B
{
A a;
enum Mode { };
Mode m:8;
};
struct C
{
C();
B b;
};
C fn()
{
return C();
}
|
google | android | array19 | .C | toolchain/gcc/gcc-4.9/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 | android | volatile1 | .C | toolchain/gcc/gcc-4.9/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 | android | ref11 | .C | toolchain/gcc/gcc-4.9/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 | android | new37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new37.C | 1,080 | utf_8 | 55b7ad27edf55e2712cda0fed72289e7 | // { dg-do compile }
void
nonconst(int n)
{
new (long[n][n]); // { dg-error "variable length|array size|not a constant|runtime bound" }
new long[n][n]; // { dg-error "variable length|array size|not a constant" }
}
template <typename T>
void *
callnew(int n)
{
return new long[n][T::n];
}
template <typename T>
v... |
google | android | const9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/const9.C | 168 | utf_8 | 44a23773b7b1f4db8638797799d850fc | // PR c++/55893
// { dg-final { scan-assembler-not "rodata" { target { ! hppa*-*-* } } } }
struct foo
{
virtual ~foo ();
};
int main ()
{
static const foo tmp;
}
|
google | android | union1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/union1.C | 59 | utf_8 | a94d2ff7c7a43d0764a116004fa30738 | // PR c++/14401
union U {
int& i; // { dg-error "" }
};
|
google | android | new18 | .C | toolchain/gcc/gcc-4.9/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 | android | ref12 | .C | toolchain/gcc/gcc-4.9/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 | android | static-init2 | .C | toolchain/gcc/gcc-4.9/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 | android | switch1 | .C | toolchain/gcc/gcc-4.9/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 | android | addr-const1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/addr-const1.C | 714 | utf_8 | 835b43db313003f4551ea74731f1362c | // { dg-do run }
// PR 9881. address-constant-expression not static initialized
struct bar {
double p;
}; // bar
bar v;
static bool error = false;
struct foo {
static double *a;
static double *b;
static double storage;
};
struct baz {
baz () {
if (foo::a != &v.p)
error = true;
if (foo::b !=... |
google | android | aggr4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/aggr4.C | 96 | utf_8 | 6c7823cc31b81149e4b16ea9c6189129 | struct A
{
int i;
};
A a1 = { 1 }; // ok
A a2 = { a1 }; // { dg-error "cannot convert" }
|
google | android | ref10 | .C | toolchain/gcc/gcc-4.9/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 | android | pr25811-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr25811-3.C | 980 | utf_8 | 769411a1c7958778a3d38ee85b470169 | // { dg-do compile }
struct A { int const i; };
struct B { int& i; };
struct C { int i; };
template< class T >
class is_constructible_via_new_without_initializer
{
template<int> class size {};
typedef char yes_type;
struct no_type { char data[2]; };
template <class U>
static yes_type sfinae (siz... |
google | android | pm1 | .C | toolchain/gcc/gcc-4.9/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 | android | value1 | .C | toolchain/gcc/gcc-4.9/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 | android | value9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/value9.C | 287 | utf_8 | f486b963f0b6c68f60e277c5d3821f29 | // PR c++/50793
// { dg-do run }
struct NonTrivial
{
NonTrivial() { }
};
struct S
{
NonTrivial nt;
int i;
};
int f(S s)
{
s.i = 0xdeadbeef;
return s.i;
}
int g(S s = S())
{
return s.i;
}
int main()
{
f(S()); // make stack dirty
if ( g() )
__builtin_abort();
}
|
google | android | vector1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/vector1.C | 1,182 | utf_8 | e4ace0ef4caaae06eef685ccaefd464e | // PR c++/19263
// { dg-do run }
// { dg-options "-O2 -fpermissive" }
// { dg-prune-output "narrowing" }
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, ... |
google | android | new24 | .C | toolchain/gcc/gcc-4.9/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 | android | new32 | .C | toolchain/gcc/gcc-4.9/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 | android | placement2 | .C | toolchain/gcc/gcc-4.9/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... |
google | android | array3 | .C | toolchain/gcc/gcc-4.9/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 | android | new10 | .C | toolchain/gcc/gcc-4.9/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 | android | const11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/const11.C | 525 | utf_8 | fa138468b4adf0b33b769fea6bc7c730 | // PR C++/52369
// { dg-do compile { target { ! c++11 } } }
class B
{
int const v_; // { dg-message "should be initialized" }
};
struct D : B {};
class A
{
int& ref; // { dg-message "should be initialized" }
};
struct C : A {};
void f()
{
D d; // { dg-error "uninitialized" }
new D; // { dg-error "uninitial... |
google | android | ref5 | .C | toolchain/gcc/gcc-4.9/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 | android | array5 | .C | toolchain/gcc/gcc-4.9/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 | android | array22 | .C | toolchain/gcc/gcc-4.9/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 | android | aggr10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/aggr10.C | 104 | utf_8 | e60e83c6b0fade38651db5ca7efb41c1 | // PR c++/59886
struct A { A (); ~A (); };
struct B { A b[4]; };
struct C { B c[5]; };
const C e = {};
|
google | android | copy5 | .C | toolchain/gcc/gcc-4.9/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 | android | ctor4-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor4-1.C | 417 | utf_8 | 53112743910ba6ae20bbf262c05c3d8c | // { dg-do compile }
class foo {
public:
foo();
};
class bar: public foo { // { dg-error "uninitialized" }
// { dg-message "implicitly deleted" "" { target c++11 } 8 }
private:
int const a; // { dg-message "should be initialized" }
};
foo::foo() {
}
int main(int argc, char **argv)
{
bar x; // { dg-error ... |
google | android | new31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new31.C | 160 | utf_8 | cb832553288f013af05fc884fc7a4d21 | // PR c++/48834
// { dg-options -Wuninitialized }
// { dg-do run }
struct S
{
S ():i (0)
{
}
int i;
};
int
main ()
{
S *s = new S[2];
return 0;
}
|
google | android | array14 | .C | toolchain/gcc/gcc-4.9/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 | android | array4 | .C | toolchain/gcc/gcc-4.9/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 | android | new15 | .C | toolchain/gcc/gcc-4.9/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 | android | copy4 | .C | toolchain/gcc/gcc-4.9/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 | android | array32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array32.C | 83 | utf_8 | 7392d375ce222c58f39027d2512a7d53 | // PR c++/42315
extern int x[];
int i = x[0];
int x[] = 0; // { dg-error "" }
|
google | android | ptrmem4 | .C | toolchain/gcc/gcc-4.9/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 | android | placement1 | .C | toolchain/gcc/gcc-4.9/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 | android | array30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array30.C | 101 | utf_8 | cf61432d9f6af13d42de3b054c64bb90 | // PR c++/54501
// { dg-options "" }
int main()
{
int a[][0] = {0}; // { dg-error "too many" }
}
|
google | android | goto2 | .C | toolchain/gcc/gcc-4.9/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 | android | new13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new13.C | 222 | utf_8 | 6cc3a43ec721a6a41801bdc9bc2a8a18 | // PR c++/22508
// ICE on invalid operator new
// { dg-do compile }
struct A
{
void* operator new(__SIZE_TYPE__) throw(X); // { dg-error "expected|type" }
};
A* p = new A; |
google | android | mutable1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/mutable1.C | 330 | utf_8 | bdc0a28e899cdd6a24fc02b81555168a | // PR c++/54026
// { dg-final { scan-assembler-not "rodata" } }
void non_const(int *);
template <typename T>
struct Foo {
T x;
mutable int y;
void func() const { non_const(&y); }
};
struct Bar {
int x;
mutable int y;
void func() const { non_const(&y); }
};
const Foo<int> foo = { 1, 2 };
const Bar bar = ... |
google | android | enum1 | .C | toolchain/gcc/gcc-4.9/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 | android | error2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/error2.C | 262 | utf_8 | 56a518089ed19a2aa32735199bb379e0 | /* 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 | android | ref18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref18.C | 253 | utf_8 | 414d55614739b2926c1121746254a89a | // PR c++/49395
volatile int foo();
struct A { volatile int i; };
typedef volatile int vi;
volatile int i;
const int& ir1 = foo();
//const int& ir2 = A().i; // line 8
const int& ir3 = static_cast<volatile int>(i);
const int& ir4 = vi(); // line 10
|
google | android | const10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/const10.C | 827 | utf_8 | 03fe5930d821b1524ea534c58f31f5b0 | // PR C++/52369
// { dg-do compile { target c++11 } }
class B // { dg-message "implicitly deleted" }
// { dg-error "uninitialized" "" { target c++11 } 4 }
{
int const v_; // { dg-message "should be initialized" }
};
struct D : B {}; // { dg-error "deleted" }
class A // { dg-message "implicitly deleted" }
... |
google | android | vbase1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/vbase1.C | 567 | utf_8 | b6b15a32222813d22fc13bb24c002c95 | // PR c++/50618
// { dg-do run }
struct Base
{
const int text;
Base():text(1) {}
Base(int aText)
: text(aText) {}
};
struct SubA : public virtual Base
{
protected:
int x;
public:
SubA(int aX)
: x(aX) {}
};
class SubB : public virtual Base
{};
struct Diamond : public SubA, public SubB
{
Diamon... |
google | android | array24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array24.C | 88 | utf_8 | 80e4fac735593ad1904fa8ac57d7e763 | // PR c++/29175
// { dg-options "-Wno-vla" }
void foo(int i)
{
int x[][i] = { 0 };
}
|
google | android | array13 | .C | toolchain/gcc/gcc-4.9/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 | android | elide1 | .C | toolchain/gcc/gcc-4.9/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 | android | value5 | .C | toolchain/gcc/gcc-4.9/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 | android | new33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new33.C | 305 | utf_8 | cfea0ab170d4358b916fb0262fc92e02 | // PR c++/53356
// { dg-do compile }
struct A {};
struct B { operator const A & () const; };
struct C { operator const A & () const; C (); };
struct D { operator const A & () const; D (); ~D (); };
A *foo () { return new A (B ()); }
A *bar () { return new A (C ()); }
A *baz () { return new A (D ()); }
|
google | android | ref7 | .C | toolchain/gcc/gcc-4.9/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 | android | ptrfn1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ptrfn1.C | 148 | utf_8 | 697d82f637fb8839d98efadd58ededf5 | // PR c++/29016
// { dg-options "-O2" }
class A;
class B
{
typedef void (*C[5]) (A *);
static C D;
static void E (A*) {}
};
B::C B::D={E};
|
google | android | brace1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/brace1.C | 69 | utf_8 | a9c79959ed517bc5d72a6a5d41cbf16b | // { dg-do compile }
int i[4] = { { 3 } }; // { dg-error "brace" }
|
google | android | array15 | .C | toolchain/gcc/gcc-4.9/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 | android | string1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/string1.C | 124 | utf_8 | 8b181745d241d484dd529391acd12c57 | extern void f (char*);
extern const char * const target = "foo";
void g ()
{
f (target); // { dg-error "conversion" }
}
|
google | android | array8 | .C | toolchain/gcc/gcc-4.9/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 | android | aggr3 | .C | toolchain/gcc/gcc-4.9/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 | android | array6 | .C | toolchain/gcc/gcc-4.9/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 | android | ref2 | .C | toolchain/gcc/gcc-4.9/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 | android | ref15 | .C | toolchain/gcc/gcc-4.9/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 | android | float1 | .C | toolchain/gcc/gcc-4.9/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 | android | array18 | .C | toolchain/gcc/gcc-4.9/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 | android | ptrmem2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ptrmem2.C | 135 | utf_8 | 74ea9e49b5fe45a570f00a8474ac7198 | // PR c++/19916
// { dg-do run }
struct S {
char k;
};
char const volatile S::* const p01 = &S::k;
int main(void)
{
return 0;
}
|
google | android | array23 | .C | toolchain/gcc/gcc-4.9/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 | android | pr29043 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr29043.C | 1,027 | utf_8 | 8607e3bf04a69c359175e0f42805918b | // PR c++/29043
// { dg-do compile }
struct S // { dg-message "implicitly deleted" "" { target c++11 } }
// { dg-error "uninitialized" "" { target c++11 } 4 }
{
int const i; // { dg-message "should be initialized" }
};
class C
{
public:
C() {} // { dg-error "uninitialized const member|deleted" }
S s;
};
stru... |
google | android | ref14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref14.C | 181 | utf_8 | 1715b7bc1454e2c6ac4cbf9982f66900 | // PR c++/33459
// { dg-prune-output "uninitialized" }
// { dg-prune-output "deleted" }
union A
{
int &i; // { dg-error "may not have reference type" }
};
void foo()
{
A();
}
|
google | android | reference1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/reference1.C | 249 | utf_8 | 14fd5d851c700287b535c91b481fe0cf | // { 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
int main()
{
typedef int& T;
T a = T(); // { dg-error "value-initialization of reference" }
}
|
google | android | value8 | .C | toolchain/gcc/gcc-4.9/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 | android | array0 | .C | toolchain/gcc/gcc-4.9/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 | android | value4 | .C | toolchain/gcc/gcc-4.9/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 | android | struct2 | .C | toolchain/gcc/gcc-4.9/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 | android | call1 | .C | toolchain/gcc/gcc-4.9/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 | android | for3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/for3.C | 111 | utf_8 | 07dcd9a47aa0d73fd3c9a976d1f3ba07 | // { dg-do compile }
struct A { int i; A(); A(const A&); };
void bar()
{
A a;
for ( ;; a=A() ) ;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.