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
operator2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/operator2.C
251
utf_8
964600658be3f75b988efd034a9cc438
// PR c++/19966 // { dg-do compile } struct A { static operator int(); // { dg-error "must be a nonstatic" } }; struct B { static int operator*(); // { dg-error "must be either" } }; static operator int(); // { dg-error "must be a nonstatic" }
google
android
defarg7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/defarg7.C
102
utf_8
de833d8751ce7fbcf8622b1a3ccd7a5c
struct A { A(const char *); explicit A(const int *); }; void f (A a = 0); int main() { f(); }
google
android
addr2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/addr2.C
110
utf_8
e78713a0179131f593c8dd8fb9214bc5
// PR c++/29143 void f(int); void g(int,int); void g(int,int,int); void h () { (&f)(1); (&g)(1,2,3); }
google
android
VLA
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/VLA.C
296
utf_8
e01d22af2bf54a4df755dfb677defefb
//PR c++/2478 // G++ was rejecting this as it could not convert `int (*)[]' to `int (*)[0]'. // Using the C99 VLA style arrays in a struct. // { dg-do compile } struct S { int (*p)[]; } B; void foo() { int (*p)[]; B.p=p; // { dg-bogus "cannot convert" } }
google
android
builtin1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/builtin1.C
412
utf_8
ce05e962357b9e27eb61fcb9e1f0b7ee
// Test that we don't discard builtin candidates inappropriately. struct B { }; struct A { operator int (); operator B (); }; void operator+ (B, B); // { dg-message "operator" "operator" } int main () { A a; a + a; // { dg-error "ambiguous" "ambiguous" } // { dg-message "operator" "match candidate text...
google
android
arg5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/arg5.C
285
utf_8
2462790168c7dfd3a860d6ca77ecec30
// PR c++/34111 class QChar { }; struct QString { QString(QChar); }; struct QPainter { void drawText (int x, int y, const QString &); }; class KHEChar:public QChar { public:KHEChar (QChar C); }; void drawByte (QPainter * P, char, KHEChar B) { P->drawText (0, 0, B); }
google
android
defarg3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/defarg3.C
311
utf_8
b954eab7456dcde91d0de9d826c7d3aa
// PR c++/37971 // { dg-do compile } class C { private: static int f(int); // { dg-error "private" } static int f(char); }; class D { public: /* C::f is inaccessible, so this is an error, even if this function is never called. */ static void g(int (*)(int) = C::f); // { dg-error "context" } };
google
android
arg2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/arg2.C
326
utf_8
4491935dbfe94276c1739fb569f323e7
// { dg-do compile } struct A {}; struct B : A { B(int); B(A); }; void foo(B); void bar() { foo(0); }
google
android
operator1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/operator1.C
442
utf_8
ffc2123ab343a779a615e519a991e1d9
typedef struct _GdkDrawable GdkDrawable; typedef struct _GdkDrawable GdkBitmap; typedef struct _GdkDrawable GdkPixmap; class Drawable { public: operator GdkDrawable* () const; }; class Pixmap : public Drawable { public: operator GdkPixmap* () const; }; class Bitmap : public Pixmap { public:...
google
android
pmf2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/pmf2.C
333
utf_8
92e24f7dfd7fc511e68b61e3c390f729
// PR c++/561 class A { }; struct B : public A { void foo (); void foo (int); template <class T> void bar (T); template <class T> void bar (T, T); }; int main () { void (A::*f1)() = (void (A::*)()) &B::foo; void (A::*f2)(int) = (void (A::*)(int)) &B::bar; void (A::*f3)(int) = (void (A::*)(int)) &B:...
google
android
autoptr1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/autoptr1.C
381
utf_8
1e41ec11ca00276315dd010f205f9f90
// PR c++/35773 template< typename T > class auto_ptr { struct auto_ptr_ref { }; public: auto_ptr(auto_ptr&); auto_ptr(auto_ptr_ref); operator auto_ptr_ref(); }; template< typename T > class reference_wrapper { public: reference_wrapper(T& t); operator T& () const; }; struct X { }; void f(auto_ptr< X >...
google
android
koenig1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/koenig1.C
376
utf_8
791639797e6ad1ae4a9d468b5cfec395
// PR c++/9336 // Bug: The first, invalid call to f caused us to crash on the second, // valid call. namespace N { template <class T> void f (T); // { dg-message "N::f" } struct A; } struct B; void g () { B *bp; N::A *ap; f (bp); // { dg-error "not declared" } // { dg-message "suggested alternative" "s...
google
android
prom1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/prom1.C
120
utf_8
a436e857943377addaac3203f4d85eb4
void foo(signed char) {} typedef int bar; void foo(bar) {} int main (int, char **) { char c; return 0; }
google
android
using3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/using3.C
186
utf_8
b056b1147dbd8a1797c665b614c55cca
// { dg-do compile } namespace a { void f(int); } namespace b { void f(int); // { dg-message "previous" } void g() { f (3); } using a::f; // { dg-error "conflicts" } }
google
android
koenig2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/koenig2.C
328
utf_8
a29b6caa05b24423db00096e576bf2be
template <class T> void dummy(T& t); void anyfunc(int x); void Foo () { anyfunc (&dummy<>); // { dg-error "cannot resolve overload" "" } }
google
android
reftemp1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/reftemp1.C
107
utf_8
4d59760484bbf6fd355f658032664fa4
// PR c++/25950 struct X { X(); explicit X(const X&); }; void g(const X&); int main() { g(X()); }
google
android
builtin3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/builtin3.C
164
utf_8
63766fb1bce3bab4ad17a59d07a272d2
// PR c++/11409 // { dg-do compile } namespace std { double fabs (double); } using std::fabs; double (*p) (double) = &fabs; // { dg-bogus "is ambiguous" "" }
google
android
template3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/template3.C
351
utf_8
77913297a13e3346eae87df8ebe54edd
// PR c++/33962 // { dg-do compile } template <class T> struct A; template <class U> void foo (const U &x, ...); template <class T> void foo (const A<T> &x, ...); void bar (const A<int> &x, const char *y) { foo (x, y); } /* { dg-final { scan-assembler "_Z3fooIiEvRK1AIT_Ez" } } */ /* { dg-final { scan-assembler-no...
google
android
ref-conv1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/ref-conv1.C
194
utf_8
dbdde512ef922a0ffbdf918206043c23
// PR c++/50442 template <typename T> struct MoveRef { operator T& () {} }; template <typename T> MoveRef <T> Move(T&) {} struct Thing {}; Thing foo(const Thing* p) { return Thing(Move(*p)); }
google
android
rvalue1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/rvalue1.C
168
utf_8
14e68b07c04d0b27c8221cd9eeab2703
// PR c++/42655 void unused(const bool &) { } int main() { volatile bool x = false; unused(!!x); // type of "!x" is bool unused(!x); // type of "!x" is bool }
google
android
new1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/new1.C
485
utf_8
833aac5f6258cba97d3336d9002e6c17
typedef __SIZE_TYPE__ size_t; void *operator new(size_t, unsigned int); struct X{ X(); X(int); }; void f(X *x = new X); // { dg-message "" } void f(X *x = new X(4)); // { dg-error "" } void f(X *x = new X[4]); // { dg-error "" } void f(X *x = new (3) X(6)); // { dg-error "" } void ...
google
android
operator4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/operator4.C
235
utf_8
dcdfcb2530eb653d4b7e6f556992d19d
// PR c++/38174 struct VolatileIntPtr { operator int volatile *(); }; struct ConstIntPtr { operator int const *(); }; void test_with_ptrs(VolatileIntPtr vip, ConstIntPtr cip) { bool b1 = (vip == cip); long p1 = vip - cip; }
google
android
virtual1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/virtual1.C
304
utf_8
f0e44977493ab0fe59f740f65a694211
// Test that explicit scope suprresses virtual lookup even after an // explicit object. extern "C" int printf (const char *, ...); struct A { virtual int f () { return 0; } }; struct B: public A { int f () { return 1; } int g() { return this->A::f(); } }; int main() { B b; return b.g(); }
google
android
member1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/member1.C
399
utf_8
53b4a1648421c533b9cf26423d529dc0
// { dg-do compile } struct X { template<typename T> static void ProcessProxy (); typedef void (*Callback) (); void Process (Callback); template<typename T> void Process () { Process (&ProcessProxy<T>); } }; void foo (X *x) { x->Process<int> (); }
google
android
defarg8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/defarg8.C
331
utf_8
5e9c0762b18e3b0d060a064fa92aafc7
// PR c++/60367 // { dg-do run { target c++11 } } extern "C" int printf (const char *, ...); extern "C" void abort(); void *p; struct foo { foo() { p = this; } foo (const foo &) { abort(); } ~foo() { if (p != this) abort(); } }; void do_something( foo f = {} ) { if (&f != p) abort(); } int main() { do_some...
google
android
rvalue3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/rvalue3.C
132
utf_8
e8d2b5f4633ed5ca39b035852658ba5d
// PR c++/50512 void foo (const char *const& s); template<typename C> void foo (const C& x) { x.a; } void f () { foo ("abc"); }
google
android
operator5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/operator5.C
705
utf_8
a2b70af6c5b898c49c8649dba57958e0
// PR c++/50858 class String { typedef struct ImplicitConversionFromWTFStringToBoolDisallowedA* (String::*UnspecifiedBoolTypeA); typedef struct ImplicitConversionFromWTFStringToBoolDisallowedB* (String::*UnspecifiedBoolTypeB); operator UnspecifiedBoolTypeA() const; operator UnspecifiedBoolTypeB() c...
google
android
extern-C-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/extern-C-1.C
299
utf_8
a251cb5e0f82a981b3f2cd7163bc4253
// PR c++/34691 namespace A { extern "C" void f(int = 5); // { dg-message "= 5" } } namespace B { extern "C" void f(int = 4); // { dg-message "= 4" } } using A::f; using B::f; int main() { void (*fp)(int) = f; // OK f(3); // OK f(); // { dg-error "default argument mismatch" } }
google
android
cond1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/cond1.C
385
utf_8
2808df88b455ae0dd789dc64c1e34b25
// Test that converting a COND_EXPR to void doesn't result in trying to // bitwise copy a class with a nontrivial copy constructor (and thus a // compiler abort). // { dg-options "-O" } struct A { virtual ~A() { } }; A a1, a2; inline A& one () { return a1; } inline A& two () { return a2; } inline void f (int i) {...
google
android
arg1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/arg1.C
336
utf_8
fb106edf83320ef2682b57be415f13ba
// { dg-do compile } struct A {}; struct B : A { B(int); B(B &); B(A); }; void foo(B); void bar() { foo(0); }
google
android
addr1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/addr1.C
713
utf_8
31a1eb67025f875651678e52a1e2b3d1
// { dg-do run } // PR c++/11788 we failed to instantiate a decl, and we lost some side // effects static int flag = 0; template <typename> struct A { A &active () { flag++;} static void foo() {} static void bar () {} static void bar (int) {} int m; }; void (*baz ()) () { A<int> a; return &a.activ...
google
android
ellipsis2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/ellipsis2.C
109
utf_8
c4735d674234a9aa4494c8b961facbb5
// PR c++/60253 struct A { ~A(); }; struct B { B(...); }; B b(0, A()); // { dg-error "cannot pass" }
google
android
ambig1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/ambig1.C
567
utf_8
7c686fa337e16b4168bbec2411734d98
// [over.best.ics]: For the purpose of ranking implicit conversion // sequences as described in _over.ics.rank_, the ambiguous conversion // sequence is treated as a user-defined sequence that is indistinguishable // from any other user- defined conversion sequence. struct A { A(long); A(char); }; struct B { B(...
google
android
defarg5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/defarg5.C
109
utf_8
a7bdff5fb030097fa47cc58ec7a9228f
// PR c++/39055 struct A { int i; // { dg-message "" } A() { void foo(int=i); } // { dg-error "" } };
google
android
operator6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/overload/operator6.C
585
utf_8
0acbc2855c72efb17bfcf35234e3c9b7
// PR c++/17805 // Per 13.3.1.2/3 bullet 2, an operator function is not a candidate // for overload resolution if neither argument is of class type and // neither enumerator-typed argument gets an exact match, with or // without reference binding, for the corresponding parameter. struct A { A(int); A(const char*)...
google
android
const2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/const2.C
86
utf_8
4db32f4d35d147ab0e7b83fc5a21a848
// PR c++/19878 struct S { char k; }; char const volatile S::* const p01 = &S::k;
google
android
new38
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new38.C
1,107
utf_8
efcc614bb7e3c095d4770fc7e50bea47
// { dg-do compile } void large_array_char(int n) { new char[n] [1ULL << (sizeof(void *) * 4)] [1ULL << (sizeof(void *) * 4)]; // { dg-error "size of array" } } template <typename T> void large_array_char_template(int n) { new char[n] [1ULL << (sizeof(void *) * 4)] [1ULL << (sizeof(void *) * 4)]; ...
google
android
pm2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pm2.C
60
utf_8
49c02c7ea8ff817fb850567f5e9bb9d8
struct S { S (); int S::* sp; int i; }; S s[2] = {};
google
android
lifetime2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/lifetime2.C
237
utf_8
9a639b6aec30981f552d544b9c3373f3
// PR c++/26714 // { dg-do run } extern "C" void abort(); bool ok = false; struct A { A() { } ~A() { if (!ok) abort(); } }; struct B { const A &a1; const A &a2; B() : a1(A()),a2(A()) { ok = true; } }; int main() { B b; }
google
android
aggr6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/aggr6.C
143
utf_8
769a94ec8a7e41cbb2ec24cc39f71dc1
// Origin PR c++/40239 // { dg-do compile } struct B { B() { } private: B(B const&); }; struct A { int a; B b; }; int main() { A a = {}; }
google
android
copy3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/copy3.C
199
utf_8
507c17431c10231f129d442ae2f706a2
// { dg-do run } // { dg-options "-fno-elide-constructors" } int copies; struct S { S () {} S (const S&) { ++copies; } }; S s[1] = { S () }; int main () { if (copies != 1) return 1; }
google
android
global1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/global1.C
338
utf_8
4c0fd932ebbc4629dbb229edf363e946
// PR c++/18416 class errarg { enum { EMPTY } type; public: errarg(); }; extern errarg empty_errarg; extern void errprint(const char *, const errarg &arg1 = empty_errarg, const errarg &arg2 = empty_errarg, const errarg &arg3 = empty_errarg); errarg::errarg() : type(EMPTY) { } erra...
google
android
array9
.C
toolchain/gcc/gcc-4.9/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
android
const5
.C
toolchain/gcc/gcc-4.9/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
android
constant1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/constant1.C
397
utf_8
56a9eccbb4c3fff84a7c2e812f9f8efa
// PR c++/51554 typedef unsigned char uint8; typedef unsigned int uint32; const uint32 XX[] = { 1, 3, 7 }; const uint8 V[] = { *(((const uint8*)&XX[0]) + 0), *(((const uint8*)&XX[0]) + 1), *(((const uint8*)&XX[0]) + 2), *(((const uint8*)&XX[0]) + 3), *(((const uint8*)&XX[1]) + 0), *(((const uint8*)&XX[1]...
google
android
self1
.C
toolchain/gcc/gcc-4.9/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
android
bitfield5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/bitfield5.C
82
utf_8
a501f3ca19411cb888e7821f67f96f1b
// PR c++/51219 struct A { int i; int : 8; }; void foo() { A a = { 0 }; }
google
android
pr25811
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr25811.C
4,997
utf_8
eb116cff6da10bc3f44b44377de9af76
// PR c++/25811 // { dg-do compile } struct A1 // { dg-message "implicitly deleted" "" { target c++11 } } // { dg-error "uninitialized" "" { target c++11 } 4 } { int const j; // { dg-message "should be initialized" } }; struct A2 // { dg-message "implicitly deleted" "" { target c++11 } } // { dg-e...
google
android
array28
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array28.C
139
utf_8
93d1f2b22f375dea4f3b14687d2d2b73
// PR c++/49669 struct Foo { explicit Foo(int) { } }; struct Goo { Goo() : x(Foo(4), Foo(5)) { } // { dg-error "array" } Foo x[2]; };
google
android
new41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new41.C
200
utf_8
cbd73e68a7e047fb1fead38045398b76
// PR c++/55446 // { dg-do run } struct S { S() { } }; int n = 1; void* operator new[](__SIZE_TYPE__) { n = -1; return &n; } int main() { new S[0]; if (n != -1) __builtin_abort(); }
google
android
ctor7
.C
toolchain/gcc/gcc-4.9/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
android
ptrfn3
.C
toolchain/gcc/gcc-4.9/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
android
new11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new11.C
396
utf_8
ebbaa62ec522ec3c21865701b3d83447
// PR c++/17670 // { dg-do run } #include <cstdlib> #include <new> bool abort_new; void *operator new[](size_t bytes) #if __cplusplus <= 199711L throw (std::bad_alloc) #endif { if (abort_new) abort(); return operator new (bytes); } struct X {}; int main () { // Do not abort until main is running in c...
google
android
aggr5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/aggr5.C
144
utf_8
b13f6872740c13eeb5b260b78e7c78dd
// Origin PR c++/40239 // { dg-do compile } struct B { B() { } private: B(B const&); }; struct A { int a; B b; }; int main() { A a = {0}; }
google
android
array11
.C
toolchain/gcc/gcc-4.9/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
android
value2
.C
toolchain/gcc/gcc-4.9/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
android
pr42844
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr42844.C
1,282
utf_8
066f1cead171149587cf59897ebf0fb8
// PR c++/42844 // { dg-do compile } struct A { A(){} }; struct B : A { int i; }; // { dg-message "user-provided default constructor" } struct C : A { int i; }; // { dg-message "user-provided default constructor" } struct D : B { D() {} }; struct E { int i; }; // { dg-message "user-provided default constructor" ...
google
android
volatile2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/volatile2.C
94
utf_8
f98e7ab2646951eca57b37b0ade8c12a
// PR c++/47003 struct A { A(int); }; volatile int i; int main() { A *q = new A (i); }
google
android
ctor5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor5.C
242
utf_8
a6128e1518e0ce6bdc30c0b7a23dfd18
// PR C++/21645 // We were crashing because we forgot to update the type for // the cloned argument for the cloned ctor. struct color { ~color(); }; struct style { color col; style (color); }; style::style(color c) { }
google
android
ctor4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor4.C
435
utf_8
1654b8f87bc2be2ab49384a76951eda0
// PR c++/17788 // { dg-do compile } class foo { public: foo(); }; class bar: public foo { // { dg-error "uninitialized" } // { dg-message "implicitly deleted" "" { target c++11 } 9 } private: int &a; // { dg-message "should be initialized" } }; foo::foo() { } int main(int argc, char **argv) { bar x; // ...
google
android
struct3
.C
toolchain/gcc/gcc-4.9/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
android
ref19
.C
toolchain/gcc/gcc-4.9/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
android
for2
.C
toolchain/gcc/gcc-4.9/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
android
new27
.C
toolchain/gcc/gcc-4.9/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
android
for1
.C
toolchain/gcc/gcc-4.9/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
android
pr42556
.C
toolchain/gcc/gcc-4.9/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
android
array1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array1.C
413
utf_8
92960aa3fba7b251d088910f7ca36c73
// Test that completing an array declared with a typedef doesn't change // the typedef. // { dg-do run } typedef int iArr[]; const iArr array4={ 1, 2, 3, 4 }; const iArr array3={ 1, 2, 3 }; const iArr array5={ 1, 2, 3, 4, 5 }; int main() { if (sizeof (array4)/sizeof (array4[0]) != 4 || sizeof (array...
google
android
ptrfn2
.C
toolchain/gcc/gcc-4.9/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
android
const4
.C
toolchain/gcc/gcc-4.9/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
android
elide2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/elide2.C
429
utf_8
e657849b9797c7df684fd4fafe1341d1
// PR c++/8674 // Bug: Since B().a is an rvalue, we tried to treat it like a TARGET_EXPR // and elide the copy. But that produces a bitwise copy, which causes us // to abort in cp_expr_size. // Test that we actually run the A copy constructor when calling f(). // { dg-do run } int c; struct A { A () { ++c; } ...
google
android
complex1
.C
toolchain/gcc/gcc-4.9/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
android
static-init1
.C
toolchain/gcc/gcc-4.9/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
android
struct1
.C
toolchain/gcc/gcc-4.9/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
android
init-ref4
.C
toolchain/gcc/gcc-4.9/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
android
static2
.C
toolchain/gcc/gcc-4.9/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
android
ref21
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref21.C
65
utf_8
9a5faac941462bf7541a81ebb5668997
struct A { const int &i1; const int &i2; }; A a = { 1, 2 };
google
android
brace6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/brace6.C
433
utf_8
f32cf83dbb93940c61ded4c32cb0fadf
/* PR c++/30759 */ /* { dg-do compile } */ struct A { A(int) { } }; struct B { B(const B&); int b; }; struct C {}; struct D { int c; }; int main() { int i = { 1 }; int j = { 1, 2 }; /* { dg-error "requires one element" } */ A a = { 6 }; /* { dg-error "initialize" "" { target { ! c++11 } } } */ ...
google
android
synth1
.C
toolchain/gcc/gcc-4.9/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
android
pr20039
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr20039.C
208
utf_8
aa579892dca36d8b110a8b13f1664a4a
// PR c++/20039 // { dg-do compile } struct M { M() : m(0) { } int m; }; struct X { M m; int i; }; int mymain() { const X *p = new const X[2]; // { dg-error "uninitialized const" } return 0; }
google
android
dtor4
.C
toolchain/gcc/gcc-4.9/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
android
array26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array26.C
127
utf_8
5f26b794d27564d1f002c6a0cd333681
// PR c++/42058 // { dg-options "" } struct A; struct B { A a; // { dg-error "incomplete type" } }; B b[1] = (B[]) { 0 };
google
android
ctor8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor8.C
204
utf_8
52dd8dfe6404e05cef6399f4b25568fe
// PR c++/29039 typedef struct S { // { dg-error "reference" "" { target c++11 } } int &r; }; // { dg-warning "'typedef' was ignored" } S f () { return S (); // { dg-error "reference|deleted" } }
google
android
ref1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ref1.C
52
utf_8
1b51fdd73c1758c6564cee1de0ae7aff
void f(void) { short x = 0; const int &y = x; }
google
android
const1
.C
toolchain/gcc/gcc-4.9/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
android
const6
.C
toolchain/gcc/gcc-4.9/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
android
init-ref3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/init-ref3.C
688
utf_8
c9be9788e0023890c93cbcdd3e3bcbd1
// { dg-do link } template <class T> class Ptr { protected: T * ptr; public: Ptr(void) : ptr(0) { } Ptr(T * p) : ptr(p) { } ~Ptr(void) { delete ptr; } operator T & () { return *ptr; } }; class base { public: base(void) { } ~base(void) { } }; class foo : public base { private: foo(const foo & r...
google
android
pr43719
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/pr43719.C
3,913
utf_8
95729a9174015584f1d2ee154d2815f6
// PR c++/43719 // { dg-do compile } struct A1 // { dg-error "uninitialized" "" { target c++11 } } { int const j; // { dg-message "should be initialized" } }; struct A2 // { dg-error "uninitialized" "" { target c++11 } } { int const volatile i; // { dg-message "should be initialized" } }; struct A3 // { dg-error "u...
google
android
new35
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new35.C
391
utf_8
b00cbbf0a7198ffe55206723b3837c1a
// { dg-do compile } // { dg-options "" } int main (int argc, char **argv) { typedef char A[argc]; new A; // { dg-warning "array" } new A[0]; // { dg-error "must be constant|not a constant" } new A[5]; // { dg-error "must be constant|not a constant" } new (A[0]); // { dg-error "must be constant|not a constan...
google
android
byval1
.C
toolchain/gcc/gcc-4.9/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
android
array20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array20.C
77
utf_8
05bc363be69870e155aaf88f43671076
// PR c++/27385 struct A {}; A a[] = { 0 }; // { dg-error "initializer" }
google
android
new2
.C
toolchain/gcc/gcc-4.9/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
android
value3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/value3.C
541
utf_8
f5892df2ecb52226b652c40258f42f73
// Testcase for value-initialization in new-expressions. // { dg-do run } #include <stdlib.h> #include <string.h> // Make sure that we return memory that isn't already set to 0. void *operator new(size_t s) { void *p = malloc (s); memset (p, 42, s); return p; } struct A { A() {} ~A() {} }; struct B { A a; int ...
google
android
new7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new7.C
131
utf_8
625c88e7ce2f57c2f27e69085c8278eb
template <class T> struct Foo {}; template <class T> void Foo<T>::NON_EXISTENT(int* val = new int()) {} // { dg-error "" }
google
android
array12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/array12.C
472
utf_8
cdd8bcf2d0f951ea0f042ff962ed9854
// PR c++/12253 // Bug: We were failing to destroy the temporary A passed to the // constructor for b[0] before going on to construct b[1]. // { dg-do run } extern "C" int printf (const char *, ...); int c; int r; struct A { A() { printf ("A()\n"); if (c++) r = 1; } A(const A&) { printf ("A(const A&)\n"); ++c; ...
google
android
const8
.C
toolchain/gcc/gcc-4.9/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
android
ctor3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/ctor3.C
74
utf_8
5922ec5514343fd09b90bff2a9853e0d
// PR c++/14401 struct S { S() {} // { dg-error "" } const int i; };
google
android
copy1
.C
toolchain/gcc/gcc-4.9/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
android
new6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new6.C
178
utf_8
6142030ce76d1ab9453ff0a223722577
// { dg-options "-fkeep-inline-functions" } struct B1 { virtual ~B1(); }; struct B2 { virtual ~B2(); }; struct D : B1, B2 {}; struct X : D { X (); }; X::X () { new int; }
google
android
new4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/init/new4.C
25
utf_8
19dcda79922ea7017c7e260394e77415
int *x = new int [2] ();
google
android
placement5
.C
toolchain/gcc/gcc-4.9/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...