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 | rfg7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg7.C | 191 | utf_8 | 3369cc5b05dc78391a5b93d6bd0c5496 | // { dg-do assemble }
// Bug: fixincludes and/or cpp mangle the definition of wchar_t so that this
// doesn't work.
#include <stdlib.h>
wchar_t array[] = L"xxx"; // { dg-bogus "" } wchar_t
|
google | android | conversion5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion5.C | 294 | utf_8 | 80dc2c7c47c2b8c5fd85c48205a3047e | // { dg-do assemble }
// { dg-options "-Wconversion" }
struct A { };
struct B: public A {
A a;
operator A () { return a; } // { dg-warning "" } never used implicitly
};
void f (const A&);
void g()
{
B b;
(A) b; // { dg-bogus "" } trying both constructor and type conversion operator
}
|
google | android | dtor5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/dtor5.C | 427 | utf_8 | 692190139cdda0f4ba5690607b9cf795 | // { dg-do run }
// PRMS Id: 5286
// Bug: g++ forgets side-effects of object in call to nonexistent destructor.
#include <new>
int r;
template <class T> struct A {
T *p;
int i;
A() { i = 0; p = (T*) new char[sizeof (T)]; new (p + i++) T; }
~A() { p[--i].~T(); r = i; }
};
int main()
{
{ A<int> a; }
int... |
google | android | ref6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref6.C | 75 | utf_8 | 89bc02b90fb886d6f423287b16b4a241 | // { dg-do assemble }
const int &f();
int &a = f(); // { dg-error "" }
|
google | android | pmem4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmem4.C | 232 | utf_8 | 24489852d94c7e78866a374c04ae6157 | // { dg-do assemble }
struct X {};
X& X::*PTM_1; // { dg-error "" } pointer to reference member
void X::*PTM_2; // { dg-error "" } pointer to void member
struct A {
static int& ir;
};
int i;
int& A::ir = i; // not an error
|
google | android | scoping8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping8.C | 219 | utf_8 | 36252f66db6a8e4cf57c9dbcbefe7a4e | // { dg-do assemble }
// Bug: g++ allows two different meanings of a name in the same scope.
typedef int foo; // { dg-error "" }
struct A {
A (foo);
int foo (); // { dg-error "" } foo already used in scope
};
|
google | android | warning6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning6.C | 96 | utf_8 | 72dab6b8f0b29b602295c6af7a5f15be | // { dg-do assemble }
// { dg-options "-Wunused" }
struct A {
int i:8;
virtual ~A() {}
};
|
google | android | rfg2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg2.C | 232 | utf_8 | b15a02066349d625ce9871be99587303 | // { dg-do assemble }
// Bug: g++ complains about a class definition containing a const member
// but no constructor; it shouldn't complain at that point, since this is
// valid use.
struct S { const int member; } object = { 0 };
|
google | android | overload18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload18.C | 120 | utf_8 | 9be51fa78cb4f2e3e91c5c8315d4cacb | // { dg-do assemble }
// pushdecl gets confused by this.
void f ();
void f (int, int);
template <class T> T f (T) { }
|
google | android | rfg17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg17.C | 315 | utf_8 | 00dc71ab735085e8af95ef62c58042dd | // { dg-do assemble }
// The default assignment operator for B uses array assignment, so we can't
// just disallow it...
struct A { A& operator=(const A&); };
struct B { A f[20]; };
int a1[20], a2[20];
B b1, b2;
void
test ()
{
b1 = b2; /* OK */
a1 = a2; /* { dg-error "" } array assignment */
}
|
google | android | parse3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse3.C | 247 | utf_8 | 25df9ff42dea7141277fc849ffa44587 | // { dg-do assemble }
// PRMS Id: 4484 (bug 2)
// Bug: g++ does not grok abstract declarator syntax for method pointers.
template <class T> class A { };
void (A<int>::*p)() = (void (A<int>::*)())0; // { dg-bogus "" } abstract declarator failure
|
google | android | init4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/init4.C | 94 | utf_8 | c187fc081bd9b95b538c11b09ae6aea4 | // { dg-do assemble }
struct A { int i; };
A a = {{{1}}}; // { dg-error "" } causes abort
|
google | android | warning7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning7.C | 102 | utf_8 | 68587f14a57035c7dcfe5788d601729c | // { dg-do assemble }
// { dg-options "-Wunused" }
// PRMS Id: 5481
struct A { };
static A a = A();
|
google | android | conversion2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion2.C | 176 | utf_8 | 7b81d012364c6a5c72caf84baa57af38 | // { dg-do assemble }
// PRMS Id: 3069
void f(int&); // { dg-message "" } referenced by error below
void g(const int& i) {
f(i); // { dg-error "" } discarding const
}
|
google | android | binding | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/binding.C | 235 | utf_8 | 2faef7e30c8fb894ef27205f01b51f39 | // { dg-do assemble }
// Bug: g++ only looks in the current temporary binding level for a name.
struct T { ~T(); };
int main()
{
foo:
T t; // { dg-message "" } redeclared
bar:
T t; // { dg-error "" } redeclaration
}
|
google | android | pmftemp | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/pmftemp.C | 323 | utf_8 | 04c40742143bf931e76c03c636795daf | // { dg-do assemble }
// PRMS Id: 4484 (bug 1)
// Bug: g++ does not support templates involving method pointers.
struct A {
void f ();
};
template <class T> void
f (void (T::*p)()) // { dg-bogus "" } use of template parm as aggregate
{ }
void g ()
{
f (&A::f); // { dg-bogus "" } templates and method pointers... |
google | android | rfg27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C | 448 | utf_8 | 83cda064b7016058bcf01cb9fb202c77 | // { dg-do assemble }
// { dg-options "-std=c++98 -pedantic-errors" }
// Don't compile this one with -Wno-long-long...
short volatile short var_0_2; /* { dg-error "" } duplicate short */
long volatile long var_0_3; /* { dg-error "" } duplicate long */
signed volatile signed var_0_7; ... |
google | android | bool4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/bool4.C | 154 | utf_8 | fe1e369a541ff0ff613e35c5b065ddb4 | // { dg-do run }
// Test for allowing conversion to bool.
struct A { };
int main ()
{
bool b = (void*)0;
b = (int A::*)0;
b = (int (A::*)())0;
}
|
google | android | ref11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref11.C | 528 | utf_8 | 3468fe167ed24e45eddacb2d52bf2515 | // { dg-do run }
int main(int argc, char ** argv) {
int (&var_field_ref)[] = * (int (*)[]) new int [42];
int (&fix_field_ref)[1] = * (int (*)[1]) new int [42];
int static_field[42];
int *const &var_field_ptr_ref = var_field_ref; // { dg-bogus "" }
int *const &fix_field_ptr_ref = fix_field_ref;
in... |
google | android | destruct3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/destruct3.C | 704 | utf_8 | 5e82655744d93ed8d108e0fdeb978c1a | // { dg-do assemble }
// { dg-options "-w" }
// PRMS Id: 4342 (second testcase)
// Bug: g++ still can't deal with ambiguous inheritance in destructor calls.
struct ccUnwind
{
ccUnwind ();
virtual ~ccUnwind ();
};
struct ccPersistent
{
virtual void bar();
};
struct ccImpExp : public ccPersistent, public... |
google | android | template21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template21.C | 201 | utf_8 | af56ec09ac43a5f4664be1870d1f7820 | // { dg-do assemble }
// Gosh, this works!
template<class T>
struct A
{
struct B
{
void bar();
};
struct C { };
};
template<class T> void A<T>::B::bar() { }
template class A<int>;
|
google | android | synth10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/synth10.C | 825 | utf_8 | 71fbfcb79210aeab20b4abc2d51787e2 | // { dg-do assemble }
// { dg-options "-O" }
// Bug: Synthesizing methods for the nested class screwed up current_class_decl
// for the outer class.
class A;
class AH
{
public:
AH ( A * p = 0 );
AH ( const AH & from )
: pointer( from.pointer ) { inc(); }
~ AH () { dec(); }
private:
A * p... |
google | android | crash4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/crash4.C | 820 | utf_8 | de4e5a7188efe89dc7462f1435cb70fa | // { dg-do assemble }
// PRMS Id: 4346
// Bug: g++ dies on redefinition of cc_Array::repInvariant.
class ccObjectInfo
{
public:
virtual const ccObjectInfo& repInvariant (int =0) const;
};
template <class T>
class cc_Array : public ccObjectInfo
{
public:
virtual const ccObjectInfo& repInvariant (int =0) const ;... |
google | android | template44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template44.C | 1,281 | utf_8 | ecfeb6f4c557a3805c2c0e4e96424ca0 | // { dg-do run }
#include <stdlib.h>
#include <string.h>
template <class T>
class List {
public:
int len;
T *array;
int length() const { return( len ); }
List() : len( 0 ), array( 0 ) {}
};
template <class T>
int AlgoStdCompare(const T* a, const T* b) {
if (*a < *b)
return -1;
else
retu... |
google | android | overload21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload21.C | 341 | utf_8 | cc8466944ee12b2dbc948bf39ffd35bb | // { dg-do assemble }
struct X {
void f (int = 4, char = 'r'); // { dg-message "previous specification" }
void g (int = 4, char = 'r'); // { dg-message "previous specification" }
};
void
X::f (int i = 4, char x = 'r') // { dg-error "default argument" }
{ }
void
X::g (int i = 9, char x = 's') // { dg-error "def... |
google | android | crash10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/crash10.C | 144 | utf_8 | b908a684a68228cc43c1c82e98f30c15 | // { dg-do assemble }
// PRMS Id: 5155
struct A {
enum foo { bar };
};
typedef A::foo A::foo; // { dg-error "" } causes compiler segfault
|
google | android | access18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access18.C | 434 | utf_8 | 3416d8fe740639d3bd911df51fda9272 | // { dg-do assemble }
// { dg-options "-w" }
// PRMS Id: 5073
// Bug: g++ doesn't catch access violations in base initializers.
int r = 0;
class A {
private:
A() { r = 1; } // { dg-error "" }
~A() {} // { dg-error "" }
};
class B : public A {
public:
B(): A() {} // { dg-error "" }
B(c... |
google | android | ref12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref12.C | 79 | utf_8 | b5bb9f26a206c4355bb81212d54935b3 | // { dg-do run }
void f (const char *const &) { }
int main ()
{
f ("hi");
}
|
google | android | parse11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse11.C | 158 | utf_8 | 46e40596c5c8c2adbf39d991c1fd3e92 | // { dg-do assemble }
// PRMS Id: 6825
class aClass
{
; // { dg-error "" } missing declaration
private:
; // { dg-error "" } missing declaration
};
|
google | android | init3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/init3.C | 760 | utf_8 | f2ff54cbad03f3b2bd95882368cc045d | // { dg-do run }
// PRMS Id: 5652
// Bug: strings does not get initialized.
#include <string.h>
class My_string {
char *str;
int len;
public:
My_string(const char* string);
My_string(const My_string &);
~My_string() { delete str; }
char* char_p() { return str; }
};
const My_string strings[4] = {
... |
google | android | this | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/this.C | 214 | utf_8 | 40fcdd9ac5d7df502c6154f385d814a8 | // { dg-do assemble }
// PRMS Id: 5190
// Bug: g++ fails to build up a const reference to `this'.
class X
{
public:
void member ();
};
void print (const X* const &);
void X::member ()
{
print (this);
}
|
google | android | template4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template4.C | 423 | utf_8 | 9b49387d1e7e76656995dd4e191c11d0 | // { dg-do assemble }
// Bug: g++ tries to instantiate ccList twice, and fails.
template<class T> class ccHandle{ };
template <class T> class ccList;
template <class T> class cc_List {
public:
ccList <T> copy ();
};
template <class T> class ccList : public ccHandle < cc_List <T> > {
public:
ccList (int);
};
te... |
google | android | vecdel | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/vecdel.C | 405 | utf_8 | e53f8b117ecf4eba5c6610643b9c8d37 | // { dg-do run }
__SIZE_TYPE__ newsize = 0;
__SIZE_TYPE__ delsize = 0;
struct A {
int i;
void * operator new [] (__SIZE_TYPE__ i)
{ newsize = i; return ::operator new [](i); }
void operator delete [] (void *p, __SIZE_TYPE__ i)
{ delsize = i; ::operator delete [](p); }
};
int main()
{
A* ap = new A [2... |
google | android | scoping4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping4.C | 455 | utf_8 | 517cdd1880807390b89e0778aed186ad | // { dg-do assemble }
// PRMS Id: 4375
// Bug: g++ fails to keep track of nested typedefs properly.
class A {
public:
typedef const char * Ptr;
Ptr s;
Ptr get_string();
A(Ptr string); // { s = string; };
};
class B {
public:
typedef A * Ptr;
Ptr a;
Ptr get_A();
B(Ptr a_ptr);
};
A::A(Ptr string) { /... |
google | android | byval2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/byval2.C | 599 | utf_8 | 02b0c705db935aa087185a228aa52a73 | // { dg-do assemble }
// Subject: 2.6.0 pre-rel, internal error, regression, mips-sgi-irix4
// Date: Thu, 14 Jul 94 23:34:21 EDT
class Char
{
protected:
char rep;
public:
Char (const char ) {}
operator char() const;
void operator -= (const Char );
};
inline Char operator - (const Char a, cons... |
google | android | access13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access13.C | 256 | utf_8 | cda590cdcff940e24584e29447dea85a | // { dg-do assemble }
// PRMS Id: 4955
struct A {
protected:
int i;
void f ();
};
struct B: public A {
void g () {
this->A::i = 1; // { dg-bogus "" } access control failure
this->A::f(); // { dg-bogus "" } access control failure
}
};
|
google | android | warning1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning1.C | 180 | utf_8 | 63811b96a427481ed3e05bb30f3baefd | // { dg-do assemble }
// Bug: g++ protests that foo was never defined.
static void foo ();
static void foo ();
static void foo () { }
void bar () { foo(); } // { dg-bogus "" }
|
google | android | conversion6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/conversion6.C | 644 | utf_8 | 37d635f5f0bc8e8beb2e245a0b70c261 | // { dg-do run }
// PRMS Id: g++/6034
extern "C" int printf (const char *, ...);
class Base
{
char x;
};
template <class T>
// remove the public Base inheritance and the problem goes away...
class Container : public Base
{
public:
Container(const T& aValue): myValue(aValue) { }
operator const T&(void... |
google | android | ref10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref10.C | 351 | utf_8 | 5e43a7d7d89e730c493f6ba337b2dc0b | // { dg-do run }
// Test that conversion from D* to B*& works properly.
extern "C" int printf (const char *, ...);
struct V {
int a;
};
struct B: virtual V {
int b;
};
struct D: B {
int c;
};
V* gp = 0;
void foo(V * const &r) {
gp = r;
}
int bar(V *r) {
return (r != gp);
}
int main() {
D *p = new D... |
google | android | incomplete1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/incomplete1.C | 284 | utf_8 | a97dd69579987e5b5296d4a6ae94eecd | // { dg-do assemble }
// The reference parameter to fred isn't dereferenced properly.
class Gump {};
Gump operator & (const Gump x){return x;}
class B;
void *sam(int &x)
{return &x;}
const void *fred(const B& x)
{return &x;} // "&x" causes the compilation error.
class B {};
|
google | android | access7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access7.C | 267 | utf_8 | b7def766ff417373e755c602745a7f45 | // { dg-do assemble }
// Simple testcase for access control.
class A {
protected:
static void f ();
};
class B: public A {};
class C: public A {};
class D: public C, public B {
void g () { A::f(); } // { dg-bogus "" } wrongly ambiguous static member call
};
|
google | android | mangle3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/mangle3.C | 313 | utf_8 | 8cc2e4106b3ea2061f36bc9b05cfb8de | // { dg-do run }
// PRMS Id: 7563
// Bug: declaration at function scope causes mismangling.
int main()
{
char ArrA[1][1][2][3],
ArrB[1][1][2][3];
void HitMe(char [1][1][2][3], char [1][1][2][3]);
HitMe(ArrA, ArrB);
return 0;
}
void HitMe(char A[1][1][2][3], char B[1][1][2][3])
{
return;
}
|
google | android | lvalue4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/lvalue4.C | 84 | utf_8 | 5806155b87c1a7e1fef0b91fb93f390d | // { dg-do run }
int main() {
int i = 2;
int *pi = &(++i);
return i != 3;
}
|
google | android | template30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template30.C | 326 | utf_8 | 6145d6190c7b2b87ecc640eef45bc505 | // { dg-do assemble }
template <class T, class U>
int func(U, T); // { dg-message "note" }
template <class T, class U>
int func(T, U) // { dg-message "note" }
{
return 2;
}
int main ()
{
func (0, 1); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 1... |
google | android | scoping2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping2.C | 224 | utf_8 | 5208bbd8f1012a55789b08dd3f00ec34 | // { dg-do assemble }
// Bug: A function is not hidden properly by a use of its name in an
// inner scope.
struct A
{
struct B
{
int f;
B() : f(0) {}
void g() { f = 0; }
};
void f();
void f(int);
};
|
google | android | net2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/net2.C | 518 | utf_8 | 4fda4ee8734b9666561f2f255d68fa20 | // { dg-do run }
// Test of various ?: problems.
class D
{
public:
void a();
void b();
D(int i):x(i) {}
private:
int x;
};
void D::a() {++x;}
void D::b() {--x;}
int aa=1, bb=0;
int fa() {return 0;}
int fb() {return 2;}
int main(int argc, char* argv[])
{
typedef int* pi;
int* p = (argc == 1)? &aa: &... |
google | android | scoping3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping3.C | 153 | utf_8 | f630e10a549618eeb11d488decde8876 | // { dg-do assemble }
// Bug: g++ does not grok nested types very well.
class A {
class B;
friend class B;
class B { }; // { dg-bogus "" }
};
|
google | android | nested1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/nested1.C | 268 | utf_8 | 116970252d64d6b8b965ce03cebf15f7 | // { dg-do assemble }
// Bug: g++ can't deal with function-local classes that talk about themselves.
void foo() {
class Wrapper {
public:
void F (void * Wrapperptr)
{
Wrapper * wrapptr = ( Wrapper *) Wrapperptr; // { dg-bogus "" }
}
};
}
|
google | android | parse6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse6.C | 219 | utf_8 | 431437488dcf70141c944af586f28f14 | // { dg-do assemble }
// PRMS id: 4653
// Bug: g++ tries to resolve declarator/expression ambiguities too soon.
template<class T> struct A { };
void f () {
void (A<int>::*pmf) (); // { dg-bogus "" } late binding
}
|
google | android | ref5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref5.C | 168 | utf_8 | 842e17b828806bc6f661a1a0019f3b6d | // { dg-do assemble }
int i;
int &const j = i; // { dg-error "" } invalid const
int &const f(); // { dg-error "" } invalid const
void g ()
{
j = 1;
f() = 1;
}
|
google | android | init2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/init2.C | 146 | utf_8 | be5d677079c8e62557abf64331250b34 | // { dg-do run }
// PRMS Id: 5126
extern int i, j;
static const int foo [] = { i, j };
int i = 5, j = 42;
int main()
{
return foo[1] != 42;
}
|
google | android | enum8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/enum8.C | 280 | utf_8 | 367d613bc250e9dcc871a0dac0cd3de8 | // { dg-do run }
// Bug: the switch fails on the Alpha because folding ef - 1 fails.
enum foo { one=1, thirty=30 };
int f (enum foo ef)
{
switch (ef)
{
case one:
case thirty:
return 0;
default:
return 1;
}
}
int main ()
{
return f (one);
}
|
google | android | temporary6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/temporary6.C | 211 | utf_8 | 904f134c7ec633ab2982b1e531310f3f | // { dg-do assemble }
// Bug: the temporary from the default parameter to f2 is reused.
struct A {};
int f2 (int i, const A& ar = A());
void f (int i, int j = f2(1));
void g () { f (1); }
void h () { f (1); }
|
google | android | overload35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload35.C | 342 | utf_8 | 4eb62e3619bb721a42dfdb4b6e8187a6 | // { dg-do assemble }
// PRMS Id: 9647
class castBug
{
public:
operator int *();
operator const int *() const;
};
class castBug2
{
public:
operator const int *() const;
};
void voidfn(void *);
void test()
{
castBug b;
castBug2 b2;
voidfn(b); // { dg-bogus "" }
voidfn(b2); // { dg-error ""... |
google | android | overload6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload6.C | 235 | utf_8 | 79c9af7fb340be6d1224a0f7b4ccff79 | // { dg-do assemble }
// Bug: g++ thinks there is a default conversion from void* to B*.
// There isn't.
struct A {
operator void* ();
};
struct B { };
void foo (B* bp);
void bar (A& a) {
foo (a); // { dg-error "" }
}
|
google | android | scoping5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping5.C | 146 | utf_8 | 47d4fa61a5ee8a2b181303fe459e4f6c | // { dg-do assemble }
// Bug: g++ thinks that A defines operator delete, and tries to call it.
struct A {
~A () { ::operator delete (0); }
};
|
google | android | expr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/expr1.C | 173 | utf_8 | f64a776322f2d9ddc6a3bf1f0c01381b | // { dg-do assemble }
// Bug: g++ doesn't figure out what to do.
struct A {
operator char *();
};
char foo(A a)
{
char c = a[0]; // { dg-bogus "" }
return c;
}
|
google | android | offset1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/offset1.C | 243 | utf_8 | 0ad6e79ea07c5b8b452a371df31b9ce1 | // { dg-do assemble }
// PRMS Id: 5070 (testcase 1)
struct foo {
foo(int x = 0) {}
int IsAlive(void) { return 1; }
};
struct xx {
int IsOk(int X);
foo a;
};
int xx::IsOk(int X)
{
return ((xx::a).IsAlive()); // { dg-bogus "" }
}
|
google | android | warning2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning2.C | 242 | utf_8 | b9ca30d37fac6acf66c637735809e3f4 | // { dg-do assemble }
// g++ ought to warn about casting a base pointer to a derived reference.
struct A {
virtual void f () = 0;
};
struct B: public A { void f () { } };
int main()
{
B* bp;
A& ar = (A&)bp; // { dg-warning "" }
}
|
google | android | crash12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/crash12.C | 244 | utf_8 | 0cd27db28b5911b4375c2bc740961e81 | // { dg-do assemble }
// Bug: g++ dies instead of flagging this invalid.
inline float max(float x, float y) { return (x>y)?x:y; }
float b(float x, float y, float z)
{
float f = (y<x)?x:(max<y)?z:y; // { dg-error "" }
return f;
}
|
google | android | parse10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse10.C | 328 | utf_8 | 2dcf8b430dbd487615992d2db56b79ca | // { dg-do run }
// Testcase for precedence of ?: wrt =
extern "C" int printf (const char *, ...);
int main()
{
int j = 0, k = 0;
1 ? j : k = 5; // should be parsed 1 ? j : (k = 5)
(void) (1 ? k = 5 : 0);
k = 5 ? 1 : 0; // should be parsed k = (5 ? 1 : 0)
printf ("%d %d\n", j, k);
return j == 5 || k ... |
google | android | parse14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/parse14.C | 185 | utf_8 | 84c726a5b52085aa8fe801fc478ce206 | // { dg-do assemble }
// Bug: g++ decides that A::foo is introducing a constructor declarator.
struct A {
typedef bool foo;
};
A::foo (*bar) ();
struct B {
A::foo (*bar) ();
};
|
google | android | thunk1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/thunk1.C | 656 | utf_8 | 9c846445e2018745dcc34b2f1642858c | // { dg-do run }
// Test that non-variadic function calls using thunks work right.
struct A {
void* p;
A (void* q): p (q) { }
A (const A& a): p (a.p) { }
};
class CBase {
public:
virtual void BaseFunc();
};
class MMixin {
public:
virtual A MixinFunc(int arg, A arg2) = 0;
};
class CExample : public CBase, pu... |
google | android | access3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access3.C | 159 | utf_8 | a27f8fda827e27cce6b195811cf0f147 | // { dg-do assemble }
// Simple testcase for access control.
class A {
protected:
void f ();
};
class B : public A {
public:
void f () { A::f(); }
};
|
google | android | tredecl4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tredecl4.C | 266 | utf_8 | 1e383f120373a81aa0013338e72ae641 | // { dg-do assemble }
// It is illegal to use the name of a class template for anything else,
// including another class template.
template <class T> class A { }; // { dg-message "previous" }
template <class U, class V> class A { }; // { dg-error "redeclared" }
|
google | android | template40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template40.C | 411 | utf_8 | 3ef76a22c445af6d004e4af1d4e1ef5d | // { dg-do run }
// PRMS id: 11315
// Bug: g++ doesn't recognize the copy ctor for Array<long>.
template <class Type>
class Array {
public:
Array(int sz=12)
: ia (new Type[sz]), size(sz) {}
~Array() { delete[] ia;}
Array(const Array<long>& r) : size(0) {} // just for testing
private:
Type *ia;
int size;... |
google | android | opeq4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/opeq4.C | 148 | utf_8 | 190eaf169c3c8d34166229478918fdae | // { dg-do assemble }
// PRMS Id: 4329
// Bug: default op= gives an warning about casting away volatile.
struct foo
{
volatile int bar[2];
};
|
google | android | crash7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/crash7.C | 231 | utf_8 | da2f1d65ff209286f61f25ae176997af | // { dg-do assemble }
// Bug: g++ can't deal.
typedef unsigned size_t; // { dg-message "" } previous declaration
typedef unsigned long size_t; // { dg-error "" } redefining size_t
void f (size_t); // causes compiler segfault -
|
google | android | tredecl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tredecl2.C | 171 | utf_8 | bed2e0f518532685396e3880a1588ea1 | // { dg-do assemble }
// No bug; making sure my fix for tredecl.C doesn't break other cases
template<class T> struct Foo { Foo<T> * me() { return this; } };
Foo<int> i;
|
google | android | template33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template33.C | 247 | utf_8 | 088a934dd8a70a8383d8a361fa4f4a53 | // { dg-do assemble }
// Test nested enums in templates.
template <class T>
class A
{
public:
enum muni {X, Y};
muni e() { return X; }
muni f();
};
template <class T>
typename A<T>::muni A<T>::f() { return X; }
template class A<int>;
|
google | android | mutable1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/mutable1.C | 101 | utf_8 | 596ed7111f1a0227483c08bc6640b72a | // { dg-do run }
struct X
{
X () { }
mutable int x;
};
int main ()
{
const X x;
x.x = 0;
}
|
google | android | access15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/access15.C | 276 | utf_8 | 1eef12506a75ad8cf906e3779c9db776 | // { dg-do assemble }
// Bug: g++ complains about Z being a private base when trying to
// initialize B::foo.
struct Z {
Z();
Z(int);
};
struct A : private Z { };
struct B : public A
{
::Z foo;
B();
B(const B&);
};
B::B() : foo(1) { } // { dg-bogus "" }
|
google | android | virtual | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/virtual.C | 659 | utf_8 | 30f9b5535184121baf2ec1b03c4ce3b6 | // { dg-do assemble }
// Newsgroups: gnu.g++.bug
// Subject: gcc-2.5.5 bug in multiple inheritance and pure virtual functions
// Date: 25 Jan 1994 23:41:36 -0500
// Bug: g++ fails to notice definitions of abstract virtuals.
class A
{
public:
virtual void a1() = 0;
virtual void a2() = 0;
};
class B
{
public:
vir... |
google | android | operator2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/operator2.C | 246 | utf_8 | 185eea2532af5023b78f9ce2e69cbacf | // { dg-do assemble }
// PRMS Id: 6018
class string {
char *p;
public:
string(const char* s) ;// { p == s; }
operator const char*() ;// { return s; }
};
void f4(string& s)
{
*s; // implies "s.operator const char*()"
}
|
google | android | rfg24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/rfg24.C | 159 | utf_8 | 2cbe5674217be63ecc40b37d229fac84 | // { dg-do assemble }
typedef int Int;
Int Int_object_1;
void test ()
{
((Int) Int_object_1) = Int_object_1; /* { dg-error "" } not an lvalue*/
}
|
google | android | dot | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/dot.C | 329 | utf_8 | 702048871d24aa0917f63f2d9e97b567 | // { dg-do assemble }
// PRMS Id: 4143
// Bug: Pointer is silently dereferenced in method call.
extern "C" int printf (const char *, ...);
class Test
{
char ch;
public:
void Print() { printf("%c", ch); }
};
int main()
{
Test *p = new Test('x');
p.Print(); // { dg-error "" }
} |
google | android | overload32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload32.C | 225 | utf_8 | 8c0888e528f92e93b1dc0928311cde10 | // { dg-do assemble }
// PRMS Id: 7128
class B {};
class D : public B {};
class X {
public:
operator const B & () const;
operator const D & () const;
};
void f( const D & );
void g( const X & x )
{
f( x );
}
|
google | android | template36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template36.C | 932 | utf_8 | e6113f8014999e52216f910eba291de1 | // { dg-do run }
// Testcase for implicit 'typename' and resolution of 'typename's in the
// current scope.
class base1 {
public:
int bar() const
{ return 1; }
};
class base2 {
public:
int bar() const
{ return 0; }
};
template<class X>
struct base_trait {
typedef base1 base;
};
template<>
str... |
google | android | scoping7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/scoping7.C | 237 | utf_8 | 4c57a25a047fb76c5dd41de229c84797 | // { dg-do assemble }
// Bug: g++ doesn't flag name collisions between types and non-types as
// errors. It shouldn't for class names, but it should for typedefs.
int bar; // { dg-message "" }
typedef int bar; // { dg-error "" }
|
google | android | lookup | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/lookup.C | 439 | utf_8 | f8407269257a5289abd85ac61305275e | // { dg-do assemble }
// PRMS Id: 4357
// Bug: g++ forgets to clear out push/popclass cache stuff when instantiating
// templates.
template <class T> class ccHandle { };
class cc_GStack
{
static cc_GStack* freeList;
};
// OK if ccGStack is not derived from ccHandle<something>
class ccGStack : public ccHandle<int>... |
google | android | ref7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref7.C | 328 | utf_8 | 256c9d6626ad42870e64aface1ccd6e2 | // { dg-do run }
// Testcase for the lifetime of a temporary object which is used to
// initialize a reference.
int destroyed = 0;
struct A {
A() { }
A(int) { }
~A() { destroyed++; }
};
A a;
A foo () { return a; }
int main()
{
const A& ar = foo();
const A& ar2 = A();
const A& ar3 = (A)1;
return destr... |
google | android | synth9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/synth9.C | 292 | utf_8 | 7f8222df60c5e8d0c1924c1474bd2e16 | // { dg-do assemble }
// PRMS Id: 6837
// Bug: anonymous union confuses g++.
struct my_key {
my_key(const my_key&);
my_key(const char* n);
};
struct my_node {
my_node(my_key&);
union {
long cnt;
my_node* next;
};
my_key a;
};
extern my_node n;
my_node a(n);
|
google | android | default1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/default1.C | 412 | utf_8 | 4c275e3a05449cfebaec6825845b8f6c | // { dg-do assemble }
// PRMS Id: 5204
// Bug: g++ bashes the type of add_sym with the type of add, so calling it
// with one parameter generates an error.
int add(int const &symbol,
const unsigned char flags=(void*)0); // { dg-error "" } invalid default arg
int add_sym(int const &symbol,
const unsigned char f... |
google | android | bool5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/bool5.C | 167 | utf_8 | 5c504593e80b75bca30bd5eb236db8c6 | // { dg-do run }
int main ()
{
bool b = false;
int i = b++;
if (i != false || b != true)
return 1;
i = b++;
if (i != true || b != true)
return 1;
}
|
google | android | lookup3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/lookup3.C | 371 | utf_8 | 1f71939a07932c7c2c231b4cc69b0c18 | // { dg-do assemble }
// [class.ambig]: A single function, object, type, or enumerator may be
// reached through more than one path through the DAG of base classes. This
// is not an ambiguity.
struct A {
typedef long T;
};
struct B : public A { };
struct C : public A { };
struct D : public C , public B {
voi... |
google | android | overload27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload27.C | 117 | utf_8 | 115274c84ac60e1ce9fe55ee13bf3e94 | // { dg-do run }
void f(const int &) { }
void f(const float &);
int main()
{
f(false); // { dg-bogus "" }
}
|
google | android | thunk3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C | 1,219 | utf_8 | 9d676d6a8053f5d4f2f598f7d934293f | // { dg-do run }
// { dg-skip-if "fails with generic thunk support" { rs6000-*-* powerpc-*-eabi v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa*-*-* m32r*-*-* lm32-*-* nios2-*-* } { "*" } { "" } }
// Test that variadic function calls using thunks work right.
// Note that this will break on any target that uses the generic thun... |
google | android | tempsub | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tempsub.C | 293 | utf_8 | 0f465f011856318e4a82bae9e718ca27 | // { dg-do assemble }
// Distillation of crash1.C problem (PR 3633)
template<class P>
class A
{
P p;
};
template<class Q>
class B
{
A<Q> a; // bogus error - temp parm name propagating
};
template<class R>
class C
{
B<R> b;
};
template<class S>
class D
{
S s;
};
C< D<int> > c;
|
google | android | lookup2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/lookup2.C | 165 | utf_8 | 43b430aae4fdb9e4cc108190d037691d | // { dg-do assemble }
struct A {
struct B {
B ();
};
};
void f (A::B);
void g ()
{
A::B b;
f (b); // { dg-bogus "" } can't find nested constructor
}
|
google | android | loverload4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/loverload4.C | 150 | utf_8 | d8ced221e1f45f46faa5d29ac7aa3c3f | // { dg-do assemble }
// Bug: g++ dies on this input.
inline char abs (char x) { return 0; }
extern "C" {
inline int abs (int x) { return 1; }
}
|
google | android | typedef2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/typedef2.C | 168 | utf_8 | cf1a7cacf2b35b222f770fcbbdb14cc9 | // { dg-do run }
// PRMS Id: 5367
// Bug: the nested name of C::func gets hosed.
struct C {
typedef int func(int *, int *);
};
int
main()
{
C::func *handler;
}
|
google | android | overload15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/overload15.C | 157 | utf_8 | b6d3a46381478f8b7d432201d4dc2c64 | // { dg-do assemble }
// Bug: g++ thinks that int->long is a promotion.
long f (long, long);
double f (double, double);
void g (double d)
{
f (d, 0);
}
|
google | android | trivial | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/trivial.C | 2,197 | utf_8 | 2f67020daf77d25c2c7bef28cfe4c164 | // { dg-do assemble }
// PRMS Id: 3665
//-------------------------------------------------------------
// Referential declaration within class
//
// Imbeded below is the invocation of the compiler and the error
// message
//
// This compiles successfully with both the xlC and CFRONT compilers
// This was reviewe... |
google | android | union | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/union.C | 191 | utf_8 | 2c801d3a7bbe264195737c67cdcac8fd | // { dg-do assemble }
// Bug: g++ doesn't insert anon union members into class scope.
// Breaks groff.
struct A {
union {
int i;
};
void foo () { i = 1; } // { dg-bogus "" }
};
|
google | android | thunk2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C | 789 | utf_8 | e009d9b91513051053d5ef3a438adbd8 | // { dg-do run { target fpic } }
// { dg-options "-fPIC" }
// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } }
// Test that non-variadic function calls using thunks and PIC work right.
struct A {
void* p;
A (void* q): p (q) { }
A (const A& a): p (a.p) { }
};
class CBase {
publi... |
google | android | tempparse | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/tempparse.C | 405 | utf_8 | e4681da1536da14176b6242aa0cde9a4 | // { dg-do assemble }
/*
PRMS Id: 3631
Bug is: g++ mangles template class names in a way that it won't accept,
and then tries to feed them to itself.
*/
template<class T>
struct A {
A();
};
template<class T>
struct B : A<T> {
B();
}; // { dg-bogus "" } B<C<char>>
template<class T>
struct C {
C()... |
google | android | ref2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/ref2.C | 139 | utf_8 | 360dbe681c226bb57a1ab606fe70b877 | // { dg-do assemble }
// Bug: g++ can't deal with references to arrays.
typedef float Matrix[4][4];
Matrix m;
Matrix& f () { return m; }
|
google | android | groff1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/groff1.C | 583 | utf_8 | 654a66427dcd006b10d7eb2e7d6189a1 | // { dg-do run }
// PRMS Id: 3744
// Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the
// result, so expand_expr ignores it.
extern "C" {
int printf(const char *,...);
void exit(int);
}
struct A {
int x;
int y;
A() : x(0), y(0) { }
};
struct S {
S() : flags(0) { }
unsigned fla... |
google | android | warning10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/warning10.C | 297 | utf_8 | e75b78d24078dbf9a96ada8194eef893 | // { dg-do assemble }
// { dg-options "-W -Wall" }
// Don't warn about these comparisons.
struct A {
unsigned int b : 14;
};
int f (int i, unsigned char u, A a, unsigned long ul)
{
if ((u & 0x10) == 0)
return 1;
if (i == 0U)
return 1;
if (a.b > ul)
return 1;
return 0;
}
|
google | android | template10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.jason/template10.C | 608 | utf_8 | e56248583485844e691edcdc168e6046 | // { dg-do assemble }
// Bug: member operator shadows global template in tsubst.
class ostream;
template <class TP> class smanip;
template<class TP>
ostream& operator<<(ostream& o, const smanip<TP>& m);
template <class TP> class smanip {
public:
friend ostream& operator<< <>(ostream &o, const smanip<TP>&m);
};
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.