plateform stringclasses 1
value | repo_name stringclasses 2
values | name stringlengths 1 78 | ext stringclasses 2
values | path stringlengths 15 1.11k | size int64 1 8.55M | source_encoding stringclasses 11
values | md5 stringlengths 32 32 | text stringlengths 0 8.49M |
|---|---|---|---|---|---|---|---|---|
google | chromium | eb5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb5.C | 182 | utf_8 | 587cf27a8a6445ee8c78cc92cf59b65f | // { dg-do assemble }
enum { a, b };
class Bug {
int pri:8;
int flags:15;
public:
void bug() {
flags |= a; // this does not work
}
};
void dummy(Bug x) { x.bug(); }
|
google | chromium | ice990323-2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C | 1,170 | utf_8 | c887f1048097d9ab3916cf9b44becbe7 | // { dg-do run }
// check EH with templates
extern "C" void abort ();
extern "C" void exit (int);
template <class T, int n, class U> struct A {
A() {}
A(const char*) {}
};
void f1()
{
throw *(new A<double, 47, A<int, 37, short> >);
}
void f2()
{
throw *(new A<double, 47, A<int, 36, short> >);
}
void f3()
{
th... |
google | chromium | eb128 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb128.C | 161 | utf_8 | 06b76b4bfa648bedcd960d0535aba50f | // { dg-do assemble }
template<class T>
struct A {
typedef T* iterator; // { dg-error "" } pointer to reference
public:
A(){}
};
void f()
{
A<int&> a;
}
|
google | chromium | eb3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C | 284 | utf_8 | 0164d1f50c2dd32169fccc50aa1a7e01 | // { dg-do assemble }
#include <complex>
template<class T>
class Vec {
public:
Vec() { data = new T; }
Vec<T> split() { Vec<T> tmp; operator=(tmp); return tmp; }
void operator=(const Vec<T> &v) { data = new T; }
T *data;
};
template class Vec<std::complex<double> >;
|
google | chromium | eb19 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb19.C | 311 | utf_8 | 9b0fe19732508a1447e5f3d5af4674fa | // { dg-do assemble }
#define CRASH 1
#ifdef CRASH
#define VIRTUAL virtual
#else
#define VIRTUAL
#endif
class A {};
class B : public VIRTUAL A {};
template <class Imp> class C : public /*virtual*/ Imp {};
// define CRASH and uncomment here ^^^^^^^^^^^
// and the crash goes away!!!!
template class C<B>;
|
google | chromium | eb4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C | 1,236 | utf_8 | e549287cca831f8942e91a4835b17fda | // { dg-do assemble }
// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot.
#include <iostream>
class some_base
{
public:
class base_func_args;
virtual void func(base_func_args &) = 0; // { dg-message "note" } referenced below
};
class some_base::base_func_args... |
google | chromium | eb45 | .C | native_client/nacl-gcc/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 | chromium | eb65 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb65.C | 448 | utf_8 | de75043540ca4e516fe1727234b3000e | // { dg-do run }
#include <iterator>
using namespace std;
template<size_t n, size_t i> struct PartialDotProduct {
template<class T>
static T Expand(T* a, T* b) { return T(); }
};
const int N = 10;
template<class In1, class In2>
typename iterator_traits<In1>::value_type
dot(In1 f1, In2 f2)
{
return Part... |
google | chromium | eb57 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb57.C | 125 | utf_8 | 0777d21b3dd550747ecc5bbf0087c1fc | // { dg-do assemble }
#include <exception>
//using namespace std;
class A {
class B : public std::exception {}
;
};
|
google | chromium | eb44 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C | 920 | utf_8 | e34f3c7745dc560590ce60b791052c3a | // { dg-do assemble }
// spurious 'const' in error.
// For egcs-2.91.34, the warning message refers to
// class ostream & operator <<(class ostream &, const class Vector<T> &)
// Also, the template instantiation does not provide the missing
// friend function, the non-template function does
#include <cstdio>
#include... |
google | chromium | eh990323-3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C | 276 | utf_8 | c62cf2783cffe038295ade5f26a79dc3 | // { dg-do run }
// try throwing 0 cast to a class object
extern "C" void abort ();
extern "C" void exit (int);
struct A {};
void f()
{
throw (A*)0;
}
int
main()
{
int flag;
flag = 0;
try {
f();
}
catch (A*) {
flag = 1;
}
if (!flag)
abort();
exit (0);
}
|
google | chromium | eb69 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C | 497 | utf_8 | 8cc01604bf316290441bbd5a520a928f | // { dg-do assemble }
// Test that g++ complains about referring to a builtin type in a
// mem-initializer.
int r = 0;
struct foo { // { dg-message "note" } candidate
foo(int x) { r = 1; } // { dg-message "candidate" }
};
struct bar : foo {
typedef int an_int;
bar() : bar::an_int(3) {} // { dg-error "m... |
google | chromium | eb86 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb86.C | 115 | utf_8 | 451d74d332d1ebd3febbf9f2fdef05d5 | // { dg-do assemble }
template <class T> void foo ();
template <class T>
class Q {
friend void foo<T> ();
};
|
google | chromium | eb87 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb87.C | 259 | utf_8 | 1b1d44ab52323a9942ada2f5c6a0042c | // { dg-do assemble }
template <unsigned X, class T> struct Foo {
friend void operator<<(int, Foo const &) {}
};
template <unsigned X> class Bar : public Foo<X,int> {};
inline Bar<0> bar(int,int,int) { return Bar<3>(); } // { dg-error "" } no conversion
|
google | chromium | eb110 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb110.C | 283 | utf_8 | 4e0fb43b2a17ed42c66d97c75cbcff3b | // { dg-do assemble }
class X
{
public:
virtual void f() const = 0;
};
template <class T>
class Y: public X
{
public:
virtual void f() const;
};
template <class T>
void Y<T>::f() const
{
}
template <>
void Y<bool>::f() const;
template <>
void Y<bool>::f() const
{
}
|
google | chromium | eb76 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb76.C | 251 | utf_8 | dd81fcab77c6b0ad6ce03686438fbd51 | // { dg-do assemble }
// the template operator!= interferes. It should be in a namespace.
#include <utility>
enum T {
V1
};
struct X {
T t : 31;
};
void
f(X& v) {
if( v.t != V1 ) { // complains about taking address of bitfield
}
}
|
google | chromium | eb115 | .C | native_client/nacl-gcc/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;
}
|
google | chromium | eb56 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb56.C | 208 | utf_8 | 62fa73b17247c1714c275a963fa7328a | // { dg-do assemble }
// Error: Internal compiler error on 1998/05/28 snapshot.
class foo {
public:
typedef int sometype;
};
struct die : public foo::sometype { // { dg-error "" } invalid base type
};
|
google | chromium | eb36 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb36.C | 381 | utf_8 | d220747503f1cae3d8e04233dceb1d48 | // { dg-do assemble }
#include <vector>
using namespace std;
template <typename T=float> class foo {
public:
foo();
foo(vector<int> v);
private:
vector<int> v;
T t;
};
template <typename T>
foo<T>::foo() :v(), t() {}
template <typename T=float>
foo<T>::foo(vector<int> v_) :v(v_), t() {} // { ... |
google | chromium | eb111 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb111.C | 122 | utf_8 | 389459a1b35359ae0a53adadeb39890c | // { dg-do run }
int main() {
for(int i=1; i < 9; i++);
for(int i=1; i < 9; i++);
return 0;
}
|
google | chromium | eb26 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb26.C | 430 | utf_8 | bfed9395e04ba5cc65f81b655ac0007e | // { dg-do run }
//
// egcs-2.90.06
// cannot declare friend of enclosing class using its scope, works fine
// without scope or for definition of foo::bar::f
//
class foo
{
public:
static int f();
class bar {
friend int foo::f();
// friend int f();
static int x;
public:
static int f() {return foo::... |
google | chromium | eb123 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb123.C | 177 | utf_8 | 27414451cdd553e1e28ff5c414cae858 | // { dg-do assemble }
// { dg-options "-O2 -W " }
#include "stdio.h"
void writeNote() throw( int )
{
printf( "hello world\n" );
try { }
catch( int ){ throw; }
}
|
google | chromium | eb97 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb97.C | 483 | utf_8 | da7c30ff49c68f2cfb12eb420fc61b9c | // { dg-do run }
// Creates bad assembly on sparc and x86
template<unsigned long SIZE>
struct Array { };
template<unsigned long SIZE>
Array<SIZE> test_ok(const Array<SIZE>& a) {
Array<SIZE> result;
return(result);
}
template<unsigned long SIZE>
Array<SIZE + 1> test_error(const Array<SIZE>& a) {
Array<SIZ... |
google | chromium | eb67 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb67.C | 186 | utf_8 | fda2b9a8051809962b59e6ca5f79964f | // { dg-do assemble }
/*
Check whether a typedef for a basic type as a baseclass is diagnosed.
*/
typedef int an_int;
class bar : public an_int {}; // { dg-error "" } not an aggregate
|
google | chromium | eb46 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C | 502 | utf_8 | 162242e8a8ce35ee0319175bf101e399 | // { dg-do run }
#include <iostream>
class A1 {
friend class B;
public:
virtual void foo() {}
};
class A2 : public virtual A1 {friend class B;};
class A3 : public virtual A1, private A2 {friend class B;};
class B
{
public:
B(A1* a) : itsA(dynamic_cast<A2*>(a)) {}
A2* itsA;
};
int... |
google | chromium | eb74 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb74.C | 383 | utf_8 | be75e16bfbc653f4918a04c9b9ffb7ea | // { dg-do assemble }
class base {
public:
virtual ~base();
};
class foo : public base {
public :
foo (char *cs);
virtual void op (unsigned char dummy = false);
unsigned char m_dummy;
};
void foo :: op ( unsigned char dummy)
{
bool bar;
if (dummy) {
foo IT_tempPhase( 0 )... |
google | chromium | eb31 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C | 197 | utf_8 | d7b3e4fda9dff8856f7aff223775823f | // { dg-do run }
#include<iostream>
int main() {
try {
throw 1;
} catch(...) {
try {
throw;
} catch(int) {
}
try {
throw;
} catch(int) {
}
}
return 0;
}
|
google | chromium | eb106 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C | 385 | utf_8 | 5ef889682d511f0ac101f0885f5a3831 | // { dg-do assemble { target native } }
// { dg-options "-O2 -fPIC " }
struct T
{
const char* f1;
int f2;
};
void f(T*);
int g();
extern char a1[];
inline int m(int a, int b) {return b < a ? 2 : 1;}
void
h()
{
T a[10];
int i(0);
bool c;
{
a[i++].f1 = "asf";
f(a);
i = 0;
}
a[i].f1 = &a1[1];
a[i].f2 = m... |
google | chromium | eb54 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C | 154 | utf_8 | f81c5754161a5ff2ebd2406bece56fd1 | // { dg-do run }
#include <iomanip>
#include <iostream>
#include <cstdlib>
int main()
{
std::cout << std::setbase(3) << std::endl;
std::exit (0);
}
|
google | chromium | eb20 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb20.C | 479 | utf_8 | b8297fbb8ea21dd74224c4f583013d82 | // { dg-do assemble }
// Error: ICE on 2.7.2.3 and EGCS 1.0.0.
template<int N1, int N2>
struct meta_max {
enum { max = (N1 > N2) ? N1 : N2 };
};
struct X {
enum {
a = 0,
n = 0
};
};
template<class T1, class T2, class T3>
struct Y {
enum {
a = T1::a + T2::a + T3::a,
n = m... |
google | chromium | eb103 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb103.C | 287 | utf_8 | 9886b6c2178e1508f318b3027cdd915d | // { dg-do assemble }
// Error: Internal compiler error in 2.7.2 & EGCS 1.0.0
template <int nlimb, int i>
inline unsigned f (unsigned* ptr);
template <int nlimb>
inline unsigned f<nlimb,nlimb> (unsigned* ptr) // { dg-error "function template partial specialization" }
{
return 1;
}
|
google | chromium | eb23 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb23.C | 289 | utf_8 | 9d707a3f73b9ac5715f144793aab4cf0 | // { dg-do assemble }
class foo {
protected:
void __duplicate ();
};
class bar : public virtual foo {
protected:
void __duplicate() {
foo::__duplicate ();
}
};
class oops : public virtual bar {
protected:
void __duplicate() {
foo::__duplicate ();
}
};
|
google | chromium | ice990323-5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C | 187 | utf_8 | 1e0df75bb630426aaa9e32e30df6eeaf | // { dg-do assemble }
// check attempting to throw an overloaded function
struct A {
void f(int);
void f(long);
};
void g()
{
throw &A::f; // { dg-error "" } insufficient context
}
|
google | chromium | eb64 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb64.C | 471 | utf_8 | b6595ba27fd258c0900d7e3a4566c9ca | // { dg-do assemble }
template <class A>
class B:public A {
B(){}
};
template <class A>
class C:public B<A> {
C(){}
};
/*
g++ bugsol.C
bugsol.C:9: Internal compiler error.
g++ -v
Reading specs from
/home/pierre/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.16/specs
gcc version egcs-2.90.16 971105 (gcc2-97080... |
google | chromium | eb11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C | 443 | utf_8 | cefd72ccf9ccca809d4dc7746e56f11f | // { dg-do assemble }
template<int N1, int N2>
struct meta_max {
enum { max = (N1 > N2) ? N1 : N2 };
};
struct X {
enum {
a = 0,
n = 0
};
};
template<class T1, class T2>
struct Y {
enum {
a = T1::a + T2::a,
// NB: if the next line is changed to
// n = (T1::n > T2... |
google | chromium | eb37 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb37.C | 286 | utf_8 | d58ae7b46abd9e5199b3fb1440309bb9 | // { dg-do assemble }
template<class T>
struct A {
typedef T T1;
};
template<class T>
struct B {
typedef T T2;
};
template<class T>
struct C {
};
template<class E>
C<typename E::T2::T1>
foo (E)
{
return C<typename E::T2::T1>();
}
void test()
{
foo(B<A<int> >());
}
|
google | chromium | eb35 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb35.C | 512 | utf_8 | 022bceee6bb804935953e550cbad5afc | // { dg-do assemble }
class string
{
public:
string();
string(const string& x);
string(const char* t);
~string();
};
void set_status(string message);
class StatusDelay {
private:
string cause;
public:
StatusDelay(const string& c)
{
set_status(cause);
}
~StatusDelay()
{
... |
google | chromium | eb126 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb126.C | 633 | utf_8 | 8a691bca88fb3b558c8cbbbcd9c83824 | // { dg-do run }
#include <string.h>
class SomeClass_t {
public:
SomeClass_t () : x (11) {}
protected:
float x;
};
class DynamicOnly_t {
public:
static DynamicOnly_t* create (const char* name = "UNDEF",
const SomeClass_t& somec = *(new SomeClass_t
())) {
return new DynamicOn... |
google | chromium | eb133a | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb133a.C | 265 | utf_8 | bc4689e554f4823c5225c057950715a7 | // { dg-do assemble }
// Gives ICE 109
// Reported against EGCS snaps 98/06/28.
int main()
{
try {
}
catch (std::bad_alloc) { // { dg-error "" } parse error
return 1;
}
return 0;
}
|
google | chromium | eb8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb8.C | 259 | utf_8 | a085e6cf1eca394616113132643a792e | // { dg-do assemble }
class foo {
public:
operator <<(const void *); //{ dg-error "" } no return type
operator <<(char *); //{ dg-error "" } no return type
};
void main() // { dg-error "must return .int" }
{
foo f;
f << (void*)0;
}
|
google | chromium | eb49 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb49.C | 610 | utf_8 | 262caaf3359d2027128ac4b4da113886 | // { dg-do assemble }
// Here we declare ::S
typedef struct s1 *S;
struct s1
{
int s;
};
struct A
{
// Here we declare A::S
typedef struct s1 *S;
};
template<class T, class U> class XX;
template<class T, class U>
class X
{
public:
static T *do_something ();
friend class T; // { dg-error "" } `T' is a te... |
google | chromium | eb95 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb95.C | 201 | utf_8 | 49cc5a20317c1043ea84134c98b3e298 | // { dg-do run }
struct A {};
template <class T>
void operator+ (A &i, T &b) {}
template<class T>
void func (A &a, T &b) {}
int main()
{
A a;
#if STRANGE
func(a, "egcs");
#endif
a+"egcs";
}
|
google | chromium | eb28 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb28.C | 312 | utf_8 | dc881655a5dcfa0cdbdd902204cb69d8 | // { dg-do assemble }
#include <vector>
using namespace std;
enum s { S };
class a
{
vector<s> vs;
friend class b;
};
struct b
{
vector<a> va;
operator vector< vector<s> >()
{
vector< vector<s> > vvs(va.size());
return vvs;
}
};
|
google | chromium | eb12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb12.C | 527 | utf_8 | 8a824bc1662e2bc1e829ee6e0d13c4c1 | // { dg-do assemble }
// Error: Internal Compiler Error in 2.7.2. & egcs 1.0.0
#ifndef NO_META_MAX
template<int N1, int N2>
struct meta_max {
enum { max = (N1 > N2) ? N1 : N2 };
};
#endif
struct X {
enum {
a = 0,
n = 0
};
};
template<class T1, class T2>
struct Y {
enum {
a = T1... |
google | chromium | eb82 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb82.C | 251 | utf_8 | bf4dffe16b0ade11667a1a290a8444f4 | // { dg-do assemble }
#include <stdio.h>
template <int n1>
double val <int> () // { dg-error "" } bogus code
{
return (double) n1;
}
int main ()
{
printf ("%d\n", val<(int)3> ()); // { dg-error "" } val undeclared
}
|
google | chromium | ebnull-cast | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ebnull-cast.C | 255 | utf_8 | 2169fcc343d8d7c6033fe636d18909af | // { dg-do run }
class null {
null (null const&);
void operator& ();
public:
null () {}
template <typename T>
operator T* () const { return 0; }
} const null;
int main ()
{
int *p = static_cast<int*>(null);
return 0;
}
|
google | chromium | eb90 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb90.C | 265 | utf_8 | cd5292938a62b36f11cfaf58d1d1e034 | // { dg-do assemble }
// { dg-options "-O2" }
#ifdef HIDE_BUG
#define realloc Realloc
#endif
class TmpRgn {
public:
void
realloc();
};
class TmpActor {
TmpRgn tmpRgn;
public:
void
realloc() {
tmpRgn.realloc();
}
};
|
google | chromium | eb84 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb84.C | 284 | utf_8 | 82ebc0a368a4d3db129faff1d32ded02 | // { dg-do run }
// Error: Internal Compiler error on GCC 2.7.2.3 & EGCS 1998/05/23 snapshot.
class A {
public:
enum { ONE, TWO, THREE };
};
template <const unsigned c1,const unsigned c2,const unsigned c3>
void f() {
}
int
main()
{
f<A::ONE,A::TWO,A::THREE>();
}
|
google | chromium | eb116 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb116.C | 230 | utf_8 | 518101006f1cba51035f142508d3c90a | // { dg-do run }
template <class INT>
class b
{
private:
char a(int x)
{
union {
int i;
char c;
} val;
val.i = x;
return val.c;
}
public:
b() {
}
};
int main() {
b<int> n;
return 0;
}
|
google | chromium | eb125 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C | 435 | utf_8 | afde15a3c1cc721d753e92b5ca611620 | // { dg-do assemble }
struct test_box
{
void print(void);
};
void test<class BOX> (test_box *); // { dg-error "" } illegal code
class test_square
{
friend void test<class BOX> (test_box *); // { dg-error "" } does not match
}
template <class BOX> void test(BOX *the_box) // { dg-error... |
google | chromium | eb48 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb48.C | 149 | utf_8 | 4f65e058476e0d5ee95cecfc25d27593 | // { dg-do assemble }
char *t1 (const char *s)
{
return const_cast<char *>(s);
}
char *&t1 (const char *&s)
{
return const_cast<char *&>(s);
}
|
google | chromium | eb71 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb71.C | 430 | utf_8 | ace655424d8104d76d1f908b54d8526d | // { dg-do assemble }
typedef __SIZE_TYPE__ size_t;
class A {
public:
void operator delete(void*, size_t);
void* operator new(size_t);
};
class B : public A {
friend class D;
B();
unsigned counter;
};
class D {
int ins( B*&);
};
int
D::ins( B*& tempN)... |
google | chromium | eb55 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C | 288 | utf_8 | 515d9f8631388b57acb4079b3ad6e1d9 | // { dg-do assemble }
// Since the constructor is in streambuf.h, additional diagnostics are
// produced, which are not really supported in the old-deja framework
#include <sstream>
void
t( char* buf )
{
std::istrstream str = buf; //{ dg-error "" } inaccessible copy constructor
}
|
google | chromium | ice990323-4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C | 207 | utf_8 | 109add3f9d0f1266286de36607a6be27 | // { dg-do assemble }
// try throwing template function name
template <class T> void f(T);
template <class T> void f(T)
{
}
void g()
{
throw &f; // { dg-error "" } insufficient contextual information
}
|
google | chromium | eb114 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb114.C | 637 | utf_8 | 3cfd21e032a7b6c6168c382e3a96ce06 | // { dg-do run }
#include <string.h>
class SomeClass_t {
public:
SomeClass_t () : x (11) {}
protected:
float x;
};
class DynamicOnly_t {
public:
static DynamicOnly_t* create (const char* name = "UNDEF",
const SomeClass_t& somec = *(new SomeClass_t
())) {
return new DynamicOn... |
google | chromium | eb83 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C | 268 | utf_8 | 24392840d4084b13ca449e1d760737f6 | // { dg-do run { target native } }
// { dg-options "-fprofile-arcs -ftest-coverage" }
void
test_swap(int& x, int& y) throw()
{
int tmp = x;
x = y;
y = tmp;
}
main()
{
int i = 5;
int j = 7;
test_swap(i, j);
}
/* { dg-final { cleanup-coverage-files } } */
|
google | chromium | eb127 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb127.C | 1,173 | utf_8 | b8c55e6c915ce77498d2870d52cdec65 | // { dg-do assemble }
// Gets ICE 40.
#include <vector>
#include<string>
#include <iostream>
using namespace std;
class ODEsolver
{
private:
void eulerODE(vector<double>& y, double& t, double& dt);
void midpointODE(vector<double>& y, double& t, double& dt);
protected:
void (ODEsolve... |
google | chromium | eb92 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb92.C | 81 | utf_8 | ad2141db80c1ca1cddf3b85bdebbdbba | // { dg-do assemble }
template<int N> f<0>(){} // { dg-error "" } invalid code
|
google | chromium | eb75 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb75.C | 575 | utf_8 | 055def38a375aca3237eeade062815d5 | // { dg-do assemble }
int*& foo (int const *& x)
{
return const_cast<int*&> (x);
}
/*
If the references in this example are changed to pointers (change
all `&''s to `*'), no warnings result.
I think this is incorrect according to CD2 5.2.11, para 4:
4 An lvalue of type T1 can be explicitly converted to an lvalue... |
google | chromium | eb38 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb38.C | 511 | utf_8 | db68a817c3bdd5f97fe7e97593e0eee4 | // { dg-do assemble }
class string
{
public:
string();
string(const string& x);
string(const char* t);
~string();
};
void set_status(string message);
class StatusDelay {
private:
string cause;
public:
StatusDelay(const string& c)
{
set_status(cause);
}
~StatusDelay()
{
... |
google | chromium | eb119 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C | 105 | utf_8 | d7b5ad9dc89639b7fdb1139e9f51ce86 | // { dg-do assemble }
template<bool B>
void f()
{
}
int main()
{
f<bool>(); // { dg-error "" } .*
}
|
google | chromium | 980310-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/980310-1.C | 800 | utf_8 | 18090564deaeabb2833db724176f5e3e | // { dg-do run }
// { dg-options "-g" }
// Internal compiler error on egcs 1.0.1 i586-pc-linux-gnulibc1.
typedef __SIZE_TYPE__ size_t;
struct dummy { };
struct arrrrrgh { };
template<class Par,class Rand = arrrrrgh>
struct whyyyyyyy { };
template<class T, class S =dummy>
struct grrrrrrrr { };
template<cla... |
google | chromium | eb80 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb80.C | 103 | utf_8 | 1eb9a1d899e84b46785ab32efead0469 | // { dg-do assemble }
#include <exception>
class A {
class B : public std::exception {}
;
};
|
google | chromium | eb60 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb60.C | 266 | utf_8 | 9ec1bcc10a422ce1681840b226b2e797 | // { dg-do assemble }
#include <string>
class t {
public:
t(const std::string& s) : s_(s) {}
std::string s_;
static t* t_;
};
t* t::t_;
t* makeT()
{
return new t("test");
return t::t_ ? t::t_ :
t::t_ = new t("test");
}
|
google | chromium | eb70 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb70.C | 298 | utf_8 | 559dc3f40084aebeeb2d90d1fb731ed3 | // { dg-do assemble }
// conversion ops should be treated as coming from the most derived class
// for overload resolution. See [over.match.funcs].
class X {
public:
operator bool() const;
};
class Y : public X {
private:
operator void*() const;
};
int f(Y const& y) {
return bool(y);
}
|
google | chromium | eb88 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb88.C | 172 | utf_8 | baf5eb8554a10760c7a7bf62b952eb28 | // { dg-do run }
// { dg-options "-w" }
// Another magic NULL problem.
#include <stddef.h>
int main()
{
try
{
throw(NULL);
}
catch (...)
{
}
}
|
google | chromium | eb34 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb34.C | 268 | utf_8 | 66189ab4fa15789bd8c06637aab5a9a7 | // { dg-do assemble }
class Base {
public:
class Bar { public: virtual ~Bar() {} };
};
class Derived : public Base {
public:
class Bar : public Base::Bar {};
};
template <class T>
class XYZ : public T::Bar {
};
void test() {
XYZ<Base> b;
XYZ<Derived> d;
}
|
google | chromium | eb79 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C | 669 | utf_8 | 46630c68d7b2b0f99885ee143b638dd5 | // { dg-do assemble }
// Makes bogus x86 assembly code.
#include <iostream>
// The VxWorks kernel-mode headers define a macro named "max", which is not
// ISO-compliant, but is part of the VxWorks API.
#if defined __vxworks && !defined __RTP__
#undef max
#endif
using namespace std;
template<class T>
T max(T a, T b)... |
google | chromium | eb120 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb120.C | 528 | utf_8 | b0b80d381a13416603feedf9611b816d | // { dg-do run }
template<double functionToIntegrate(double)>
double integrate(double a, double b, int numSamplePoints)
{
// PRECONDITION(numSamplePoints > 1);
double delta = (b-a) / (numSamplePoints-1);
double sum = 0.;
for (int i=0; i < numSamplePoints; ++i)
sum += functionToIntegrate(a + i*... |
google | chromium | eb93 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb93.C | 599 | utf_8 | fdaf4f720a8e78f34da21f6143459cb5 | // { dg-do assemble }
// Error: Internal compiler error on egcs 1998/05/28 snapshot.
const double M_PI=3.14159265358979323846;
template<int N,int I,int J,int K>
inline double SineSeries()
{
const double x=I*2*M_PI/N;
const bool go=K+1!=J;
return 1.0-x*x/(2*K+2)/(2*K+3)*SineSeries<N*go,I*go,J*go,(K+1)*go>();
}
... |
google | chromium | eb109 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C | 2,102 | utf_8 | 74b4ee5a63f9801c9f28aa7601ee6f33 | // { dg-do assemble }
#include<map>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
// empty parameter class with a minimal set of operations
// if there are no weights for edges necessary
struct Empty
{
public:
Empty(int=0) {}
bool operator<(const Empty&) const { return true;}
};... |
google | chromium | eb121 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb121.C | 263 | utf_8 | 282c1b0f7110aef42ae9b46f4ed3798c | // { dg-do assemble }
class A {
private:
int i1_;
public:
void f(int const i1 = 1); // { dg-error "previous specification" }
};
void
A::f(int const i1 = 1) // { dg-error "default argument given" }
{
i1_ = i1;
}
int
main()
{
A a;
a.f();
return 0;
}
|
google | chromium | eb7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb7.C | 147 | utf_8 | eed0467f169c7a3a218649fd1bb443d9 | // { dg-do assemble }
#include <vector>
class T
{
public:
T();
};
std::vector <T> tp;
void f()
{
tp.insert(tp.begin(), 10 , T());
}
|
google | chromium | eb133b | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb133b.C | 305 | utf_8 | 9f0d61586077774e5485a9825b097a4c | // { dg-do assemble }
// Gives ICE 109
// Reported against EGCS snaps 98/06/28.
using namespace std; // { dg-error "" "" { xfail *-*-* } }
int main()
{
try {
}
catch (bad_alloc) { // { dg-error "" }
return 1;
}
return 0;
} |
google | chromium | eb129 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb129.C | 742 | utf_8 | e797227013d5ca66f3f2c5b3cac31867 | // { dg-do assemble }
// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1)
#include <list>
#include <functional>
#include <algorithm>
#include <cassert>
using namespace std;
int main()
{
list<int> l;
l.push_back(1);
l.push_back(2);
list<int>::iterator it =
... |
google | chromium | eb43 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C | 1,399 | utf_8 | e31015c0583ab48c8628bad4c22f6a72 | // { dg-do assemble }
// All the pointer_to_binary_function cases used to fail because g++
// couldn't handle converting an overloaded function to a class type.
// The first one should still fail because it requires an implicit conversion
// to pointer_to_binary_function, which has an `explicit' constructor.
#include... |
google | chromium | eb32 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb32.C | 168 | utf_8 | f4a4e96a12a4cb6184f2d8656b2d77b1 | // { dg-do assemble }
class A {
public:
void malloc(unsigned int);
};
void A::malloc(unsigned int) {}
void foo() {
A a;
a.malloc(3); // <-- line 10
}
|
google | chromium | eb99 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb99.C | 2,271 | utf_8 | af391639c62202c1066f60c310ba25a7 | // { dg-do assemble }
class ref_counted
{
protected:
ref_counted( void ) : _count( 0 ) {}
public:
unsigned int add_ref( void ) { return ++_count; }
unsigned int release( void ) { return --_count; }
unsigned int count( void ) const { return _count; }
p... |
google | chromium | eb9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb9.C | 305 | utf_8 | aeca5f507eddd33de61260287c6114e6 | // { dg-do assemble }
template <class Key>
class d0om_Hashmap
{
public:
typedef int value_type;
class iterator
{
public:
value_type* operator-> () const;
};
};
template <class Key>
typename d0om_Hashmap<Key>::value_type*
d0om_Hashmap<Key>::iterator::operator-> () const
{
return 0;
}
|
google | chromium | eb94 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C | 267 | utf_8 | ff8530ca419749647920a8409a546789 | // { dg-do assemble }
class baseClass
{
private:
static int variable;
};
class myClass : public baseClass
{
private:
static int variable; // this is intentionally duplicated
};
myClass::variable = 0; //{ dg-error "" } no type
|
google | chromium | eb51 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb51.C | 731 | utf_8 | 6d4a283105be144be9d12b5a24a173c7 | // { dg-do assemble }
typedef unsigned long Xv_opaque;
class DynaString
{
public:
DynaString();
DynaString( const DynaString& dynaStr );
DynaString( const long n );
~DynaString();
int operator ==( const char* const string ) const;
};
class DDE_Defaults
{
public:
DynaString GetHost... |
google | chromium | eb102 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb102.C | 463 | utf_8 | ee83a1efbd7590614fbf204920c56047 | // { dg-do run }
// Error: intenral compiler error on 1998/05/28 snapshot.
#include <stdio.h>
#include <stdlib.h>
void evilRises (void **ptr)
{
int *pi;
pi = new int;
*pi = 0;
*ptr = (void *)pi;
}
int main (int argc, char *argv[])
{
#ifdef WORKAROUND
union foo
#else
union
#endif
{
... |
google | chromium | eb104 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb104.C | 635 | utf_8 | d0815bd10637ef31f290d081ddbda880 | // { dg-do run }
#include <string.h>
class SomeClass_t {
public:
SomeClass_t () : x (11) {}
protected:
float x;
};
class DynamicOnly_t {
public:
static DynamicOnly_t* create (const char* name = "UNDEF",
const SomeClass_t& somec = *(new SomeClass_t
())) {
return new Dynamic... |
google | chromium | eb61 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb61.C | 84 | utf_8 | e79679e8d57af97c777b23ef2b290a90 | // { dg-do assemble }
void
action0(float& arg1)
{
long cn0 = 1;
arg1 = cn0;
}
|
google | chromium | eb10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb10.C | 479 | utf_8 | 7043c0e8dd58f93b9ec2d562d4af77b8 | // { dg-do assemble }
template <int object_size>
class _fixed_size_allocator
{
private:
struct something { };
static something * asdf;
public:
static void delete_object ();
};
template <class T>
class object_allocator
{
private:
typedef _fixed_size_allocator<sizeof (T)> ... |
google | chromium | eb29 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb29.C | 287 | utf_8 | 2d148cfc1aef7e73c84dde3cfba1ce8c | // { dg-do assemble }
#include <vector>
using namespace std;
enum s { S };
class a
{
vector<s> vs;
friend class b;
};
struct b
{
vector<a> va;
operator vector< vector<s> >()
{
return vector< vector<s> >(va.size());
}
};
|
google | chromium | eb59 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb59.C | 493 | utf_8 | 0a93ceef805435716e94c493f877f9c7 | // { dg-do run }
#define INC_FUNCTIONAL 1
#define USE_STATIC_CAST 1
#include <vector>
#include <numeric>
#ifdef INC_FUNCTIONAL
#include <functional>
#endif
using namespace std;
template<class R> int p( int val, R& r )
{
return val + r;
}
template<class R> void f( vector<R>& v )
{
#ifdef USE_STATIC_CAST
accu... |
google | chromium | ice990323-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C | 181 | utf_8 | c67a0b40ab41073ef2b127e44dfed166 | // { dg-do assemble }
//test 2
struct A {};
void f()
{
struct A; // { dg-error "" } forward ref
throw *(new A); // { dg-error "" } invalid use of undefined type
}
|
google | chromium | eb113 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C | 82 | utf_8 | dda1730a666d8970244424705aa4b904 | // { dg-do assemble }
#include <iostream>
class X : public std::streambuf
{
} ;
|
google | chromium | eb13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb13.C | 211 | utf_8 | 651675d5ae1c0851fec63f19ff07b36f | // { dg-do assemble }
template<class T>
class Array {
public:
typedef T T_numtype;
};
template<class T_array>
void f(T_array, typename T_array::T_numtype)
{
}
void g()
{
f(Array<float>(), float());
}
|
google | chromium | eb107 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb107.C | 254 | utf_8 | 3e53dc52c997be42c47ab4e29c760531 | // { dg-do assemble }
template <class T>
struct X
{
virtual void f(int) const;
};
template <class T>
struct Y: public X<T>
{
virtual void f(int) const;
};
template <class T>
void Y<T>::f(int) const
{
}
template <>
void Y<bool>::f(int) const;
|
google | chromium | eb41 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C | 197 | utf_8 | a2554475431f18dfadd63645b06b9130 | // { dg-do run }
#include <iostream>
#include <iterator>
#include <string>
std::ostream_iterator<std::string> oo(std::cout);
int main()
{
*oo = "Hello, ";
++oo;
*oo = "world!\n";
}
|
google | chromium | eb129a | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb129a.C | 746 | utf_8 | c04a24af2e447a423deb4302f7e091b4 | // { dg-do assemble }
// Gives ICE on EGCS release branch as of 98/06/08 on i686-pc-linux-gnulibc1)
#include <list>
#include <functional>
#include <algorithm>
#include <cassert>
int main()
{
std::list<int> l;
l.push_back(1);
l.push_back(2);
std::list<int>::iterator it =
std::find_... |
google | chromium | eb14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb14.C | 446 | utf_8 | f0055ccdf10889b518a9ab6870864ee4 | // { dg-do run }
extern "C" void abort ();
template<int N>
struct I {
};
template<class T>
struct A {
int r;
template<class T1, class T2>
void operator()(T1, T2)
{ r = 0; }
template<int N1, int N2>
void operator()(I<N1>, I<N2>)
{ r = 1; }
};
int main()
{
A<float> x;
I<0> a;
I<1> b;
... |
google | chromium | eb39 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C | 318 | utf_8 | b92d300c6fe701dce20422ebf6b69f31 | // { dg-do assemble }
#include <cctype>
#include <iostream>
#include <sstream>
#include <cstring>
using namespace std;
extern bool foo2 (ostream &out, istream &in);
bool
foo1 (ostream &out, const char *in)
{
string tmp(in, std::strlen(in));
stringbuf sb (tmp);
istream fmt (&sb);
return foo2 (out, fmt);
}
|
google | chromium | eh990323-4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-4.C | 959 | utf_8 | 7cdf127b9647ac0256ead12616afd081 | // { dg-do run }
// check MI and VBC offsets on throw
extern "C" void abort ();
extern "C" void exit (int);
struct A {
int x[23];
};
struct B : virtual public A {
int y[33];
};
struct C : virtual public A, public B {
int z[43];
};
struct D {
int xx[53];
};
struct E : public D, public A {
int yy[63];
};
C c;... |
google | chromium | eb122 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb122.C | 256 | utf_8 | 6cea022036005800b290af273d7eb4f5 | // { dg-do assemble }
// { dg-options "" }
// Disable -ansi -pedantic-errors because of GNU extension
template<class foo>
class bar {
public:
void baz() { (({ while( foo::baz() );})); }
};
template<class foo>
void baz() { (({ while( foo::baz() );})); }
|
google | chromium | eb30 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C | 210 | utf_8 | a7dc048c55c4684fe2a1abc5448c3dee | // { dg-do assemble }
#include <fstream>
class bifstream : public std::ifstream {
public:
bifstream();
// ~bifstream();
};
void load_bin()
{
bifstream InFile;
if (!InFile)
return;
}
|
google | chromium | eh990323-5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-5.C | 669 | utf_8 | 2663a885e757a8cd6e06528062067fd0 | // { dg-do run }
// check cleanup of partial array objects
extern "C" void abort (void);
extern "C" void exit (int);
int ctor = 0;
int dtor = 0;
int cnt = 1;
struct A {
int x;
A();
A(const A&);
~A();
};
A::A()
{
if (cnt == 10)
throw 57;
x = cnt++;
ctor++;
}
A::A(const A&)
{
if (cnt == 10)
throw 57;
x... |
google | chromium | eb58 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb58.C | 207 | utf_8 | 58bc826ccb2159a92b85635040d7603e | // { dg-do run }
// { dg-options "-w -fpermissive" }
// Test for g++ array init extension
class A {
public:
A(int i) {}
private:
A( const A & ) {}
};
main()
{
A *list = new A[10](4);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.