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
warning9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning9.C
143
utf_8
314bec1817ea9c903efde451dc59d8d7
// { dg-do assemble } // { dg-options "-Wsynth" } struct A { operator int (); A& operator= (int); }; int main() { A a, b; a = b; }
google
android
loverload
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/loverload.C
177
utf_8
75b7b63d61aa5a12a7c99bafc30510e4
// { dg-do assemble } // Bug: g++ can't deal with multi-language overloading. extern void foo (int, int); extern "C" void foo (int); void bar () { foo (1); foo (1, 2); }
google
android
rfg3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg3.C
261
utf_8
f09660c79805379617f5d3f5b0e40aab
// { dg-do assemble } // Bug: g++ remembers the members of OUTER and complains about the second // definition. void test () { { struct OUTER { struct INNER { int mbr; } member; }; } { struct OUTER { struct INNER { int mbr; } member; }; } }
google
android
scoping12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C
180
utf_8
d1954ebe3a67f4b2f5b6d9496d8c54c6
// { dg-do assemble } void f () { struct A { friend void g (); // { dg-error "without prior declaration" } }; } void h () { g (); // { dg-error "" } no g in scope }
google
android
rfg22
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg22.C
105
utf_8
8875c6edb176eec38e733ab2235a57cc
// { dg-do assemble } static void f (); // { dg-error "" } used but not defined void g () { f (); }
google
android
enum6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/enum6.C
1,033
utf_8
c5bb9e289473c1ecfa94a5d9ccb1cd3e
// { dg-do run } // { dg-options "-fshort-enums" } // On ARM EABI targets this testcase will cause a warning to be emitted // whilst EABI attributes are being merged at link time unless // the --no-enum-size-warning option is passed to the linker. Whilst the // enum-size attributes should only be emitted if there are...
google
android
conversion10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion10.C
326
utf_8
dfd087ab7ea4ac1c97296c141f23693b
// { dg-do assemble } // PRMS Id: 9019 // Bug: g++ doesn't find conversion to const char *. struct String { String (); explicit String (const char *); operator const char * (); }; int main(int argc, char **argv) { String deflt("no args"); String useme; const char *p = (argv[1]) ? argv[1] : deflt; return...
google
android
member
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/member.C
644
utf_8
c9185ef2db7e02de1682960f4077daaf
// { dg-do assemble } // GROUPS passed member-pointers error-reporting struct Y { struct X { int A; int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "" } foo().* int bar () { return A; } }; }; int Y::X::* foo () { undef2(1);// { dg-error "" } foo().* return &Y::X::A; } ...
google
android
scoping16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping16.C
102
utf_8
844cb7fc79609a22270eddb3247cf498
// { dg-do assemble } struct A { int a(); // { dg-message "" } int a; // { dg-error "" } };
google
android
access4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access4.C
185
utf_8
6fa0e7cdc3cb39d7576c0c530be039f8
// { dg-do assemble } // Simple testcase for access control. class A { protected: static int i; }; class B: public A { }; class C: public B { public: void g () { B b; b.i; } };
google
android
local
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/local.C
546
utf_8
62d91c6f901a8815cfc31c1c81d4258d
// { dg-do assemble } // General testcase for local classes. int x; void f () { static int s; int x; // { dg-message "" } referenced below extern int q(); struct local { int g() { return x; } // { dg-error "" } automatic variable int h() { return s; } // { dg-bogus "" } local class int k() { re...
google
android
pmf9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmf9.C
1,174
utf_8
8171159f376db7eadc528db5c33bbb00
// { dg-do assemble } // PRMS id: g++/13340 class rectangle { public: rectangle(); int overlaps() const; }; class region { friend class region_impl; public: region(); typedef int (region::* region_func)() const; }; class region_impl { friend class region; private: rectangle content, m...
google
android
parse5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse5.C
334
utf_8
02875bdd475681b788e0144e6ec00b4a
// { dg-do assemble } // Bug: foo (bar) should be a declaration of a static data member, not a // function; it's getting caught by the rules for constructors. typedef int foo; typedef int bar; struct A { static foo (bar); // { dg-bogus "" } }; int i = A::bar; // { dg-bogus "" } int (*fp)(bar) = A::foo; // { d...
google
android
method
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/method.C
203
utf_8
4fcfb4093f45e28038d3d015bc524bf8
// { dg-do assemble } // Bug: pointer to pointer is treated as plain pointer. // PRMS Id: 1767 class Foo { public: void method(); }; void func(Foo ** ppFoo) { ppFoo->method(); // { dg-error "" } }
google
android
lvalue2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C
355
utf_8
c1cda7bbd046edda77bc40c19bc41db7
// { dg-do assemble } // PRMS Id: 4892 // Bug: COND_EXPRs, MODIFY_EXPRs and COMPOUND_EXPRs aren't properly recognized // as lvalues. extern int foo; int& f (int& a, int& b) { return (foo ? a : b); // { dg-bogus "" } } int& g (int& a) { return (a = 0); // { dg-bogus "" } } int& h (int& a, int& b) { return ...
google
android
friend
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/friend.C
290
utf_8
1f61a4b59ffc25bde8862e71c60b56be
// { dg-do run } // Bug: g++ doesn't keep track of the lexical context of friends properly. extern "C" void exit(int); struct B; struct A { static void f () { exit (1); } }; struct B { static void f () { exit (0); } friend void g (B) { f (); } }; int main () { B b; g (b); }
google
android
overload5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload5.C
161
utf_8
2f67e9889926260a4efa461f431eb8dd
// { dg-do assemble } // Testcase for simple overloading resolution. int foo (); // { dg-message "" } void foo (); // { dg-error "" } disallowed overload
google
android
overload4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload4.C
150
utf_8
d8248eb864fb06ec9353707e9d4732bb
// { dg-do assemble } // Testcase for simple overloading resolution. void foo (int); void foo (int, int); void bar () { foo (1); foo (1, 2); }
google
android
cast2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/cast2.C
259
utf_8
829f550c8d2621712f469e117f58a2ec
// { dg-do assemble } // The compiler tried to build up a double with a NOP_EXPR from // integer_zero_node, which fails. template <class T> class vector { public: vector (int n, const T& value = T()) {} }; void foo (void) { vector<double> v (10); }
google
android
conversion11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C
682
utf_8
206d1a45e562f832de364d33cb34a7f4
// { dg-do assemble } // PRMS Id: 8805 // Bug: The two-level conversion is not found when calling a global fn. class Int { public: Int(int A); }; class Ding { public: Ding(Int A); }; class Something { public: void DoSomething(Ding A); // { dg-message "Something::DoSomething|no known conversion" } referred to ...
google
android
scoping14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping14.C
209
utf_8
d49d9ed9b505bcd76004260d7a7ececa
// { dg-do assemble } // [class.scope0]: The scope of a name declared in a class consists // ... also of all ... default arguments ... in that class .... struct A { void f (int A::* = &A::i); int i; };
google
android
overload23
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload23.C
458
utf_8
a9d1014c3fd283f29e67f5958d0ddb77
// { dg-do assemble } // Date: Mon, 6 Jun 94 13:39:25 EDT // Subject: Problem with operator overloading class ostream { public: ostream& operator<<(double n); ostream& operator<<(float n); }; class X { public: operator long() const; operator double() const; }; ostream& operator<< (ostream& os, const X& x); int...
google
android
binding3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/binding3.C
337
utf_8
7c9d834c7d8786f219380c03f191c202
// { dg-do assemble } // Bug: g++ fails to clear out the IDENTIFIER_CLASS_VALUEs of various names // after a class definition. struct A { typedef double T; virtual T f () = 0; }; class B { B (const B&); void operator=(const B&); public: B (); typedef void * T; }; struct C : public A { T f (); // { d...
google
android
rfg1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg1.C
176
utf_8
c107b85655e25ea65c92d3bf5c5f8f9c
// { dg-do assemble } // Bug: g++ parses the declaration of i as a functional cast. void take_int (int arg) { } void test () { int (i); i = 0; take_int (i); }
google
android
ctor1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ctor1.C
211
utf_8
f758c99c01bf1e42fad8ce9ff974dad2
// { dg-do run } // PRMS Id: 5584 extern "C" { struct xx { void (*xx)(void); int x,y; }; } int r = 1; void f(void) { r = 0; } int main() { struct xx p; p.xx = f; p.xx(); return r; }
google
android
rvalue3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rvalue3.C
128
utf_8
bd2c9ff6e75478ef5092aa30ce900eff
// { dg-do assemble } int main () { int i; int &ir = (int&)(int)i; // { dg-error "" } casting rvalue to reference type }
google
android
template8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template8.C
186
utf_8
bf9b9e774390745b6524aacd80dda893
// { dg-do assemble } // PRMS Id: 4827 class A; template <class T> int f (const T&, const A *); int g (const int& a) { return f (a, (A *)0); // { dg-bogus "" } failed unification }
google
android
dtor2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/dtor2.C
205
utf_8
825c81ed88e11a6d3a68a8d7854afacd
// { dg-do run } // PRMS Id: 5163 // Bug: g++ doesn't accept the explicit destructor call syntax for templates. template <class T> struct A { }; A<int> a; int main() { a.~A(); // { dg-bogus "" } }
google
android
conversion8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion8.C
125
utf_8
1e7bb44d3765e5f813c41d5a36ba88cf
// { dg-do run } // PRMS id: 8279 int main () { char *const *p = 0; char **q = 0; (void)(p - q); (void)(q - p); }
google
android
inline
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/inline.C
411
utf_8
a0e1b6eb3991c100ca8ff0b3b67ef383
// { dg-do run } // PRMS Id: 4341 // Bug: Instantiating a template in the middle of processing the functions // from another template screws up lineno/input_filename. #pragma implementation "C.h" #line 1 "A.h" #pragma interface template <class T> class A {}; #line 1 "C.h" #pragma interface template <class T> class C ...
google
android
template39
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template39.C
294
utf_8
1ef0ca563dd56e9475343428fa1d8a6b
// { dg-do assemble } // PRMS Id: 10283 template <class T> struct B { static void (*p)(); static void f (); }; template <class T> void (*B<T>::p)() = &B<T>::f; B<int> b; template <int i> struct A { static const int j = i; int k[j]; }; A<1> a; template <int i> const int A<i>::j;
google
android
overload16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload16.C
244
utf_8
92664cdd582a9b6920baf689558c2ec3
// { dg-do assemble } void f (int); // { dg-message "note" } void f (long); // { dg-message "note" } int main() { f (1 & 0xffffff00UL); // { dg-error "ambiguous" } // { dg-message "candidate" "candidate note" { target *-*-* } 6 } }
google
android
temporary2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C
680
utf_8
ac7b40c0384abf1bd83be1bcd1a5f522
// { dg-do assemble } class X // Indentation has been done so to see the similarities. { public: X() {} // { dg-message "note" } referenced below X(X& x) {x.i=7;} // { dg-message "note" } Both functions modify the void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x. int i; }; X fo...
google
android
condexp
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/condexp.C
183
utf_8
fc4a6af03c5197badf1546ba01faa800
// { dg-do assemble } // PRMS id: 5629 struct String { const char *x; }; class Pathname: public String { }; String f(int i) { Pathname p; String s; return i ? p: s; }
google
android
opeq
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/opeq.C
748
utf_8
5ffddebe82794ada567fae406a67baf5
// { dg-do run } // PRMS Id: 4297 (related to 3525) // Bug: Generating default op= didn't set TYPE_HAS_ASSIGNMENT, so it wasn't // found. extern "C" int printf (const char *, ...); class Y { public: Y(const char*) {} Y& operator = (const Y&) { return *this; } }; class X { public: X(int v, const ch...
google
android
tredecl3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tredecl3.C
209
utf_8
bb1e0f3963c848d63c1da72405f295ce
// { dg-do assemble } // PRMS Id: 4679 // Bug: redeclaration of templates erases the definition. template <class T> class Foo { public: void h(); }; template <class T> class Foo; void g() { Foo<int> f; }
google
android
template35
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template35.C
216
utf_8
d0e4ae132818153928f40bc2612f14f8
// { dg-do assemble } // Bug: instantiation of D() corrupts declaration of basis[]. struct B { }; template <int t> struct D : public B { D() : B () { } }; B const * basis[] = { new D<0>, new D<1>, };
google
android
cleanup2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/cleanup2.C
354
utf_8
5b6b6a6852bc47d56991bf44f3d18df8
// { dg-do assemble } // PRMS Id: 6303 // Bug: compiler crashes processing the cleanup for arrayOfClass. class Klasse { public: ~Klasse(); // This dtor MUST be declared to generate the error... }; Klasse varOfClass; int main() { // This MUST be 'const' to generate the error... const Klasse arrayOfClass[1] = ...
google
android
net
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/net.C
211
utf_8
b4daf2a06948651dda4874d838e4ce74
// { dg-do assemble } // Bug: g++ doesn't instantiate function templates in instantiate_type. template <class T> void fn (T t) { } template <class T> struct A { void (*p)(T); A() { p = fn; } }; A<int> a;
google
android
pmf8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmf8.C
480
utf_8
17b06c23ea1952b3e572cbc70a4c911f
// { dg-do run } // PRMS Id: 6905 class Parent { public: void DoSomething() { return; } int i; }; class Child : public Parent { public: }; class User { public: void DoAnyThing(void (Parent::*)(void)) { return; } void DoAThing(void (Child::*)(void)) { return; } void DoAThing(int Child::*) { return; } }; ...
google
android
pmf4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmf4.C
221
utf_8
b3db09b7cd9a1af401831695d40bab7b
// { dg-do assemble } // PRMS Id: 4484 (bug 5) // Bug: g++ can't convert between pmf types. class A; typedef void (A::*pmf)(); typedef void (A::*pmfc)() const; pmfc p = (pmfc)(pmf)0; // { dg-bogus "" } pmf conversion
google
android
ref9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref9.C
377
utf_8
fb8ee4111550f7c7dd3d408557af7094
// { dg-do run } // Bug: g++ re-evaluates the initializer for r before calling f(); since i has // changed to an invalid index, this breaks. class C { public: void f () { } }; void foo (C * objs[]) { int i = 0; C & r = * objs[i]; /* make reference to element */ i = 666; r.f (); /* core dumps here */ } i...
google
android
typeid1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
286
utf_8
188c8510bf00a86d5eafaf2d0bc5eb8a
// { dg-do compile } #include <typeinfo> #include <iostream> struct foo { double f(int); }; int main() { double f (int); const std::type_info &r = typeid (f); std::cout << typeid(f).name() << std::endl; std::cout << typeid(foo::f).name() << std::endl; /* { dg-error "" } */ }
google
android
pmem
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmem.C
226
utf_8
ec5eff12ccb92d8e588374b0048d3c28
// { dg-do assemble } // Bug: g++ parses the declaration of 'char A::* foo' below as a // declaration of 'char A'. class A { }; typedef int foo; void f () { char A::* foo; foo = 0; // { dg-bogus "" } parsing blunder }
google
android
enum7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/enum7.C
271
utf_8
81d5f64e78075ecaa09fbb1722bad849
// { dg-do assemble } // Yet Another testcase for signed/unsigned enums. enum A { AA = 0, AB = 1}; enum B { BA = -1, BB = 1}; void set(int a); void set(long a); void foo() { set(AA); // { dg-bogus "" } why is this ambiguous set(BA); // when this is not amibguous }
google
android
access23
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access23.C
1,710
utf_8
35741288d1515537d02786e97fa11639
// { dg-do assemble } // PRMS Id: 9127 // Bug: members of anonymous unions are not access-controlled. #include <stdio.h> struct Foo { public: union { long A; void *pX; }; union X { long A; void *pX; } PUB ; int PUB_A; protected: union { long B; // { dg-error "" } protected void *p...
google
android
anon3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/anon3.C
432
utf_8
3c9216120f190b77a1d7b69a45f4d65b
// { dg-do assemble } // Bug: g++ dies. class cl { public: cl(); void set(void *, char *, int); private: union { float vf; struct ff { // { dg-error "" } nested class in anonymous union void *ptr; char *name; int sz; } *vff; }; }; void cl::set(void *p, char *n, int sz) { vff...
google
android
offset2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/offset2.C
278
utf_8
0ba1f119f97556fe052d9276e19e0b77
// { dg-do run } // PRMS Id: 5070 (testcase 2) int status = 1; struct foo { foo& operator= (const foo&) { status = 0; return *this; } }; struct xx { foo a; }; struct yy : public xx { yy(foo& a) { xx::a = a; } }; int main() { foo f; yy y (f); return status; }
google
android
const3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/const3.C
145
utf_8
624aa36167be040c711e66d6403a843b
// { dg-do run } // Bug: bar isn't emitted, which causes havoc. extern int i; const int bar = i; int i = 5; int main() { return bar != 5; }
google
android
synth6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/synth6.C
245
utf_8
9cda96e5a3529fa8c5751e281ac0a598
// { dg-do assemble } // Bug: g++ tries to generate an op= for DbmItem and fails. class RefCount{ public: RefCount(); private: RefCount& operator=(const RefCount); }; class DbmItem: public RefCount{ public: DbmItem(): RefCount() {} };
google
android
overload17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload17.C
305
utf_8
37a0b3d044128b7ad11ac5a7928b6b68
// { dg-do assemble } // Bug: g++ fails to prefer UDC's alone to UDC's plus standard conversions. struct B { }; struct D: public B { }; struct DP { operator D * () const; operator double () const; }; void f (B *); void f (D *); void g (double); void g (float); void h (DP p) { f (p); g (p); }
google
android
warning5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning5.C
406
utf_8
a527d9d80c0f8b1b8cc068fbe97dd294
// { dg-do run } // { dg-options "-Wall" } // PRMS Id: 5135 // Bug: g++ complains that the result of the new expression is not used. extern "C" int printf (const char *, ...); inline void * operator new (__SIZE_TYPE__, void *p) { return p; } class foo { public: foo() : a(42) {}; int a; }; int main() { char bu...
google
android
overload30
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload30.C
220
utf_8
17530076e02c91c8244aff7a2eaac36e
// { dg-do assemble } // PRMS Id: 6412 class Foo; template <class F> class Temp { F func_; public: Temp (F f) : func_(f) {} }; template <class T> T* func1 (T* t) { return t; } Temp<Foo*(*)(Foo*)> temp2(func1);
google
android
access22
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access22.C
303
utf_8
3e06c58fbaf584a9dd8137542a79f1e3
// { dg-do assemble } // PRMS Id: 8518 // Bug: Call to foo is not checked for accessibility class A { private: static void foo() {} // { dg-error "" } public: void goo() {} }; struct B : public A { void func() { foo(); } // { dg-error "" } }; int main() { B b; b.func(); }
google
android
bool
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/bool.C
884
utf_8
9b9ae08364d88d05090a55ccbf561424
// { dg-do assemble } // Testcase for uses of bool. int i,j,k; /* Check that types of certain expressions are bool. */ void f () { i ? j == k : true; i ? j < k : true; i ? j && k : true; } /* Check that g++ can find a conversion to bool when one exists. */ struct A { operator char * (); } a; struct B { oper...
google
android
overload28
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload28.C
290
utf_8
dca24dfe67a3fcbe211eea7fdcc3e1b4
// { dg-do assemble } // PRMS Id: 6056 struct Foo { Foo() { } // { dg-message "note" } Foo(int i = 25) { } // { dg-message "note" } }; int main() { Foo* f1 = new Foo(); // { dg-error "ambiguous" } // { dg-message "candidate" "candidate note" { target *-*-* } 11 } }
google
android
pmf7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmf7.C
362
utf_8
841637bdd1bf4e8fb59bbe43bff3870a
// { dg-do run } // PRMS Id: 6486 // Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes // with the number of calls to foo. int c; struct A { void f () {} virtual void g () {} }; A& foo () { static A a; ++c; return a; } int main () { void (A::*p)() = &A::f; (foo ().*p)(); p = &...
google
android
access11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access11.C
246
utf_8
73bee83984e8dc7967e6200b9252e0b7
// { dg-do assemble } // PRMS Id: 4900 // Bug: g++ doesn't apply access control uniformly to type conversion operators struct A { protected: operator int * () const; }; struct B : public A { int * foo () { return A::operator int *(); } };
google
android
template22
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template22.C
463
utf_8
2f3651d76c789297326057ff5b1d0bbf
// { dg-do assemble } // Testcase for proper unification of code involving references. template<class T> struct A { void foo(); }; template<class T> void A<T>::foo() { } template class A<int&>; const int& f1 (); int& f2 (); int f3 (); template <class T> void g1 (const T&); template <class T> void g2 (T&); tem...
google
android
enum2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/enum2.C
125
utf_8
40709fda41cada7eee5228b625340a33
// { dg-do assemble } enum tristate { no = -1, maybe, yes }; void foobar () { tristate var = no; // { dg-bogus "" } }
google
android
tempinst1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tempinst1.C
469
utf_8
53ac07097be9bf3d20cdf6763ff25482
// { dg-do link } // { dg-options "-g" } // Bug: g++ fails to instantiate operator<<. struct ostream { ostream& operator<< (const char *) { return *this; }; }; template <class T> class foo; template <class T> ostream& operator<< (ostream& ios, foo<T>&obj) {return ios;} template <class T> class foo { friend ost...
google
android
temporary4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/temporary4.C
448
utf_8
6101f026315976121bdd39bc042b0790
// { dg-do run } // Bug: g++ initializes both B::i and B::j before destroying any temps. extern "C" int printf (const char *, ...); int c = 0; int d = 0; int r = 0; struct A { A() { if (c != d) r = 1; ++c; } A(const A&); // declare so g++ returns A on the stack ~A() { ++d; } operator int () { return 0; } }...
google
android
template42
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template42.C
234
utf_8
a38dfe63aedc2cf73a44464a7ca9b564
// { dg-do run } // Testcase for not evaluating template default args if they are // never used. struct X { X(int) { } }; template <class T> struct A { void f (T t = T()) { } }; int main () { A<X> a; X x (1); a.f (x); }
google
android
synth4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/synth4.C
192
utf_8
ea8042d89263119cda4cd2cae5144404
// { dg-do assemble } struct X { X(); }; typedef void (X::*mfp)(); struct Y { Y(); mfp memfp; }; void f() { Y *y1, *y2 ; *y1 = *y2; // { dg-bogus "" } failed to synthesize op= }
google
android
ambig1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ambig1.C
290
utf_8
73989b3452d2816b82b699381496d741
// { dg-do assemble } // { dg-options "-pedantic-errors" } // Testcase for ambiguity between functional cast and abstract declarator. // This ambiguity accounts for 6 of the r/r conflicts. int i = sizeof (int ()); // { dg-error "" } sizeof applied to fn type int j = sizeof (int () + 1);
google
android
access5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access5.C
173
utf_8
4f5487852e19f0bcc0bfdfa34fe26a75
// { dg-do assemble } // Simple testcase for access control. class A { protected: void f (); }; class B : public A { }; class C : public B { void f () { B::f(); } };
google
android
overload19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload19.C
206
utf_8
e6e5909df623569b8a1afa024082f0a4
// { dg-do run } // PRMS Id: 4689 // Bug: g++ doesn't notice operators overloaded on enumeral types. enum E { A=5, B=32, C=100 }; E operator|(E a, E b) { return C; } int main() { return (A|B) != C; }
google
android
ref4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref4.C
53
utf_8
43751a5e4f31248344cd47c1c8c4083e
// { dg-do assemble } void f (); void (&fr)() = f;
google
android
access14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access14.C
182
utf_8
fc7024cb5dd1a33dd44ce329ef578d0c
// { dg-do assemble } template <class T> struct A { T t; }; template <class T> class B: private T { public: T::t; // { dg-warning "deprecated" } }; template class B<A<int> >;
google
android
rfg4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg4.C
253
utf_8
85af30973ecd2ec16aeb9f8987fab9b4
// { dg-do assemble } // { dg-options "-ansi -pedantic-errors -w" } // Bug: f1 and f2 are treated as overloaded when they aren't. int i; void f1(double) { } void f2(double) { } void test () { i ? f1 : f2; // { dg-bogus "" } improper overloading }
google
android
cleanup
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/cleanup.C
360
utf_8
8609815143db722bd4431a37f59bb8dd
// { dg-do run } // Bug: continue over object decl calls destructor but not constructor. int c = 0; int d = 0; extern "C" int printf(const char *,...); class Foo { public: Foo(){ c++; } ~Foo(){ d++; } }; int main() { for(int i=0;i<2;i++){ continue; Foo bar; } printf ("%d %d\n", c, d); if (c == d...
google
android
anon4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/anon4.C
208
utf_8
0f6b640e9b92540551a77f97d30556b8
// { dg-do assemble } // { dg-options "-O" } // PRMS Id: 5371 // Bug: g++ screws up the alignment of buff and dies. main() { union { double a; char buff[sizeof(double)]; }; void *p = buff; }
google
android
overload31
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload31.C
418
utf_8
a610aa2bc2e1d6775c911914159426ea
// { dg-do assemble } // PRMS Id: 6568 // Bug: g++ complains about the ambiguous conversion to bool even though // we wouldn't end up using it anyway. class AString { public: AString (unsigned len); operator char *() const; operator char const *() const; }; void foo(unsigned t, AString const & handle) { ...
google
android
rfg11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg11.C
85
utf_8
c01631c31e11d4cc9155124ca3be92ad
// { dg-do assemble } typedef int int; /* { dg-error "" } trying to redefine int */
google
android
rfg20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg20.C
182
utf_8
31f1d32ed45bdf803e58cabd83fd7b90
// { dg-do assemble } typedef void func_type (); func_type *fp; void *vp; void example () { vp != fp; // { dg-error "forbids comparison" } no conversion from pfn to void* }
google
android
warning4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning4.C
300
utf_8
75b0ada46a8aed6045f5f3ca90df1184
// { dg-do assemble } // { dg-options "-Woverloaded-virtual" } // Bug: a virtual function with the same name in an unrelated class will // cause a bogus overloading warning. struct A { virtual void foo (); }; struct B { virtual void bar (); }; struct C: public A { virtual void bar (); };
google
android
access20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access20.C
586
utf_8
93396a527b94b7c75ed7f8d6c9052bab
// { dg-do assemble } // PRMS Id: 6662 // Bug: we crash trying to check the access on anglesSinesCosines. #define Double double class GCTransform { protected: struct angle { Double phi1 ; Double phi2 ; } ; struct sineAndCosine { Double cosine1 ; Double cosine2 ; Double sine1 ; Double sin...
google
android
scoping10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C
433
utf_8
73d8543703e82d2dcfa9e76b712a9f0f
// { dg-do assemble } // Test for scope-based hiding of functions. void f (char *); struct A { void f (); // { dg-message "A::f|candidate expects" } referred to }; struct B : public A { void g (char *); void h () { extern void g (); // { dg-message "" } f("foo"); // { dg-error "" } hidden // ...
google
android
tempover
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tempover.C
212
utf_8
e52640ce299bfcc91181e32b0d6c3b88
// { dg-do assemble } // GROUPS passed templates overloading #define TEMPL template <class T> class B {}; TEMPL class A : virtual public B { public: A(int); }; TEMPL A<T>::A(int){} A<double> a(1);
google
android
crash1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/crash1.C
184
utf_8
35f6ed93fa63b9db22cde011b976421d
// { dg-do assemble } int i = 4; struct S{ char c[i]; // { dg-error "" } size not constant int h; int foo(){ return h; } }; int main() { S x; int i = x.foo(); }
google
android
sts_iarr
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/sts_iarr.C
823
utf_8
882a58f5a489b16575709320c8d71752
// { dg-do run } // egcs-bugs 999-02-22 14:26 Stefan Schwarzer // should compile and return 0 template <int N> struct Outer{ struct Inner{ Inner(int n): sum(n){} typename Outer<N-1>::Inner operator[](int n) const { return typename Outer<N-1>::Inner(sum + n); } int sum; }; typename Outer<N-1>::I...
google
android
access1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/access1.C
157
utf_8
99f229ca2e8b470ed7c34283d8fc4e1a
// { dg-do assemble } class A{ public: enum Foo{f1,f2}; class B{ friend class A; Foo f; public: B():f(f1){} }; };
google
android
conv1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/conv1.C
115
utf_8
6c8edde09ed94b46e6c9fdec33f669e8
// { dg-do run } struct S{ operator bool() { return true; } }; int main() { S a; if (S &b = a); }
google
android
sts_vectini
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C
757
utf_8
0b908e167eab8ad4a9de653fb70fdfe2
// { dg-do run } // { dg-options "-O2 -w" } // egcs-bugs 1999-02-22 14:24 Stefan Schwarzer // optimizer problem in egcs <= 1.1.1 struct XTVec{ XTVec(){x[0]=x[1] =x[2] =0;} XTVec(int ax,int y=0.,int z=0.){x[0]=ax;x[1]=y; x[2]=z; } int& operator[](int); int x[3]; }; inline int & XTVec::operator[](int i){ retu...
google
android
pure1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/pure1.C
261
utf_8
3abfff206eac2eebf18679f40e8098fd
// { dg-do assemble } class A { public: virtual void f(void) = 0; // pure virtual function. A() {f();} // { dg-warning "const" } called in a constructor ~A() {f();} // { dg-warning "destr" } called in a destructor };
google
android
pmf1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/pmf1.C
347
utf_8
48a5f2cf28d6fed53bd37f93a37d127f
// { dg-do run } // Check for pointer-to-virtual-function calls on // bases without virtual functions. struct B{}; struct D: public B{ virtual void foo(); }; void D::foo(){} int main() { B *b = new D; void (B::*f)() = static_cast<void (B::*)()>(&D::foo); (b->*f)(); }
google
android
eval1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/eval1.C
257
utf_8
1fcbe469d9287f683e48ab8325c6dc60
// { dg-do run } // Postfix expression must be evaluated even if accessing a static member. struct S { static int i; S* foo(); }; S* S::foo(){ i = 0; return this; } int S::i = 1; int main(void) { S * s = new S; int k=(s->foo())->i; return k; }
google
android
typedef2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/typedef2.C
218
utf_8
3417e4fca62d5ea6c569632aad6943e9
// { dg-do assemble } // Check implicit conversion from string constants into typedefs typedef char CHAR; void f2(CHAR *s=""); // { dg-warning "deprecated" }
google
android
sts_partial
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/sts_partial.C
273
utf_8
6559759743eb2199fa9006b098433139
// { dg-do run } // ecgs-bugs 1999-02-22 14:26 Stefan Schwarzer // partial ordering problem in egcs <= 1.1.1 template<class T> int f(T &){ return 1; } template<class T> int f( T[] ){ return 0; } int main(){ int d[] ={2}; return f(d); }
google
android
sts_conv
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/sts_conv.C
427
utf_8
b3ef74ff27c2ba57a74b34bb37147ee9
// { dg-do run } // ecgs-bugs 1999-02-22 14:21, Stefan Schwarzer // this code should compile quietly class CArray { public: operator double* (){ return a; } // works if we comment this line: operator double* () const { return const_cast<double *>(a); } private: double a[2]; }; int main(){ CArray...
google
android
pmf2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/pmf2.C
328
utf_8
45900dcbe065b97983fa9607056287f8
// { dg-do run } // { dg-options "-Wno-pmf-conversions" } // Test conversion of pointers to virtual member functions to // pointers to non-member functions. struct A{ int i; A () :i(1){} virtual void foo(); }a; void A::foo() { i = 0; } int main() { void (*f)(A*) = (void(*)(A*))(&A::foo); f(&a); return...
google
android
overload1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/overload1.C
176
utf_8
cbc1074c24be7acf9a3d5e06f47f9987
// { dg-do run } //Overload resolution should consider both declarations of func identically. struct S{}; void func(S&){} int main() { void func(S&); S s; func(s); }
google
android
new1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/new1.C
1,890
utf_8
ba8a347349b1bb0043c7d42249c8fd24
// { dg-do run } //Lifetime of temporaries: //egcs 2.92 performs cleanup for temporaries inside new expressions //after the new is complete, not at the end of the full expression. #include <new> #include <cstdlib> #include <cstdio> bool new_throws; bool ctor_throws; int new_done; int ctor_done; int func_done; int ...
google
android
bitset1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/bitset1.C
157
utf_8
bbcf18896f3a1d744cf356a0a66cd95a
// { dg-do run } #include <bitset> int main() { std::bitset<sizeof(int) * 8> bufWord; bufWord[3] = 0; }
google
android
typedef1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/typedef1.C
238
utf_8
35e71a2f28b22101fdc791da5d12d0e4
// { dg-do assemble } // Make sure we see through typedefs. typedef int Int; void fn() { int *p; Int *&pr2 = p; }
google
android
ambig1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/ambig1.C
389
utf_8
e713a98f853afc3952b263f5b9a2624f
// { dg-do assemble } struct foo { protected: int x; // { dg-message "" } candidate }; struct bar { public: int x(); // { dg-message "" } candidate }; struct foobar: public foo, public bar { foobar(); }; int func(int); foobar::foobar() { func(x); // { dg-error "" } ambiguous member ...
google
android
lookup1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.martin/lookup1.C
305
utf_8
f7c3c07528a0fc1e61c6d947e61d78ac
// { dg-do assemble } //In the base class list, the context of the current is used namespace N1 { namespace N2 { class A{}; class B; } } class N1::N2::B : public A { }; class C1 { class A{}; class B; }; class C1::B : A { };
google
android
eb45
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.robertl/eb45.C
134
utf_8
ef8dd1079f1a0fbed1487226cb19d1f4
// { dg-do assemble } class A {}; class B : public virtual A {}; template <class Imp> class C : public Imp {}; template class C<B>;
google
android
ice990323-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C
174
utf_8
252f307c30c2852d483bb9445c0ab70b
// { dg-do assemble } // try throwing overloaded function void f(int) { } void f(long) { } void g() { throw &f; // { dg-error "" } insufficient contextual information }
google
android
eb115
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C
168
utf_8
239088e4929f8dedbfa1d468b3145a0e
// { dg-do run } // { dg-options "-O" } #include <iostream> #include <typeinfo> int main() { int *i1, *i2; std::cerr << (typeid(i1)==typeid(i2)) << std::endl; }