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 | parse5 | .C | native_client/nacl-gcc/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 | chromium | template31 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template31.C | 615 | utf_8 | 1b0ebe91aa68fdfb45280fb9a08e7c53 | // { dg-do run }
// PRMS Id: 8569
#include <iostream>
#include <vector>
#include <cstdlib>
using std::vector;
class Component {
int george;
char mabel[128];
};
class CopyMe {
public:
CopyMe(){;}
private:
vector<Component> strvec;
};
class IncludeIt {
public:
IncludeIt() {}
~IncludeIt() {... |
google | chromium | default1 | .C | native_client/nacl-gcc/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 | chromium | access17 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/access17.C | 533 | utf_8 | 5dda388b1971d06e76c74bc56efbaf2e | // { dg-do assemble }
// Make sure definitions of static members have the right access.
struct A {
protected:
int i; // { dg-error "" } private
int f (); // { dg-error "" }
};
struct B: public A {
static int A::*p;
static int (A::*fp)();
};
int A::* B::p = &A::i; // { dg-er... |
google | chromium | rfg25 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg25.C | 106 | utf_8 | 6dac5867e70284742950f30fffc05b04 | // { dg-do assemble }
struct { int :0; }; /* { dg-error "" } anon struct not used to declare objects */
|
google | chromium | crash6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/crash6.C | 136 | utf_8 | 708d8b60488e8033c68be64bdd4d3a10 | // { dg-do assemble }
// Bug: g++ dies on the below.
class A { };
void f ()
{
A a;
a.~a(); // { dg-error "" } causes segfault
}
|
google | chromium | overload13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload13.C | 491 | utf_8 | 39865fb082322c1d2f877e1e31f98ce2 | // { dg-do run }
// Bug: g++ screws up derived->base conversions when calling a global function
// in the presence of matching members in the base. Whew.
struct xios {
virtual ~xios() { }
};
struct xistream: virtual public xios {
int j;
void operator>>(char&);
};
struct xfstreambase: virtual public xios { };... |
google | chromium | template4 | .C | native_client/nacl-gcc/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 | chromium | inline3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/inline3.C | 810 | utf_8 | d5b295340ce3c4e7c90072f6f9d23b1f | // { dg-do run }
// { dg-options "-O2" }
// Testcase for order of destruction.
extern "C" int printf (const char *, ...);
int c;
int r;
struct B {
B();
B( B const& );
~B();
};
struct A {
A();
A( A const& );
~A();
operator B ();
};
inline A::operator B () { printf( "operator B ()\n"); return B(); }
A... |
google | chromium | hmc1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/hmc1.C | 340 | utf_8 | 5e32d423dfb820237ec4d5b2dfbc181f | // { dg-do assemble }
// GROUPS passed templates default-arguments
template <class I>
class Klasse {
public:
void func1(int n=1);
void func2(int d) {}
};
template <class I>
void Klasse<I>::func1(int n) {}
//if this is replaced by:
//void Klasse<I>::func1(int n=1) {}
//the code compiles.
int main() {
Klasse<in... |
google | chromium | template28 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template28.C | 315 | utf_8 | 55a4409b20effb409975701d8a1450dc | // { dg-do run }
// PRMS Id: 7179
template <class T>
class Car{
public:
Car();
} ;
class Wheels{
public:
Wheels();
} ;
class Shop
{
public:
Shop();
private:
Car<Wheels> car ;
} ;
Wheels::Wheels() {}
Shop::Shop() {}
int main()
{
Shop shop ;
return 0 ;
}
template <class T>
Car<T>::Car() {}
|
google | chromium | overload27 | .C | native_client/nacl-gcc/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 | chromium | overload24 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload24.C | 288 | utf_8 | 7c012da1d459fa7efbbe77bdacf46eb4 | // { dg-do assemble }
// PRMS Id: 5124
// Bug: g++ promotes bar to int* too soon and the call to f fails.
typedef int arr[1];
struct A {
void f(void);
void f(arr &);
void g(void);
void g(int *);
void h(void);
};
void A::h(void)
{
arr bar;
f(bar);
g(bar);
}
|
google | chromium | offset3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/offset3.C | 226 | utf_8 | 245c3abedb7719c4cc1b50035330729b | // { dg-do assemble }
// PRMS Id: 5070 (bug 2)
struct A {
void f ();
};
struct Ptr {
A* operator->();
};
struct B {
Ptr p;
};
struct C: public B {
void g ();
};
void C::g() {
B::p->f(); // { dg-bogus "" }
}
|
google | chromium | operator | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/operator.C | 1,105 | utf_8 | 8d9dbba4769eea9a0be1c2695887ed5b | // { dg-do assemble }
// { dg-options "" }
// General test for operator overloading permissiveness.
typedef __SIZE_TYPE__ size_t;
struct A {
int operator?:(int a, int b); // { dg-error "expected type-specifier" }
static int operator()(int a); // { dg-error "must be a nonstatic member" }
static int opera... |
google | chromium | loverload4 | .C | native_client/nacl-gcc/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 | chromium | this | .C | native_client/nacl-gcc/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 | chromium | scoping12 | .C | native_client/nacl-gcc/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 | chromium | conversion3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/conversion3.C | 241 | utf_8 | 8e29b3ddb16a6842367a4a2baaa9377b | // { dg-do assemble }
void qsort (void *, int, int, int (*)(const void *, const void *));
int f (char *, char *);
void g ()
{
typedef int (*pf)(void *, void *);
qsort(0, 0, 0, pf(f)); // { dg-error "" } adding const to function parms
}
|
google | chromium | crash8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/crash8.C | 166 | utf_8 | f1a5d1a491e1458924f43b60cd9f3bbe | // { dg-do assemble }
struct A {
A();
A(A); // { dg-error "" } copy ctor must take reference
};
int main()
{
A a;
A b(a); // causes compiler segfault
}
|
google | chromium | overload19 | .C | native_client/nacl-gcc/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 | chromium | parse7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse7.C | 121 | utf_8 | 6d54085572d370d3dcef11aec57be624 | // { dg-do assemble }
// Bug: g++ tries to parse this as a constructor.
typedef int foo;
struct A {
foo (*bar)();
};
|
google | chromium | destruct2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/destruct2.C | 297 | utf_8 | c414c7c23ef6676866d094783f12317b | // { dg-do assemble }
// PRMS Id: 4342
// Bug: g++ does not massage things enough to allow calling ~X().
struct X
{
virtual ~X ();
};
struct Y : public X
{};
struct Z : public Y, public X
{}; // { dg-warning "" }
void foo ()
{
Z* f = new Z;
delete f; // { dg-bogus "" }
}
|
google | chromium | tempcons | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/tempcons.C | 174 | utf_8 | 9e42d5df6437e76834d1b688b85f8b68 | // { dg-do assemble }
// Bug: member initializers are allowed where they shouldn't be.
template <class T>
struct A {
int i;
Blarg () : i(0) { } // { dg-error "" }
};
|
google | chromium | pmem3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/pmem3.C | 263 | utf_8 | a4443cf3b2310e9fdd2347e296db725e | // { dg-do run }
// Test that comparison of pointers to members does not complain about
// contravariance violation.
struct A { int i; };
struct B : public A { int j; int f (); };
int main ()
{
int A::*apm = &A::i;
int B::*bpm = apm;
return apm != bpm;
}
|
google | chromium | temporary2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C | 542 | utf_8 | 68014ccdddef9b35e0193c7988af2256 | // { 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 | chromium | access11 | .C | native_client/nacl-gcc/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 | chromium | ambig2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ambig2.C | 367 | utf_8 | c241c8b031388288ae124eb72c85b118 | // { dg-do assemble }
// { dg-options "-Wno-pointer-arith" }
// Testcase for ambiguity between cast and parmlist.
// This ambiguity accounts for 1 of the r/r conflicts.
// Do not compile with -pedantic so that the compiler will accept taking
// the sizeof a function type.
void f(){
(void)sizeof(int((int)1.2));
(v... |
google | chromium | inline2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/inline2.C | 223 | utf_8 | e97423b043f136c0afd26832a1056bab | // { dg-do assemble }
// { dg-options "-O" }
// Bug: the lang-specific bits of the decl for g aren't being copied when
// inlining.
inline void f () {
void g ();
}
void h() {
f(); // causes compiler segfault -
}
|
google | chromium | nested4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/nested4.C | 303 | utf_8 | 46cd51855bd2bcb4fb246570df6d963e | // { dg-do assemble }
// Subject: extern "C" nested class
// Date: Fri, 13 Aug 1993 15:33:53 +0200
extern "C" {
struct A {
struct B { int j; } *x;
};
}
void
foo () {
A a;
struct A::B *b;
b = a.x; // { dg-bogus "" } type `B' is not a base type for type `B'
} |
google | chromium | overload22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload22.C | 290 | utf_8 | bc7e41c42c6e2576b834163c75d5d78e | // { dg-do assemble }
// PRMS Id: 4574
// Bug: g++ prefers int to double for float& argument
inline double abs (double x) { return x;}
inline int abs (int i) { return i; }
float& fn(float& f)
{
return f;
}
void foo()
{
float f = 23.45;
abs(fn(f)); // gets bogus warning
}
|
google | chromium | template7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template7.C | 178 | utf_8 | ebdf62f7f3836654110fa87cfd57eb7f | // { dg-do assemble }
// PRMS Id: 4826
class A;
template <class T> void f(const T&, const T&);
void g (const A& a, A& b) {
f (a, b); // { dg-bogus "" } failed unification
}
|
google | chromium | new2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/new2.C | 160 | utf_8 | 4a97eabb2936112e96b49ea1a76e3316 | // { dg-do run }
// { dg-options "-Wno-deprecated -fno-exceptions" }
// PRMS Id: 6267
struct A {
int i;
A() { i = 2; }
};
main()
{
A *p = new A ();
}
|
google | chromium | rfg16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg16.C | 181 | utf_8 | d12b5f26d5c767f0038af7fb5c875bc7 | // { dg-do assemble }
// Bug: g++ doesn't push parameter decls as they are parsed.
void (*ptr) (int foo, int array[sizeof(foo)]);
void test2 (int bar, int array[sizeof(bar)]) { }
|
google | chromium | scoping3 | .C | native_client/nacl-gcc/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 | chromium | template21 | .C | native_client/nacl-gcc/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 | chromium | new4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/new4.C | 380 | utf_8 | 8a5b018fc769738ff9267be1a33abf51 | // { dg-do run }
// { dg-options "-fcheck-new" }
struct A {
A(): i(42) { }
A(int j): i(j) { }
int i;
};
A* ap = new A (1);
A* ap2 = new A[3];
main ()
{
if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
return 1;
A* ap = new A (1);
A* ap2 = new A[3];
if (ap->i != 1 || ap2[0].i... |
google | chromium | init4 | .C | native_client/nacl-gcc/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 | chromium | scoping13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping13.C | 198 | utf_8 | c95f927cfb45bc8afae59ec5c34f2c56 | // { dg-do assemble }
struct A { typedef int foo; };
struct B: public A {
typedef int bar;
struct C {
void g (B::bar); // { dg-bogus "" } nested type failure
void f (B::foo);
};
};
|
google | chromium | explicit | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/explicit.C | 259 | utf_8 | 48450b1b5f0295f7905a77b1f41b6274 | // { dg-do assemble }
// Testcase for explicit instantiation of templates.
template <class T>
class A {
T t;
public:
void f () { }
};
template class A<int>;
template <class T> T min (T a, T b) { return (a < b ? a : b); }
template int min (int, int);
|
google | chromium | synth6 | .C | native_client/nacl-gcc/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 | chromium | access5 | .C | native_client/nacl-gcc/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 | chromium | overload34 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload34.C | 99 | utf_8 | 67066a5a83966325305a697e98a8a080 | // { dg-do assemble }
// PRMS ID: 8010
class X {
int & flag;
public:
void f(){ flag++ ; }
};
|
google | chromium | template44 | .C | native_client/nacl-gcc/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 | chromium | synth2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/synth2.C | 242 | utf_8 | 221fe47e6a82a0c5750f0f947f85b57f | // { dg-do assemble }
// PRMS Id: 4623
// Bug: g++ tries and fails to synthesize a copy constructor for D.
class A { };
class B: public virtual A { };
class C: public A { };
class D: public B, public C { }; // { dg-bogus "" } bad synthesis
|
google | chromium | binding2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/binding2.C | 224 | utf_8 | 7e21caedc80f7ec02092414e52c37458 | // { dg-do assemble }
// Bug: g++ screws up binding levels in a switch statement with cleanups.
struct A {
~A() { }
};
int f (int i)
{
switch (i) {
default:
A a;
}
return 1;
} // causes compiler segfault
|
google | chromium | rvalue1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rvalue1.C | 1,121 | utf_8 | 8d7bfb887f857b536bd49eb6280f1359 | // { dg-do run }
// PRMS Id: 6000
// Bug: g++ gets confused trying to build up a reference to a cast.
class String {
protected:
char *cp;
public:
String(char *incp);
String(const String &constStringRef);
virtual void virtualFn1(void) const {;}
};
String::String(char *incp)
{
cp = incp;
}
String::String(co... |
google | chromium | access4 | .C | native_client/nacl-gcc/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 | chromium | dtor | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/dtor.C | 133 | utf_8 | f886fba98a8473911e0d9eef1980e41e | // { dg-do assemble }
struct A {
~A();
};
struct B {
~B();
};
int main()
{
A a;
a.~B(); // { dg-error "" } wrong name
}
|
google | chromium | builtin2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/builtin2.C | 139 | utf_8 | b2517f61d6564dd5a82b4acf0e6bcb03 | // { dg-do assemble }
static inline void strlen (const char *) { }
void f ()
{
strlen("Hi"); // { dg-bogus "" } wrongful overload
}
|
google | chromium | net2 | .C | native_client/nacl-gcc/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 | chromium | scoping11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping11.C | 135 | utf_8 | 55dc1fca689030b5a494bddbb4c29887 | // { dg-do assemble }
void f ();
void g ()
{
int f;
{
void f ();
f (); // { dg-bogus "" } trying to call integer
}
}
|
google | chromium | parse3 | .C | native_client/nacl-gcc/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 | chromium | rfg22 | .C | native_client/nacl-gcc/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 | chromium | aggregate | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/aggregate.C | 189 | utf_8 | 40698f8dcb21cc22f4864696f1071eed | // { dg-do run }
struct A { int i; };
int main()
{
A a1 = { 42 };
A a2 (a1);
A a3 = { 137 };
a1 = a3;
if (a1.i == 137 && a2.i == 42 && a3.i == 137)
return 0;
return 1;
}
|
google | chromium | byval2 | .C | native_client/nacl-gcc/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 | chromium | dot | .C | native_client/nacl-gcc/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 | chromium | virtual2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/virtual2.C | 184 | utf_8 | df2e95f2cb604e33043e5e22310ad808 | // { dg-do run }
struct A {
virtual A* f () { return this; }
};
struct B: public A {
virtual B* f () { return 0; }
};
int main ()
{
A* ap = new B;
return (ap->f () != 0);
}
|
google | chromium | 2371 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/2371.C | 9,450 | utf_8 | f864717479387b2c1ef761870928e97e | // { dg-do run }
// { dg-options "" }
# 1 "SetLS.cc"
// GROUPS passed templates nested-classes
//
// The SetLS template test
//
//
#pragma implementation "ListS.h"
#pragma implementation "SetLS.h"
#include <cstdlib>
#include <iostream>
using namespace std;
# 1 "../../templates/SetLS.h" 1
// -*- C++ -*-
//
// A Set Tem... |
google | chromium | overload8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload8.C | 171 | utf_8 | a9b091e6f785618c8abcc1b99b6614dc | // { dg-do assemble }
// Bug: g++ fails to catch the ambiguity below.
struct A {
operator int () { return 1; }
operator int &() { return 1; } // { dg-error "" }
};
|
google | chromium | scoping2 | .C | native_client/nacl-gcc/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 | chromium | synth7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/synth7.C | 231 | utf_8 | a04f1c7b8c7495f28bbc0d57eb6602c0 | // { dg-do run }
// Testcase to make sure that synthesized methods are found when needed.
struct B { ~B() { } };
struct A { B b; };
int main()
{
A a, b (a), c = A();
A& (A::*afp)(const A&) = &A::operator=;
(a.*afp) (b);
}
|
google | chromium | incomplete1 | .C | native_client/nacl-gcc/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 | chromium | lineno | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/lineno.C | 246 | utf_8 | 2d01c91bc0e25423e692fa6b20f5992c | // { dg-do assemble }
// Bug; g++ binds a function definition to the line number of a later decl.
void foo () { } // { dg-error "" } redeclared
void foo (); // { dg-bogus "" } invalid binding
void foo () { } // { dg-error "" } redeclared
|
google | chromium | warning3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/warning3.C | 210 | utf_8 | 6384c745095d306a45f180077d5d781e | // { dg-do assemble }
// { dg-options "-Wshadow" }
// Bug: overloading of 'A' for template causes bogus shadowing warnings.
template<class T>
class A
{
public:
virtual ~A() {}
};
template class A<int>;
|
google | chromium | binding | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/binding.C | 233 | utf_8 | 7d02461597ce09da5546055364e3734a | // { 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-error "" } redeclared
bar:
T t; // { dg-error "" } redeclaration
}
|
google | chromium | pmem4 | .C | native_client/nacl-gcc/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 | chromium | conversion5 | .C | native_client/nacl-gcc/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 | chromium | loverload3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/loverload3.C | 276 | utf_8 | 2e6b8c32c4dda50e4b1589ef9e67befe | // { dg-do assemble }
// PRMS Id: 2010
// Bug: g++ doesn't deal with overloads involving C-language fns properly.
extern "C" double pow (double, double);
inline double pow (double d, int e) { return pow (d, (double) e); }
void foo ()
{
pow (1.0, 1);
pow (1.0, 1.0);
}
|
google | chromium | lookup | .C | native_client/nacl-gcc/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 | chromium | rfg18 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg18.C | 242 | utf_8 | e3f5957253643467d6197c84c260a066 | // { dg-do assemble }
// Any expression may be explicitly converted to type void.
struct S { int m[10]; } object;
struct S f () { return object; }
void
test ()
{
(void) f().m; /* OK - cast to void; see constraints in 3.8.1 */
}
|
google | chromium | overload33 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload33.C | 1,340 | utf_8 | e5eb76ccd2233b5455caf1e307c6168e | // { dg-do assemble }
// PRMS ID: 7507
/* ------------------------------------------------------------ */
class Base0
{
public:
Base0() {}
virtual ~Base0() {}
};
class Base1
{
public:
Base1() {}
virtual ~Base1() {}
};
class Derived : public Base0, public Base1
{
public:
Derived() {}
vir... |
google | chromium | const | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/const.C | 221 | utf_8 | 6ad12b9005b30cbeb1fba802dc27a7d5 | // { dg-do run }
// Bug: a ends up in the text segment, so trying to initialize it causes
// a seg fault.
struct A {
int i;
A(): i(0) {}
A(int j): i(j) {}
};
const A a;
const A b(1);
int main ()
{
return 0;
}
|
google | chromium | lineno3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C | 376 | utf_8 | 95730042db5d44f4dcb6425affbcd679 | // { dg-do assemble }
// { dg-options "" }
// GROUPS passed error-reporting
// potential bug: # line directive does not get reproduced in template
// expansion
template <class T> class A
{
public:
# 200 "lineno3.C"
int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 }
// { dg-message "note" "... |
google | chromium | ambig3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ambig3.C | 320 | utf_8 | dd61795a3b7287674e730b30bf7d8d37 | // { dg-do assemble }
// Testcase for ambiguity between function and variable declaration (8.2).
struct A {
A (int, int);
int k;
};
void f ()
{
int i[2], j;
A a (int (i[1]), j); // { dg-bogus "" } late parsing
A b (int (i[1]), int j); // function
a.k = 0; // { dg-bogus "" } late parsing
b (i, j);
}
|
google | chromium | rfg28 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg28.C | 381 | utf_8 | 9be6d3008ce17e1879ba82dc3dbf0f2d | // { dg-do assemble }
/* From 01/25/94 working paper (7.1.3):
If, in a decl-specifier-seq containing the decl-specifier typedef,
there is no type-specifier, or the only type-specifiers are cv-
qualifiers, the typedef declaration is ill-formed.
*/
typedef foo; // { dg-error "" } invalid ty... |
google | chromium | friend | .C | native_client/nacl-gcc/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 | chromium | tredecl2 | .C | native_client/nacl-gcc/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 | chromium | rfg1 | .C | native_client/nacl-gcc/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 | chromium | lookup3 | .C | native_client/nacl-gcc/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 | chromium | lex1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/lex1.C | 85 | utf_8 | 8abcf8e3e06b96f67a9d0eb9fc42ae3e | // { dg-do run }
int main()
{
char c = '\351';
if (c != '\351')
return 1;
}
|
google | chromium | pmf6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/pmf6.C | 228 | utf_8 | 55aae92259661af9b0f20c6403311b7d | // { dg-do assemble }
// PRMS Id: 5656
// Bug: g++ tries (which is a bug) and fails (which is a bug) to initialize
// var at runtime.
struct A
{
int func(int);
int func() const;
};
int (A::* var) () const = & A::func;
|
google | chromium | dtor3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/dtor3.C | 367 | utf_8 | 4ab2fc38e3661e2742b975972c9b2dbc | // { dg-do assemble }
// PRMS Id: 5341
// Bug: g++ complains about the explicit destructor notation.
#include <stddef.h>
void *operator new(size_t Size, void* pThing) { return pThing; }
template <class T> class Stack {
public:
Stack() { new (Data) T(); }
~Stack() { ((T*)Data)->~T(); }
private:
char Data[sizeo... |
google | chromium | access18 | .C | native_client/nacl-gcc/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 | chromium | net | .C | native_client/nacl-gcc/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 | chromium | typedef2 | .C | native_client/nacl-gcc/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 | chromium | report | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/report.C | 1,377 | utf_8 | 51810635d8f81d80ba0e876267e92397 | // { dg-do assemble }
// { dg-options "-Wreturn-type" }
// GROUPS passed error-reporting
// DR 295 allows qualification via typedef
template <char C>
class badoo
{
};
template <int (*F) (int)>
class doowop
{
};
struct A
{
int a;
~A () { a = 0; }
operator int () { return a; }
};
extern "C" int atoi (const ch... |
google | chromium | jump | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/jump.C | 247 | utf_8 | cdf49dba584ca3a6ab8b7627c7f95242 | // { dg-do assemble }
// PRMS Id: 6036
extern int a;
int main() {
switch (a) {
case 1:
int v2 = 3; // { dg-error "" } referenced below
case 2: // { dg-error "" } jumping past initializer
if (v2 == 7)
;
}
return 0;
}
|
google | chromium | overload6 | .C | native_client/nacl-gcc/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 | chromium | const3 | .C | native_client/nacl-gcc/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 | chromium | access1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/access1.C | 200 | utf_8 | e3914ea53b1f2c71c5df680ab54f7bc5 | // { dg-do assemble }
// Bug: access declarations are broken.
class A {
public:
void foo ();
};
class B: private A {
public:
A::foo;
};
void foo() {
B b;
b.foo (); // { dg-bogus "" }
}
|
google | chromium | access12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/access12.C | 243 | utf_8 | ae9058192e3a71a7b6a74953d5f58ba4 | // { dg-do assemble }
// PRMS Id: 4694
// Bug: g++ doesn't realize that A::i refers to a member of `this' in B().
class A {
protected:
int i;
};
struct B : public A {
B () { A::i = 0; }
};
struct C : public B {
C () { B::i = 0; }
};
|
google | chromium | temporary | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/temporary.C | 333 | utf_8 | 911b0ff6a8a656d49067bdf00345cba8 | // { dg-do run }
// Subject: No destructor bug
// Date: Mon, 14 Feb 1994 12:49:45 -0300 (Arg)
// Bug: temporaries created with constructor notation aren't destroyed.
int count = 0;
class A {
public:
A() { ++count; }
~A() { --count; }
};
int main()
{
A();
return count;
} |
google | chromium | opeq4 | .C | native_client/nacl-gcc/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 | chromium | 3523 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/3523.C | 998 | utf_8 | 3c25148320e99f6c4530d8657360c9e9 | // { dg-do assemble }
// GROUPS passed assignment
class ccUnwind
{
public:
virtual ~ccUnwind (); // comment out virtual, and void diag changes
};
template<class T>
class ccHandle : public ccUnwind // similarly comment out inheritance
{
public:
ccHandle& operator = (const ccHandle& h);
};
class cc_Image; ... |
google | chromium | warning9 | .C | native_client/nacl-gcc/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 | chromium | crash12 | .C | native_client/nacl-gcc/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 | chromium | template11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template11.C | 246 | utf_8 | de552e4f0272c200b200bbcb664fc8c7 | // { dg-do run }
// Bug: initializers for static data members of templates don't get run.
template <class T> struct A {
static T t;
};
int foo () { return 1; }
template <>
int A<int>::t = foo ();
int main ()
{
return (A<int>::t != 1);
}
|
google | chromium | loverload | .C | native_client/nacl-gcc/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 | chromium | operator2 | .C | native_client/nacl-gcc/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*()"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.