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 | reftemp2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/reftemp2.C | 358 | utf_8 | f1afe21410b8c9ff2b405c0ea38c466d | // DR 391 says that we always bind a reference to the base subobject; it is
// incorrect to call the A copy constructor to initialize the parameter of
// f.
int fail;
struct A {
A() { }
A(const A&) { fail = 1; }
};
struct B : public A { };
struct X {
operator B() { return B(); }
};
X x;
void f (const A&) { }
... |
google | chromium | using2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/using2.C | 2,594 | utf_8 | 1b8f4a4e0028fb5572097168b3b0c73a | // { dg-do compile }
// based on https://bugzilla.redhat.com/beta/show_bug.cgi?id=149098
// Per the ISO C++ 90 Standard, using declarations before of after a
// declaration of the same function name and prototype should be
// errors (7.3.3/11). However, DR 101's resolution recommends
// accepting such duplicates if th... |
google | chromium | operator2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/operator2.C | 251 | utf_8 | 964600658be3f75b988efd034a9cc438 | // PR c++/19966
// { dg-do compile }
struct A
{
static operator int(); // { dg-error "must be a nonstatic" }
};
struct B
{
static int operator*(); // { dg-error "must be either" }
};
static operator int(); // { dg-error "must be a nonstatic" }
|
google | chromium | virtual1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/virtual1.C | 304 | utf_8 | f0e44977493ab0fe59f740f65a694211 | // Test that explicit scope suprresses virtual lookup even after an
// explicit object.
extern "C" int printf (const char *, ...);
struct A
{
virtual int f () { return 0; }
};
struct B: public A
{
int f () { return 1; }
int g() { return this->A::f(); }
};
int main()
{
B b;
return b.g();
}
|
google | chromium | copy1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/copy1.C | 319 | utf_8 | 1be5e97b64597eddd81b2de40bdd0362 | // PR c++/34824
struct A;
struct B
{
B (A const &); // { dg-message "note" }
B (B &); // { dg-message "note" }
};
struct A
{
A (B);
};
B
f (B const& b)
{
return b; // { dg-error "matching" "matching" }
// { dg-error "initializing" "initializing" { target *-*-* } 19 }
}
|
google | chromium | arg3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/arg3.C | 519 | utf_8 | 5f58c850338216db2c54c498ad04386a | // { dg-do compile }
struct A {};
struct B : A
{
B(int); // { dg-message "B::B" "" }
B(B&); // { dg-message "candidates" "" }
};
void foo(B);
void bar()
{
foo(0); // { dg-error "no matching function" "no matching" }
// { dg-error "initializing" "initializing" { target *-*-* } 21 }
} |
google | chromium | builtin1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/builtin1.C | 368 | utf_8 | 72c8471408f80ee1ba2fd95a8c01a613 | // Test that we don't discard builtin candidates inappropriately.
struct B { };
struct A {
operator int ();
operator B ();
};
void operator+ (B, B); // { dg-message "operator" "operator" }
int main ()
{
A a;
a + a; // { dg-error "ambiguous" "ambiguous" }
// { dg-message "c... |
google | chromium | defarg3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/defarg3.C | 311 | utf_8 | b954eab7456dcde91d0de9d826c7d3aa | // PR c++/37971
// { dg-do compile }
class C {
private:
static int f(int); // { dg-error "private" }
static int f(char);
};
class D {
public:
/* C::f is inaccessible, so this is an error, even if this function
is never called. */
static void g(int (*)(int) = C::f); // { dg-error "context" }
};
|
google | chromium | template2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/template2.C | 228 | utf_8 | 053bc5744de44c3637cdea4e8f67c443 | typedef int PyObject;
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
template<class T> int _clear(PyObject* self);
void _typeInfo()
{
reinterpret_cast<PyCFunction>(_clear); // { dg-error "overloaded function" }
}
|
google | chromium | arg2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/arg2.C | 326 | utf_8 | 4491935dbfe94276c1739fb569f323e7 | // { dg-do compile }
struct A {};
struct B : A
{
B(int);
B(A);
};
void foo(B);
void bar()
{
foo(0);
} |
google | chromium | extern-C-2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/extern-C-2.C | 131 | utf_8 | 799b32bc675b693f7b09c8e88e1f6ff9 | // PR c++/39742
void f( int, ...);
struct S
{
};
void
g()
{
void f( int, ...);
S t;
f(1, t);
}
void
f( int i, ...)
{
}
|
google | chromium | koenig2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/koenig2.C | 328 | utf_8 | a29b6caa05b24423db00096e576bf2be | template <class T>
void dummy(T& t);
void anyfunc(int x);
void Foo ()
{
anyfunc (&dummy<>); // { dg-error "cannot resolve overload" "" }
} |
google | chromium | ref1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/ref1.C | 369 | utf_8 | 02856d8d11be85bdeb888d95d224df01 | // Bug 14397: Bogus access error.
struct S {
S (int);
S(S const&);
private:
S(S&);
};
S foo()
{
int result = 0;
S s ((0,S (result)));
return S (result);
} |
google | chromium | reftemp1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/reftemp1.C | 107 | utf_8 | 4d59760484bbf6fd355f658032664fa4 | // PR c++/25950
struct X {
X();
explicit X(const X&);
};
void g(const X&);
int main()
{
g(X());
}
|
google | chromium | ambig1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/ambig1.C | 498 | utf_8 | 7237d5fda21efc2bec2c4dd99601723c | // [over.best.ics]: For the purpose of ranking implicit conversion
// sequences as described in _over.ics.rank_, the ambiguous conversion
// sequence is treated as a user-defined sequence that is indistinguishable
// from any other user- defined conversion sequence.
struct A
{
A(long);
A(char);
};
struct B
{
B(... |
google | chromium | cond1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/cond1.C | 385 | utf_8 | 2808df88b455ae0dd789dc64c1e34b25 | // Test that converting a COND_EXPR to void doesn't result in trying to
// bitwise copy a class with a nontrivial copy constructor (and thus a
// compiler abort).
// { dg-options "-O" }
struct A {
virtual ~A() { }
};
A a1, a2;
inline A& one () { return a1; }
inline A& two () { return a2; }
inline void f (int i)
{... |
google | chromium | template1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/template1.C | 152 | utf_8 | 1e6f1679bedcc11510f7cadcb011cec3 | template<typename T> T Foo (int) {T d;}
void Baz (void (*)(int), int);
int Foo ();
int Baz (int (*)(), float);
void Bar ()
{
Baz (Foo, 1.0f);
}
|
google | chromium | operator-star-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/operator-star-1.C | 470 | utf_8 | 0b2f9fcba5861b39ff227c1cbfa754b7 | // { dg-do compile }
template <class T>
struct S;
template <class T>
void operator* (S<T>, S<T>);
template <class T>
struct S
{
friend void operator*<> (S, S); // { } // okay
void operator* (T) { }
};
template <class T>
void operator* (S<T>, S<T>) { }
int main()
{
S<int> s1, s2;
s1 * s2;... |
google | chromium | prom1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/prom1.C | 120 | utf_8 | a436e857943377addaac3203f4d85eb4 | void foo(signed char) {}
typedef int bar;
void foo(bar) {}
int main (int, char **) {
char c;
return 0;
} |
google | chromium | new1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/new1.C | 469 | utf_8 | b98f0f95cceabc055dbde913623ce735 | typedef __SIZE_TYPE__ size_t;
void *operator new(size_t, unsigned int);
struct X{
X();
X(int);
};
void f(X *x = new X); // { dg-error "" }
void f(X *x = new X(4)); // { dg-error "" }
void f(X *x = new X[4]); // { dg-error "" }
void f(X *x = new (3) X(6)); // { dg-error "" }
void f(... |
google | chromium | koenig1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/koenig1.C | 263 | utf_8 | 9f3216fc0ae4a8a06ab126b5ce8c7180 | // PR c++/9336
// Bug: The first, invalid call to f caused us to crash on the second,
// valid call.
namespace N {
template <class T> void f (T);
struct A;
}
struct B;
void g ()
{
B *bp;
N::A *ap;
f (bp); // { dg-error "not declared" }
f (ap);
}
|
google | chromium | extern-C-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/extern-C-1.C | 299 | utf_8 | a251cb5e0f82a981b3f2cd7163bc4253 | // PR c++/34691
namespace A {
extern "C" void f(int = 5); // { dg-message "= 5" }
}
namespace B {
extern "C" void f(int = 4); // { dg-message "= 4" }
}
using A::f;
using B::f;
int main() {
void (*fp)(int) = f; // OK
f(3); // OK
f(); // { dg-error "default argument mismatch" }
}
|
google | chromium | unknown1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/unknown1.C | 173 | utf_8 | 645b25c36fe3bd3749a7d4b8c4bf44c2 | // { dg-do compile }
void foo(void);
int foo(int);
template <typename T> void bar(T f);
void baz() {
bar(foo); // { dg-error "<unresolved overloaded function type>" }
}
|
google | chromium | operator3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/operator3.C | 428 | utf_8 | e28afd768a2d5516c9bb5a7357c72738 | // PR c++/32756
// { dg-do compile }
// bogus overload warning
class QString;
struct QByteArray
{
QByteArray ();
bool operator!= (const QString & s2) const;
};
bool operator!= (const QByteArray & a1, const QByteArray & a2);
struct QString
{
QString ();
QString (const QByteArray & a);
};
QByteArray abbrevi... |
google | chromium | ellipsis1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/ellipsis1.C | 354 | utf_8 | 1ad1044e609c7c71b9d825f8f0c46285 | // PR c++/15142
// Bug: We were aborting after giving a warning about passing a non-POD.
// Suppress the warning about undefined behavior.
// { dg-options "-w" }
struct B {
B() throw() { }
B(const B&) throw() { }
};
struct X {
B a;
X& operator=(const X&);
};
struct S { S(...); };
void S... |
google | chromium | arg1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/arg1.C | 336 | utf_8 | fb106edf83320ef2682b57be415f13ba | // { dg-do compile }
struct A {};
struct B : A
{
B(int);
B(B &);
B(A);
};
void foo(B);
void bar()
{
foo(0);
} |
google | chromium | defarg2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/defarg2.C | 286 | utf_8 | ce3155531a697acb7fd04a7264aa57b2 | // PR c++/37971
// { dg-do compile }
class C {
private:
static int f(int);
static int f(char);
public:
static void g(int (*)(int) = f);
};
void h() {
/* Although C::f is inaccessible here, it is accessible in the
context of C::g, so there is no error. */
C::g();
}
|
google | chromium | pmf1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/pmf1.C | 516 | utf_8 | e290ad6ee59a5ec0b5557a052568a78d | // { dg-do compile }
int main ()
{
f (aip); // { dg-error "'A' is an inaccessible base of 'B'|conversion" "" }
} |
google | chromium | member2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/member2.C | 608 | utf_8 | e5c64067fac4b9dcfc16ca552eabfc2c | // { dg-do run }
// PR 7676. We didn't notice template members were different.
struct foo
{
template<class T>
int bar() {return 1;}
template<int I>
int bar() {return 2;}
};
struct baz : foo
{
using foo::bar;
template<int I>
int bar () {return 3;}
};
int main ()
{
baz b;
foo f;
if (f.bar<1> (... |
google | chromium | error1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/error1.C | 134 | utf_8 | eb8955b4f4568177f29d90808e350304 | // { dg-do compile }
struct S
{
void f () {} // { dg-error "with" "" }
int f () { return 0; } // { dg-error "overloaded" "" }
};
|
google | chromium | VLA | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/VLA.C | 296 | utf_8 | e01d22af2bf54a4df755dfb677defefb | //PR c++/2478
// G++ was rejecting this as it could not convert `int (*)[]' to `int (*)[0]'.
// Using the C99 VLA style arrays in a struct.
// { dg-do compile }
struct S {
int (*p)[];
} B;
void foo() {
int (*p)[];
B.p=p; // { dg-bogus "cannot convert" }
} |
google | chromium | using1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/using1.C | 83 | utf_8 | 85ece6c01345af5b8d407b8e19d781f9 | void f();
namespace N {
using ::f;
}
bool b;
void g() {
b = N::f == ::f;
}
|
google | chromium | operator1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/operator1.C | 442 | utf_8 | ffc2123ab343a779a615e519a991e1d9 | typedef struct _GdkDrawable GdkDrawable;
typedef struct _GdkDrawable GdkBitmap;
typedef struct _GdkDrawable GdkPixmap;
class Drawable
{
public:
operator GdkDrawable* () const;
};
class Pixmap : public Drawable
{
public:
operator GdkPixmap* () const;
};
class Bitmap : public Pixmap
{
public:... |
google | chromium | pr37143 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/vect/pr37143.C | 498 | utf_8 | bb02984184613c4e23cd3b598fd11bf4 | /* { dg-do compile } */
void
f(int NumberOfSideSets, int *ssNumDFperSide, float *ssDF)
{
int i;
float *newssDF = __null;
int *newssNumDF = new int [NumberOfSideSets];
int ndf, nextDF, numNewDF = 0;
int ii=0;
for (i=0; i<NumberOfSideSets; i++)
numNewDF += newssNumDF[i];
if (numNewDF > 0)
newss... |
google | chromium | bound-mem-fun | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bound-mem-fun.C | 263 | utf_8 | 959fb0cad7f85400707a33296f113cce | // Origin PR c++/38228
// { dg-do "compile" }
struct A
{
A ();
template<typename T> A(T);
};
struct B
{
int foo();
};
A a = B().*(&B::foo); // { dg-error "invalid use of non-static member function" } |
google | chromium | cond6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond6.C | 235 | utf_8 | ed6decf76edd58d64d114a4410682b2e | // { dg-do "run" }
extern "C" void abort ();
struct B {
B() {}
B(const B& b) { abort (); }
};
struct D : public B {
D() {}
D(const D& d) : B() {}
};
D d;
B b;
D f() {
return d;
}
int main () {
b = (true ? f() : b);
}
|
google | chromium | anew2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/anew2.C | 518 | utf_8 | c272c27e69863d4ba063be24a228ce5f | // { dg-do run }
// PR 11228: array operator new, with zero-initialization and a variable sized array.
// Regression test for PR
#include <new>
#include <stdlib.h>
#include <string.h>
double* allocate(int n)
{
void *p;
p = malloc(n * sizeof (double));
memset (p, 0xff, n * sizeof(double));
return new (p) double... |
google | chromium | cast4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast4.C | 314 | utf_8 | ed8e65f6a9fb8340f4d8881b00bc8a62 | // { dg-do run }
// PR c++/22132
extern "C" void abort ();
struct foo {
int a;
int b;
};
class Foobar : public foo {
public:
Foobar() { a = 1; b = 2; }
virtual ~Foobar() {}
};
Foobar obj;
const Foobar* objPtr = &obj;
foo* f = (foo*)objPtr;
int main () {
if (f->a != 1 || f->b != 2)
abort ();
}
|
google | chromium | call5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/call5.C | 374 | utf_8 | 47ee2e9f4d1f4caaa66273c534a05700 | // { dg-do compile }
// PR 32839. Default arguments propagated through the type system to
// an indirect call.
void Quux (int i = 0);
void Baz (int i);
void Foo ()
{
__typeof (Quux) *q = Baz;
q (); // { dg-error "too few arguments" }
}
|
google | chromium | crash2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/crash2.C | 160 | utf_8 | 4ddfe508094ae855749b3a8b63fd8063 | // PR c++/14267
class foo {
public: static int& x;
};
int temp;
int& foo::x=temp;
int main() {
int x = 3;
&foo::x = x; // { dg-error "" }
return 0;
}
|
google | chromium | cast6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast6.C | 86 | utf_8 | 0c73fdd0b381eed7e392d54723abee36 | void f(int &);
void f(const int &);
int main() {
volatile int x = 2;
f((int)x);
}
|
google | chromium | stmt-expr-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/stmt-expr-1.C | 707 | utf_8 | b24655387631cb6c6f9225b705349fa4 | // Origin PR c++/40866
// { dg-options "-std=gnu++98" }
// { dg-do "compile" }
template <typename T> class QForeachContainer {
public:
QForeachContainer();
int brk;
typename T::const_iterator i;
};
template <typename T> class QList {
public:
class const_iterator {
public:
const_iterator(cons... |
google | chromium | bitfield10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield10.C | 167 | utf_8 | bb9514ef20edb3b33f02c8b92b8a3e1a | // PR c++/37146
// { dg-do compile }
enum E { E0 = 0, E1 = 'E' };
struct S
{
E s0 : 8;
enum E foo (bool, E);
};
E
S::foo (bool a, E b)
{
return a ? s0 : b;
}
|
google | chromium | bool2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bool2.C | 212 | utf_8 | 863ab5de11960b6302468e16665e31ec | // { dg-do compile }
// make sure that a typedef for a bool will have the
// the same results as a bool itself.
typedef bool my_bool;
int main()
{
my_bool b = false;
b--; // { dg-error "" }
return 0;
}
|
google | chromium | bool1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bool1.C | 285 | utf_8 | 6b31d632588060d56a7701a0a12216c8 | // { dg-do run }
// PR C++/29295
// make sure that a typedef for a bool will have the
// the same results as a bool itself.
extern "C" void abort();
typedef bool my_bool;
int main()
{
my_bool b = false;
int i;
b++;
b++;
i = b;
if (i != 1)
abort ();
return 0;
}
|
google | chromium | cond7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond7.C | 206 | utf_8 | f30409fd40ff04e848318e2beb14a1c7 | // PR c++/19148
struct QChar {
QChar (char c);
QChar (const QChar &);
unsigned short ucs;
};
void f(QChar *uc, unsigned short ch, QChar replacement)
{
*uc++ = ((ch) ? QChar((1)) : replacement);
}
|
google | chromium | sizeof3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/sizeof3.C | 93 | utf_8 | b39edf0129c7b02d40dd1f8360666a7c | // PR c++/15337
class CCC;
int main() { sizeof(CCC); return 0; } // { dg-error ".*CCC.*" }
|
google | chromium | sizeof1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/sizeof1.C | 99 | utf_8 | 0aff78a2cc7b554bd2a283f999880d26 | // PR c++/12989
struct A
{
int foo() { return sizeof(bar); } // { dg-error "" }
int bar();
};
|
google | chromium | lval2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/lval2.C | 477 | utf_8 | 512351301e4c678c8c359d27dd7ef411 | // PR c++/19199
// { dg-do run }
// We used to turn the COND_EXPR lvalue into a MIN_EXPR rvalue, and
// then return a reference to a temporary in qMin.
#include <assert.h>
enum Foo { A, B };
template<typename T> T &qMin(T &a, T &b)
{
return a < b ? a : b;
}
int main (int, char **)
{
Foo f = A;
Foo g = B;
... |
google | chromium | bitfield9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield9.C | 298 | utf_8 | f7feef6eca2fd890a8914fedc2a62ddf | // PR c++/32346
// { dg-do run }
// { dg-options "-Wno-overflow" }
extern "C" void abort();
struct S {
long long i : 32;
};
void f(int i, int j) {
if (i != 0xabcdef01)
abort();
if (j != 0)
abort();
}
void g(S s) {
f(s.i, 0);
}
int main() {
S s;
s.i = 0xabcdef01;
g(s);
}
|
google | chromium | call4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/call4.C | 537 | utf_8 | 262e2a044016a13ee93fb310eff38bd2 | // { dg-do compile }
// PR 32839. Default arguments propagated through the type system to
// an indirect call.
template<typename T>
struct TPL
{
enum Whatever {e1, e2};
static void Quux (int i = e1 | e2);
};
template <typename F>
void DoIt (F fun)
{
fun (); // { dg-error "too few arguments" }
}
void Foo ()
{
... |
google | chromium | cast7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast7.C | 163 | utf_8 | 974ec6f67bf608fffa5507b54b2ef72b | // PR c++/27177
struct X {};
struct Y : virtual X {};
struct Z : virtual X {};
struct A : Y, Z {};
struct B : A
{
static const int i = sizeof((Z*)(B*)0);
};
|
google | chromium | stdarg1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/stdarg1.C | 147 | utf_8 | d48c1940b3fda25f577c09c3d5b15f9c | // PR c++/23840
#include <stdarg.h>
struct S
{
int f(int);
};
void f(int i, ...)
{
va_list ap;
va_start (ap, i);
va_arg (ap, S).f(0);
}
|
google | chromium | bitfield11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield11.C | 127 | utf_8 | 9b500f05b28e7530fa125946e8e1b76a | // PR c++/37819
// { dg-do compile }
struct A
{
unsigned int a : 1;
};
bool
foo (A *x, A *y)
{
x->a = y ? y->a : true;
}
|
google | chromium | ptrmem5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem5.C | 108 | utf_8 | 874b09468973f06e0b8fc01585a95d04 | // PR c++/15696
struct A {};
typedef void (A::*ftype)();
void foo() { A().*ftype(); } // { dg-error "" }
|
google | chromium | cast8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast8.C | 95 | utf_8 | c9eba403b9c8b560219498d333b0acb4 | // PR c++/29886
struct A {
static int x[1];
};
void foo(int i)
{
if (int(A::x[i])) {}
}
|
google | chromium | ptrmem7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem7.C | 205 | utf_8 | 9b52a54a6bb9359f4cd984333c3b7ee6 | // PR c++/22545
struct A {
int member;
A() : member(13) {}
};
A a;
struct B {
operator A*() { return &a; }
};
B b;
int A::* member_pntr = &A::member;
int main()
{
return b ->* member_pntr;
}
|
google | chromium | incomplete1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/incomplete1.C | 259 | utf_8 | a7b2ff0b7e3eb33ae39f51b9c2436899 | // PR 10202
// { dg-do compile }
// { dg-options -O0 }
extern struct _smtp_account smtp_accounts[];
typedef struct _smtp_account {
int flags;
} Smtp_Account;
void get_smtp_host_info ()
{
if (smtp_accounts[0].flags & 0x01)
get_smtp_host_info();
}
|
google | chromium | crash-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/crash-1.C | 173 | utf_8 | 5943e958df776a88c39dc200ec5d291c | // C++ PR/10476
struct X {
X();
X(const X& __str);
};
X const bar();
void foo()
{
X y;
(true ? y : bar());
} |
google | chromium | pmf-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/pmf-1.C | 472 | utf_8 | 756b2a1ee32768929b1cc01f8c15c35d | // C++ PR/2521
// { dg-do compile }
struct A
{
void f();
void foo(void (A::*)(int)); // { dg-message "candidate" "" }
template<typename T>
void g(T);
void h()
{
void (A::*p)() = &A::f;
void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" }
foo(&g<int>); // ... |
google | chromium | cond4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond4.C | 250 | utf_8 | d30ef5af28e6363dab6713f12d513bc9 | // PR c++/13971
struct QChar {
static const QChar null;
};
struct QCharRef {
operator QChar() const;
};
struct QString {
QCharRef operator[](int i);
};
QChar fillParagraph(QString s, int psi) {
return psi ? QChar::null : s[psi];
}
|
google | chromium | dtor3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/dtor3.C | 85 | utf_8 | bf7f67a5fc1bd44b05d5e417998e5219 | struct B {
~B();
};
struct D : public B {
~D();
};
void f(D d) {
d.B::~B();
}
|
google | chromium | cast9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast9.C | 140 | utf_8 | 8b3e4787ac841e3157f9c47278119629 | // PR c++/27177
struct Z {};
struct A : Z {};
Z* implicitToZ (Z*);
struct B : A
{
static const int i = sizeof(implicitToZ((B*)0));
};
|
google | chromium | cond8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond8.C | 166 | utf_8 | ae7d0a090a6de3dba8a8ae59e51cacc8 | // PR c++/22434
// { dg-options "" }
struct A
{
A(void*);
~A();
};
void foo(const int i, bool b)
{
b ? A(0) : i; // { dg-error "conversion|initializing" }
}
|
google | chromium | string-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/string-1.C | 236 | utf_8 | dba668e593b9fefcc4e6330e8ca89c43 | // { dg-do compile }
// This testcase used to seg fault (PR c++/38648)
char a[1];
int foo( // { dg-error "extended initializer lists only available" }
{
a = ""; // { dg-error "" }
return 0; // { dg-error "" }
} // { dg-error "" }
|
google | chromium | bitfield5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield5.C | 162 | utf_8 | 68c100f8b0f867ba9c41cf4b1287daeb | // PR c++/30274
// { dg-do run }
struct S {
bool x : 4;
};
S s;
int main() {
s.x++;
if (s.x != 1)
return 1;
++s.x;
if (s.x != 1)
return 2;
}
|
google | chromium | copy1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/copy1.C | 365 | utf_8 | 40c29dc173bf365777a7de4d0970b286 | // PR c++/14035
// { dg-do run }
extern "C" void abort();
struct Blob {
int x, y;
Blob() { }
Blob(const Blob &b) { abort (); }
};
struct Blobby : public Blob { };
struct Wooly {
operator const Blobby & ()
{
return myBlobby;
}
Blobby myBlobby;
};
void catcher(const Blob &blo)
{ }
int main()
{
Wo... |
google | chromium | stdarg2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/stdarg2.C | 282 | utf_8 | e24b5173fba586d4b40f5feb0d41bcf8 | // PR target/26141
#include <stdarg.h>
struct S
{
double a;
};
void
foo (int z, ...)
{
struct S arg;
va_list ap;
arg = va_arg (ap, struct S);
}
struct T
{
__complex__ float a;
};
void
bar (int z, ...)
{
struct T arg;
va_list ap;
arg = va_arg (ap, struct T);
}
|
google | chromium | call1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/call1.C | 216 | utf_8 | ce7b6234ca0490c5f395644574322ca2 | namespace NS_1 {
struct A {};
struct foo {};
}
namespace NS_2 {
template <typename T> void foo(T);
template <typename T>
void bar() {
NS_1::A a;
NS_2::foo(a);
}
template void bar<int>();
}
|
google | chromium | member-of-incomplete-type-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/member-of-incomplete-type-1.C | 228 | utf_8 | 0b5e348c921017780a4e80249591b84c | struct A;
int main()
{
A::g(); // { dg-error "incomplete" "" }
} |
google | chromium | for2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/for2.C | 235 | utf_8 | cd7f4946b61f298e733a92601139e8ef | // { dg-do compile }
// PR c++/17661
// We used to try to create a temprary for the condition
// expression in the for which was wrong.
struct C
{
C (const C &x);
};
C &f();
void breakme (C j, bool k)
{
for (;; k ? j : f()) ;
}
|
google | chromium | bitfield8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield8.C | 288 | utf_8 | 781063f5a0d1ba5f19965b3dec7d3ee0 | // PR c++/31513
// { dg-do run }
extern "C" void abort();
struct tree_type {
unsigned int precision : 9;
};
void bork(unsigned int i) {
if (i != 7)
abort();
}
void foo(struct tree_type *t)
{
bork(t->precision);
}
int main() {
tree_type t;
t.precision = 7;
foo(&t);
}
|
google | chromium | ptrmem4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/ptrmem4.C | 229 | utf_8 | 00a3281a5c60b23cc64b650f1e1bc13e | // PR c++/15471
// { dg-do run }
struct myclass {
unsigned a;
union {
unsigned x;
};
};
int main () {
myclass foo;
unsigned myclass::* member = &myclass::x;
if (&(foo.*member) != &foo.x)
return 1;
}
|
google | chromium | anew1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/anew1.C | 501 | utf_8 | 4cf16a5e56e9a805e8cab8129d3ec12c | // { dg-do run }
// PR 11228: array operator new, with zero-initialization and a variable sized array.
// Regression test for PR
#include <new>
#include <stdlib.h>
#include <string.h>
int* allocate(int n)
{
void *p;
p = malloc(n * sizeof (int));
memset (p, 0xff, n * sizeof(int));
return new (p) int[n]();
}
int... |
google | chromium | static_cast2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/static_cast2.C | 95 | utf_8 | 0a2ed6ddead49d170ca2bdfd5b262d1e | struct B {};
int main () {
B a;
(1 ? static_cast<B&>(a) :
*static_cast<B*>(&a));
}
|
google | chromium | unary2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/unary2.C | 430 | utf_8 | 61339fcff4901b417b1fa8ede6e4a521 | // { dg-do compile }
// Unary plus/minus are not lvalues.
// In templates we require an instantiation to emit the diagnostic. This
// is wrong and it is PR 18474.
int n;
void f(void)
{
-n = 0; // { dg-error "lvalue" }
+n = 0; // { dg-error "lvalue" }
}
template <int>
void g(void)
{
-n = 0; ... |
google | chromium | call3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/call3.C | 198 | utf_8 | c152b77836f794103fb606dea43e77d1 | // PR c++/26036
// { dg-do compile }
struct A
{
int i;
};
A foo(int); // { dg-error "too few arguments" }
int j = foo().i; // { dg-error "at this point" } |
google | chromium | string-2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/string-2.C | 179 | utf_8 | 8a5e6a6573abaebf92bb5a34a119810e | // { dg-do compile }
// This testcase used to seg fault (PR c++/38648)
char a[1];
int foo(a = "") // { dg-error "invalid array assignment" }
{ // { dg-error "" }
return 0;
}
|
google | chromium | bitfield3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield3.C | 157 | utf_8 | bef76a1954ee61f5cdbd6de353efe0a2 | // PR c++/30274
struct S {
bool x : 4;
};
S s;
void f() {
s.x--; // { dg-error "Boolean expression" }
--s.x; // { dg-error "Boolean expression" }
}
|
google | chromium | pr19355-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/pr19355-1.C | 165 | utf_8 | e0ba8ce6144da0b9ed7164d2baac70c5 | // PR c++/19355
// { dg-do compile }
typedef bool Boolean;
extern Boolean is_nil ();
void f(void)
{
unsigned int ilen;
if(!((ilen > 0 ? !is_nil () : 1))) {}
}
|
google | chromium | cast2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast2.C | 73 | utf_8 | 0e456a0f4355cca0f4c5d2b05dc17f38 | void (*p)();
void f() {
(void *)p; // { dg-warning "forbids cast" }
}
|
google | chromium | unary3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/unary3.C | 148 | utf_8 | 50101473c07e54911f512727ba7f6cd4 | // PR c++/41131
// { dg-do compile }
struct X { enum E { a = 100 }; };
int
main ()
{
X x;
(void) &x.a; // { dg-error "lvalue required" }
}
|
google | chromium | cond9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond9.C | 209 | utf_8 | 071fbc82fbea942ec8387d2e90992567 | // PR c++/27666
struct A { // { dg-message "A" }
A(int); // { dg-message "A" }
};
void foo(volatile A a) {
1 ? a : 0; // { dg-error "match|temporary" }
1 ? 0 : a; // { dg-error "match|temporary" }
}
|
google | chromium | static_cast4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/static_cast4.C | 122 | utf_8 | 3768ee52241cd5c440a86d1ecde9f029 | class C {
public:
explicit C(int) {}
};
int main()
{
int i = 0;
static_cast<C>(i);
return 0;
}
|
google | chromium | volatile1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/volatile1.C | 111 | utf_8 | e639e926667ce8f9dee4e94ea0269323 | // PR c++/23167
struct dom
{
static int tostr();
void eval_old() volatile{tostr();}
~dom() throw();
};
|
google | chromium | minmax | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/minmax.C | 148 | utf_8 | d8f214b2a524317298593b987cbb3087 | // { dg-do compile }
void f(void)
{
int a, b;
(a >? b) = 1; // { dg-error "" }
}
void g(void)
{
int a, b;
(a <? b) = 1; // { dg-error "" }
}
|
google | chromium | anew4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/anew4.C | 603 | utf_8 | bfeb38eba4e729358fcc5f4cb5c9dd13 | // { dg-do run }
// PR 11228: array operator new, with zero-initialization and a variable sized array.
// Regression test for PR
#include <new>
#include <stdlib.h>
#include <string.h>
struct B
{
B();
int n;
};
B::B()
{
n = 137;
}
struct D : public B
{
double x;
};
D* allocate(int n)
{
void *p;
p = malloc(n... |
google | chromium | bitfield4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield4.C | 173 | utf_8 | acdc35a060321042e2d5d8bd77774fac | // PR c++/30274
// { dg-do link }
struct S {
bool x : 4;
};
S s;
template <typename T>
void f(T);
template <>
void f(bool) {}
int main() {
f(s.x++);
f(++s.x);
}
|
google | chromium | static_cast3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/static_cast3.C | 355 | utf_8 | 3b36b8a6d9fd7f85f03904e5ac4eedd9 | template <class T> struct static_abort {};
template <class E>
struct any
{
const E& self() const { return static_cast<const E&>(*this); }
};
struct range : public any<range>
{
range() {}
template <class U>
range(const U&)
{
typedef typename static_abort<U>::ret t;
}
};
int main()
{
const any<range... |
google | chromium | cond1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond1.C | 559 | utf_8 | 3c180246d5162c05266af924ad6ac090 | // { dg-do run }
// PR 7209. We didn't SAVE_EXPR in the right place
char a[2][1][16]={
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}};
int f() {return 0;}
char * Foo (int d)
{
char *c1;
c1=... |
google | chromium | cond2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond2.C | 199 | utf_8 | 28f617222c58f6ad34e32a6d85cc0f03 | struct Term { };
struct Boolean : Term {
explicit Boolean(bool);
};
struct IsZero : Term {
Term *eval();
};
Term*
IsZero::eval()
{
return true ? new Boolean(false) : this; // { dg-error "" }
}
|
google | chromium | unary1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/unary1.C | 264 | utf_8 | 8f5d773ab2c0fb76d721a88e7936dd2a | // { dg-do compile }
// Unary plus (but not unary minus) can be applied to pointer types
void *p;
void f(void)
{
-p; // { dg-error "wrong type argument" }
+p;
}
template <int>
void g(void)
{
-p; // { dg-error "wrong type argument" }
+p;
}
|
google | chromium | bitfield1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/bitfield1.C | 98 | utf_8 | 4e0c5b60b2779b95727ec7ec01b7d7c7 | // PR c++/27505
struct s {
bool field:8;
};
void
foo (struct s *p)
{
if (!p->field)
;
}
|
google | chromium | dtor1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/dtor1.C | 104 | utf_8 | 9a872a2bf8f1aed0022e0882d65f599b | class Foo; // { dg-error "" }
void
bar(void* p)
{
static_cast<Foo*>(p)->~Foo(); // { dg-error "" }
}
|
google | chromium | for1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/for1.C | 161 | utf_8 | 4d4bd4c17e114aaf9f89d2929fc74cfe | // PR c++/13663
struct S {
void f();
};
void g(int);
void g(double);
void h () {
S s;
for (;;s.f); // { dg-error "" }
for (;;g); // { dg-error "" }
}
|
google | chromium | cast1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cast1.C | 86 | utf_8 | 2ef606c671097dddd5d5000c30530ba5 | struct S; // { dg-error "forward" }
void f(S* p) { ((S) (*p)); } // { dg-error "" }
|
google | chromium | return1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/return1.C | 98 | utf_8 | cfe9ff3c65c17e6ab2653583e3fd9e3c | // PR c++/18545
struct A;
A foo() // { dg-error "" }
{
A a; // { dg-error "" }
return a;
}
|
google | chromium | cond3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/cond3.C | 70 | utf_8 | 0ee447faae923ac2c95505c9d02aa9f9 | const int i = 7;
const int j = 3;
void f(bool b) {
&(b ? i : j);
}
|
google | chromium | static_cast5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/static_cast5.C | 326 | utf_8 | 10a6604802b4ce916144cdc9ac8a3fc0 | void ambig()
{
struct A {};
struct B : A {};
struct C : A {};
struct D : B, C {};
D d;
A* ap = static_cast<B*> (&d);
D* db = static_cast<D*> (ap); // { dg-error "" }
D& dr1 = static_cast<D&> (*ap); // { dg-error "" }
A& ar = static_cast<C&> (d);
D& dr = static_cast<D&> (ar); // { dg-error ""... |
google | chromium | dtor2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/expr/dtor2.C | 55 | utf_8 | 111307fdacdc039c0f0f30a644b1949d | typedef const int I;
int i;
void f() {
i.I::~I();
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.