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 | mangle2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/mangle2.C | 227 | utf_8 | a107ecddc0aee51804b7689ef643b5e6 | // { dg-do assemble }
// I guess this was broken once.
template <class C, int D> class X { };
typedef X<int, 0> T;
class Y
{
public:
~Y();
};
class Z
{
public:
void f(T**);
};
void Z::f(T** t)
{ }
Y::~Y()
{ }
|
google | chromium | parse14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse14.C | 185 | utf_8 | 84c726a5b52085aa8fe801fc478ce206 | // { dg-do assemble }
// Bug: g++ decides that A::foo is introducing a constructor declarator.
struct A {
typedef bool foo;
};
A::foo (*bar) ();
struct B {
A::foo (*bar) ();
};
|
google | chromium | conversion6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/conversion6.C | 644 | utf_8 | 37d635f5f0bc8e8beb2e245a0b70c261 | // { dg-do run }
// PRMS Id: g++/6034
extern "C" int printf (const char *, ...);
class Base
{
char x;
};
template <class T>
// remove the public Base inheritance and the problem goes away...
class Container : public Base
{
public:
Container(const T& aValue): myValue(aValue) { }
operator const T&(void... |
google | chromium | pmf5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/pmf5.C | 471 | utf_8 | d6f9788c7e6efa8f8679e2379d495293 | // { dg-do assemble }
// { dg-options "" }
// PRMS Id: 4985
struct Thing {
int OverloadFn() const;
void FunctionA(char* restOfLine);
void OverloadFn(char* restOfLine);
};
struct ThingEntry {
void (Thing::*_handler)(char* restOfLine);
};
static ThingEntry KeyWordTable[] = {
&T... |
google | chromium | parse13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse13.C | 137 | utf_8 | 91df7257f1a1bda745fa52ba4d8a400d | // { dg-do assemble }
struct A {
struct B {};
struct C;
};
struct A :: C : A :: B {}; // { dg-bogus "" } parse error before `:'
|
google | chromium | warning2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/warning2.C | 242 | utf_8 | b9ca30d37fac6acf66c637735809e3f4 | // { dg-do assemble }
// g++ ought to warn about casting a base pointer to a derived reference.
struct A {
virtual void f () = 0;
};
struct B: public A { void f () { } };
int main()
{
B* bp;
A& ar = (A&)bp; // { dg-warning "" }
}
|
google | chromium | union | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/union.C | 191 | utf_8 | 2c801d3a7bbe264195737c67cdcac8fd | // { dg-do assemble }
// Bug: g++ doesn't insert anon union members into class scope.
// Breaks groff.
struct A {
union {
int i;
};
void foo () { i = 1; } // { dg-bogus "" }
};
|
google | chromium | bool3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/bool3.C | 369 | utf_8 | 0281d501181e7c62410bcd2b6de8ccdc | // { dg-do assemble }
// Subject: Problem with constant expressions for bitfields
// Date: Mon, 6 Jun 94 14:00:01 EDT
// Bug: g++ doesn't treat boolean true and false as constant values.
enum E { e1,e2,e3,e4,e5 };
struct X
{
unsigned int bits : ((e5 > 4) ? 8 : 4); // { dg-bogus "" } constant expression
}; |
google | chromium | ref8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref8.C | 277 | utf_8 | 19588b0bee244a661417723272509e39 | // { dg-do run }
// PRMS Id: 5184
// Bug: cast to C& below does not adjust address
struct A {};
struct B {
virtual void foo () {}
};
struct C : public B, public A {};
int main() {
C c;
A& ar = c;
C& cr = (C&)ar;
cr.foo(); // this line causes core dump
}
|
google | chromium | template20 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template20.C | 225 | utf_8 | c3f50a3355c9c6700f6263d388a0d1b5 | // { dg-do run }
// Make sure type deduction works for both types of array parameters.
template <class T> void f (T (&a)[2]) { }
template <class T> void g (T a[2]) { }
int main()
{
int a[2] = { 0, 0 };
f (a);
g (a);
}
|
google | chromium | warning4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/warning4.C | 300 | utf_8 | 75b0ada46a8aed6045f5f3ca90df1184 | // { dg-do assemble }
// { dg-options "-Woverloaded-virtual" }
// Bug: a virtual function with the same name in an unrelated class will
// cause a bogus overloading warning.
struct A {
virtual void foo ();
};
struct B {
virtual void bar ();
};
struct C: public A {
virtual void bar ();
};
|
google | chromium | enum8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/enum8.C | 280 | utf_8 | 367d613bc250e9dcc871a0dac0cd3de8 | // { dg-do run }
// Bug: the switch fails on the Alpha because folding ef - 1 fails.
enum foo { one=1, thirty=30 };
int f (enum foo ef)
{
switch (ef)
{
case one:
case thirty:
return 0;
default:
return 1;
}
}
int main ()
{
return f (one);
}
|
google | chromium | opover | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/opover.C | 248 | utf_8 | fa239349b87333357926a294a44fee03 | // { dg-do assemble }
// Bug: g++ prefers a non-matching operator== over user-defined conversions
// and a default operator==.
struct A {
operator int ();
};
struct B {
friend int operator== (B, int);
};
int foo (A& a) {
return a == 1;
}
|
google | chromium | opeq5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/opeq5.C | 616 | utf_8 | 5292a09a4c6bef333b385323117453e7 | // { dg-do run }
// Testcase for tricky synthesized op= in complex inheritance situation.
// This used to test whether the virtual base was copy-assigned only once.
// That feature is not required by ISO C++, so the test now only checks
// whether the vbase is assigned at all.
int count = 0;
extern "C" int printf (co... |
google | chromium | parse8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse8.C | 71 | utf_8 | 9a5fbb33bb10f1f2cebf43769aac579a | // { dg-do assemble }
void foo(const int* const); // { dg-bogus "" }
|
google | chromium | rfg5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg5.C | 231 | utf_8 | 001e6729da6c1ad6957a44ed2b044664 | // { dg-do assemble }
// { dg-options "-ansi -pedantic-errors -w" }
// Bug: func is treated as an overloaded function when it isn't.
int *func () { return 0; }
void
test ()
{
*func; // { dg-bogus "" } improper overloading
}
|
google | chromium | template43 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template43.C | 598 | utf_8 | 876bcb7f013c3c4f518818e6eb52f39c | // { dg-do run }
// Test matching of partial specializations.
template <int* x, int* y>
class EQUAL {
public:
enum { value = 0 };
};
template <int* x>
class EQUAL<x,x> {
public:
enum { value = 1 };
};
int x;
int y;
int equals_x_x = EQUAL<&x,&x>::value; // expected value: 1
int equals_x_y = EQUAL<&x,&y>::value; //... |
google | chromium | return2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/return2.C | 250 | utf_8 | 696dd8eda2f32a76af21bed332c74dde | // { dg-do run }
// PRMS Id: 5368
// Bug: the X temporary in foo() is not destroyed.
int c = 0;
struct X {
X (int) { c++; }
~X() { c--; }
};
struct Y {
Y(const X &) { }
};
Y foo() {
return X(3);
}
int main()
{
foo();
return c;
}
|
google | chromium | return | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/return.C | 319 | utf_8 | a291fe4b2802c42c5bf5ef02956040d9 | // { dg-do run }
// PRMS Id: 5331
// Bug: the return value of foo is constructed in a temporary and then
// copied into the return slot. This is not necessary.
int c = 0;
struct X {
X(int i) { }
X(X const &XX) { c = 1; }
~X() { }
};
const X foo() {
return X(3);
}
int main()
{
foo();
return c;
}
|
google | chromium | overload14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload14.C | 195 | utf_8 | 17d3d6caeb4ccd622ba916652b26a142 | // { dg-do assemble }
// Bug: g++ fails to recognize that the template matches the target type.
template <class T> void foo (T *, int);
struct A;
void bar ()
{
void (*p)(A *, int) = &foo;
}
|
google | chromium | temporary7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/temporary7.C | 338 | utf_8 | b6a4074e8ef245e11293a519205c99f3 | // { dg-do run }
// PRMS ID: 7304
struct V {
int n;
V() : n(0) { }
V(int x) : n(x) { }
};
V baz(const V &x)
{
return x;
}
int bar(V v1, V v2, V v3)
{
return v1.n;
}
struct A {
A(): n(7) { }
int foo();
V n;
};
int A::foo()
{
V v1, v2;
return bar(n, baz(v1), v2);
}
int main()
{
A a;
return ... |
google | chromium | nested6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/nested6.C | 82 | utf_8 | 4417f26d73cb317679a1a7cdc4c7ff5d | // { dg-do assemble }
union A {
struct B { };
A::B b; // { dg-bogus "" }
};
|
google | chromium | nested1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/nested1.C | 268 | utf_8 | 116970252d64d6b8b965ce03cebf15f7 | // { dg-do assemble }
// Bug: g++ can't deal with function-local classes that talk about themselves.
void foo() {
class Wrapper {
public:
void F (void * Wrapperptr)
{
Wrapper * wrapptr = ( Wrapper *) Wrapperptr; // { dg-bogus "" }
}
};
}
|
google | chromium | default2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/default2.C | 437 | utf_8 | 34c1a26078a116f37cbfb5185bf0aa67 | // { dg-do assemble }
// PRMS Id: 5921
// Bug: default arguments containing constructor calls persist incorrectly.
class foo
{
public:
foo();
foo(int x);
public:
int iamamember;
};
class bar
{
public:
bar();
int memberfunction(int i, const char *j, double k, foo foo1 = foo(0));
};
int
pain(bar *bar1)
{... |
google | chromium | conversion10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/conversion10.C | 326 | utf_8 | dfd087ab7ea4ac1c97296c141f23693b | // { dg-do assemble }
// PRMS Id: 9019
// Bug: g++ doesn't find conversion to const char *.
struct String {
String ();
explicit String (const char *);
operator const char * ();
};
int main(int argc, char **argv)
{
String deflt("no args");
String useme;
const char *p = (argv[1]) ? argv[1] : deflt;
return... |
google | chromium | overload31 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload31.C | 418 | utf_8 | a610aa2bc2e1d6775c911914159426ea | // { dg-do assemble }
// PRMS Id: 6568
// Bug: g++ complains about the ambiguous conversion to bool even though
// we wouldn't end up using it anyway.
class AString
{
public:
AString (unsigned len);
operator char *() const;
operator char const *() const;
};
void
foo(unsigned t, AString const & handle)
{
... |
google | chromium | typedef | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/typedef.C | 226 | utf_8 | ec9838215847693501802a19873c81e4 | // { dg-do assemble }
// PRMS Id: 4687
// Bug: g++ misinterprets typedefs of function type in class scope.
typedef int (*F1) ();
struct A {
typedef int F();
F *fp;
F1 g() { return fp; } // { dg-bogus "" } typing
};
|
google | chromium | template2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template2.C | 230 | utf_8 | 38ab28668b5cc9902ee6eb9a096d435f | // { dg-do assemble }
// Bug: instantiation of member templates breaks.
template <class T> struct A {
static void f ();
void g ();
};
template <class T> void A<T>::f () { }
template <class T> void A<T>::g () { }
A<int> a;
|
google | chromium | synth10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/synth10.C | 825 | utf_8 | 71fbfcb79210aeab20b4abc2d51787e2 | // { dg-do assemble }
// { dg-options "-O" }
// Bug: Synthesizing methods for the nested class screwed up current_class_decl
// for the outer class.
class A;
class AH
{
public:
AH ( A * p = 0 );
AH ( const AH & from )
: pointer( from.pointer ) { inc(); }
~ AH () { dec(); }
private:
A * p... |
google | chromium | template14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template14.C | 355 | utf_8 | 4e368747f0f17e48897b1f1e32c1ce30 | // { dg-do run }
// PRMS Id: 4745
// Bug: g++ gets the constructor and destructor confused because the default
// parm prevents the two constructor types from satisfying ==.
template <class T> struct A {
A(int = 1);
~A();
};
template <class T> A<T>::A(int) { } // causes compiler abort
template <class T> A<T>::~A... |
google | chromium | rvalue3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rvalue3.C | 128 | utf_8 | bd2c9ff6e75478ef5092aa30ce900eff | // { dg-do assemble }
int main ()
{
int i;
int &ir = (int&)(int)i; // { dg-error "" } casting rvalue to reference type
}
|
google | chromium | template22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template22.C | 463 | utf_8 | 2f3651d76c789297326057ff5b1d0bbf | // { dg-do assemble }
// Testcase for proper unification of code involving references.
template<class T>
struct A
{
void foo();
};
template<class T> void A<T>::foo() { }
template class A<int&>;
const int& f1 ();
int& f2 ();
int f3 ();
template <class T> void g1 (const T&);
template <class T> void g2 (T&);
tem... |
google | chromium | nested5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/nested5.C | 149 | utf_8 | 113f331fb4d3fad52e53327471782660 | // { dg-do assemble }
struct A {
struct B { };
};
struct C : public A {
struct D
: public B // { dg-bogus "" } can't find B
{ };
};
|
google | chromium | synth9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/synth9.C | 292 | utf_8 | 7f8222df60c5e8d0c1924c1474bd2e16 | // { dg-do assemble }
// PRMS Id: 6837
// Bug: anonymous union confuses g++.
struct my_key {
my_key(const my_key&);
my_key(const char* n);
};
struct my_node {
my_node(my_key&);
union {
long cnt;
my_node* next;
};
my_key a;
};
extern my_node n;
my_node a(n);
|
google | chromium | rfg10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg10.C | 205 | utf_8 | ef4717883aac926ce741042ce7edf73f | // { dg-do assemble }
// Bug: g++ doesn't notice the overflow in the enum values.
#include <limits.h>
enum COLOR
{
red,
green = ULONG_MAX,
blue // { dg-error "overflow in enumeration" }
};
|
google | chromium | rfg2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg2.C | 232 | utf_8 | b15a02066349d625ce9871be99587303 | // { dg-do assemble }
// Bug: g++ complains about a class definition containing a const member
// but no constructor; it shouldn't complain at that point, since this is
// valid use.
struct S { const int member; } object = { 0 };
|
google | chromium | cast2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/cast2.C | 259 | utf_8 | 829f550c8d2621712f469e117f58a2ec | // { dg-do assemble }
// The compiler tried to build up a double with a NOP_EXPR from
// integer_zero_node, which fails.
template <class T>
class vector {
public:
vector (int n, const T& value = T()) {}
};
void
foo (void)
{
vector<double> v (10);
}
|
google | chromium | overload9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload9.C | 703 | utf_8 | 70ede504775cb592907fb5ef243b1b78 | // { dg-do assemble }
// PRMS Id: 4257
// Bug: g++ ignores non-member possibilities (ideal_candidate_ansi bug)
class ostream
{
public:
#ifdef EITHER_ONE_A
ostream& operator<<(unsigned long n);
ostream& operator<<(long n);
#else
ostream& operator<<(short n);
ostream& operator<<(unsigned short n);
#end... |
google | chromium | dcast2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/dcast2.C | 320 | utf_8 | 45c186d279214c05bed1af3877bbe916 | // { dg-do run }
struct A { virtual void f() { } };
struct B { virtual void g() { } };
struct C : public A, public B { };
int main ()
{
C* cp = 0;
B* bp = 0;
if (dynamic_cast <B*> (cp) != 0)
return 1;
if (dynamic_cast <void *> (bp) != 0)
return 1;
if (dynamic_cast <C*> (bp) != 0)
return 1;
}
|
google | chromium | groff1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/groff1.C | 583 | utf_8 | 654a66427dcd006b10d7eb2e7d6189a1 | // { dg-do run }
// PRMS Id: 3744
// Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the
// result, so expand_expr ignores it.
extern "C" {
int printf(const char *,...);
void exit(int);
}
struct A {
int x;
int y;
A() : x(0), y(0) { }
};
struct S {
S() : flags(0) { }
unsigned fla... |
google | chromium | ref4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref4.C | 53 | utf_8 | 43751a5e4f31248344cd47c1c8c4083e | // { dg-do assemble }
void f ();
void (&fr)() = f;
|
google | chromium | bool4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/bool4.C | 154 | utf_8 | fe1e369a541ff0ff613e35c5b065ddb4 | // { dg-do run }
// Test for allowing conversion to bool.
struct A { };
int main ()
{
bool b = (void*)0;
b = (int A::*)0;
b = (int (A::*)())0;
}
|
google | chromium | rfg14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg14.C | 492 | utf_8 | 6875f3adb94cd43f54c4abc1a4ad7a96 | // { dg-do assemble }
void *vp;
int (*ap)[];
struct S *sp;
union U *up;
int (*fp)();
void
test ()
{
vp++; /* { dg-error "" } incrementing void * */
ap++; /* { dg-error "" } incrementing ptr to incomplete type */
sp++; /* { dg-error "" } incrementing ptr to incomp... |
google | chromium | synth4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/synth4.C | 192 | utf_8 | ea8042d89263119cda4cd2cae5144404 | // { dg-do assemble }
struct X {
X();
};
typedef void (X::*mfp)();
struct Y {
Y();
mfp memfp;
};
void f()
{
Y *y1, *y2 ;
*y1 = *y2; // { dg-bogus "" } failed to synthesize op=
}
|
google | chromium | pmf8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/pmf8.C | 480 | utf_8 | 17b06c23ea1952b3e572cbc70a4c911f | // { dg-do run }
// PRMS Id: 6905
class Parent {
public:
void DoSomething() { return; }
int i;
};
class Child : public Parent {
public:
};
class User {
public:
void DoAnyThing(void (Parent::*)(void)) { return; }
void DoAThing(void (Child::*)(void)) { return; }
void DoAThing(int Child::*) { return; }
};
... |
google | chromium | rfg26 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg26.C | 175 | utf_8 | a6945d529cadafc1ffa77e88d84f2880 | // { dg-do assemble }
typedef void (FTYPE) ();
FTYPE f; /* ok */
void
test_0 ()
{
(FTYPE) f; /* { dg-error "" } casting to function type */
}
|
google | chromium | nested2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/nested2.C | 633 | utf_8 | fe6c52c886b91594995d2cb6c7a51f3c | // { dg-do assemble }
// PRMS Id: 3764 (c/h)
// Bug: g++ gets into an infinite loop trying to find the top-level context
class Menu;
class MenuItem;
class MenuAction {
public:
virtual void execute (Menu& menu, MenuItem& menuItem) = 0;
protected:
MenuAction () {}
};
class Test {
class MenuCBA : public MenuAct... |
google | chromium | ref2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref2.C | 139 | utf_8 | 360dbe681c226bb57a1ab606fe70b877 | // { dg-do assemble }
// Bug: g++ can't deal with references to arrays.
typedef float Matrix[4][4];
Matrix m;
Matrix& f () { return m; }
|
google | chromium | template32 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template32.C | 200 | utf_8 | ad2c663d36d9a0f17dc938a311946155 | // { dg-do assemble }
// Bug: Instantiating A<int> screws with class bindings for B
template <class T> struct A { };
struct B {
typedef int foo;
void f ();
};
void B::f () { A<int> a; foo i; }
|
google | chromium | bool7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/bool7.C | 310 | utf_8 | 41e60403315b77f3e7cbd274f7f8f2e5 | // { dg-do assemble }
struct A
{
operator bool () const;
operator const void * () const;
};
struct B
{
A a;
int foo1 ();
int foo2 ();
};
int
B::foo1 ()
{
return a ? 0 : 1; // ambiguous default type conversion for `operator !='
}
int
B::foo2 ()
{
if (a)
return 0;
else
return 1;
}
|
google | chromium | parse10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse10.C | 328 | utf_8 | 2dcf8b430dbd487615992d2db56b79ca | // { dg-do run }
// Testcase for precedence of ?: wrt =
extern "C" int printf (const char *, ...);
int main()
{
int j = 0, k = 0;
1 ? j : k = 5; // should be parsed 1 ? j : (k = 5)
(void) (1 ? k = 5 : 0);
k = 5 ? 1 : 0; // should be parsed k = (5 ? 1 : 0)
printf ("%d %d\n", j, k);
return j == 5 || k ... |
google | chromium | ref11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref11.C | 528 | utf_8 | 3468fe167ed24e45eddacb2d52bf2515 | // { dg-do run }
int main(int argc, char ** argv) {
int (&var_field_ref)[] = * (int (*)[]) new int [42];
int (&fix_field_ref)[1] = * (int (*)[1]) new int [42];
int static_field[42];
int *const &var_field_ptr_ref = var_field_ref; // { dg-bogus "" }
int *const &fix_field_ptr_ref = fix_field_ref;
in... |
google | chromium | overload16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload16.C | 182 | utf_8 | 9b7ff5b464dff8d7e43d32d724b4aa9b | // { dg-do assemble }
void f (int); // { dg-message "candidates" }
void f (long); // { dg-message "note" }
int main()
{
f (1 & 0xffffff00UL); // { dg-error "ambiguous" }
}
|
google | chromium | scoping5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping5.C | 146 | utf_8 | 47d4fa61a5ee8a2b181303fe459e4f6c | // { dg-do assemble }
// Bug: g++ thinks that A defines operator delete, and tries to call it.
struct A {
~A () { ::operator delete (0); }
};
|
google | chromium | typedef3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/typedef3.C | 194 | utf_8 | 19a2f7b346b6515ddde5ce656b1b2981 | // { dg-do assemble }
// Test that inheriting from a type typedefed to itself works.
typedef struct class1 {
class1& operator=(const class1&);
} class1;
class class2 : public class1 { };
|
google | chromium | local | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/local.C | 544 | utf_8 | e33f65d4d7763a4d218c8761da7624c4 | // { dg-do assemble }
// General testcase for local classes.
int x;
void f ()
{
static int s;
int x; // { dg-error "" } referenced below
extern int q();
struct local {
int g() { return x; } // { dg-error "" } automatic variable
int h() { return s; } // { dg-bogus "" } local class
int k() { retu... |
google | chromium | template40 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template40.C | 411 | utf_8 | 3ef76a22c445af6d004e4af1d4e1ef5d | // { dg-do run }
// PRMS id: 11315
// Bug: g++ doesn't recognize the copy ctor for Array<long>.
template <class Type>
class Array {
public:
Array(int sz=12)
: ia (new Type[sz]), size(sz) {}
~Array() { delete[] ia;}
Array(const Array<long>& r) : size(0) {} // just for testing
private:
Type *ia;
int size;... |
google | chromium | crash5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/crash5.C | 136 | utf_8 | 5723e0186bec62dede196f7a356a847b | // { dg-do assemble }
// Bug: g++ doesn't deal well with abstract declarators used inappropriately.
void (*)(); // { dg-error "" }
|
google | chromium | ctor2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ctor2.C | 222 | utf_8 | 72eeeca091d298f9f36a3fac59791c23 | // { dg-do assemble }
// Bug: the reference to c in the initializer list doesn't get fixed up.
struct AP {
AP(unsigned char);
};
struct AI : AP {
AI(unsigned char);
};
AI::AI(unsigned char c)
{
&c;
} |
google | chromium | init | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/init.C | 190 | utf_8 | 09741e40b6244879acf5b8d3defe1df4 | // { dg-do assemble }
// Bug: g++ uses an empty initializer list for its own devious purpose
// internally, and gets confused if it shows up in the input.
struct A { int i; };
A a = { };
|
google | chromium | scoping16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping16.C | 101 | utf_8 | 87a29f5feb194d41ee17772b533a2e4c | // { dg-do assemble }
struct A {
int a(); // { dg-error "" }
int a; // { dg-error "" }
};
|
google | chromium | bool5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/bool5.C | 167 | utf_8 | 5c504593e80b75bca30bd5eb236db8c6 | // { dg-do run }
int main ()
{
bool b = false;
int i = b++;
if (i != false || b != true)
return 1;
i = b++;
if (i != true || b != true)
return 1;
}
|
google | chromium | method | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/method.C | 203 | utf_8 | 4fcfb4093f45e28038d3d015bc524bf8 | // { dg-do assemble }
// Bug: pointer to pointer is treated as plain pointer.
// PRMS Id: 1767
class Foo {
public:
void method();
};
void func(Foo ** ppFoo) {
ppFoo->method(); // { dg-error "" }
}
|
google | chromium | conversion | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/conversion.C | 224 | utf_8 | f1da5c6f4551b93349dffadb77337aba | // { dg-do assemble }
// Bug: g++ doesn't find the conversion path from DPtr& to B*.
class B {};
class D : public B {};
class DPtr
{
public:
operator D*() const;
};
void foo (B* bp);
void bar (DPtr& dp)
{
foo (dp);
}
|
google | chromium | tempargs | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/tempargs.C | 335 | utf_8 | 886defc4b8d1c91ce188acb16d63768c | // { dg-do assemble }
// GROUPS passed templates overloading
template<class T> class Vector { };
template<class T> struct Sort { static void sort (Vector<typename T::foo> &); };
template<class T> void Sort<T>::sort (Vector<typename T::foo> &) { }
struct whee { typedef int foo; };
void f (Vector<int> &vi) { Sort<whee>... |
google | chromium | binding3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/binding3.C | 337 | utf_8 | 7c9d834c7d8786f219380c03f191c202 | // { dg-do assemble }
// Bug: g++ fails to clear out the IDENTIFIER_CLASS_VALUEs of various names
// after a class definition.
struct A {
typedef double T;
virtual T f () = 0;
};
class B {
B (const B&);
void operator=(const B&);
public:
B ();
typedef void * T;
};
struct C : public A {
T f (); // { d... |
google | chromium | overload7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload7.C | 239 | utf_8 | 5cb2caad38424c3aefd0bd8ca6e40fd0 | // { dg-do assemble }
// Bug: g++ thinks there is a default conversion from A& to B*.
// There isn't.
struct A {
operator A* ();
};
struct B: public A { };
void foo (B* bp);
void bar (A& a) {
foo (a); // { dg-error "" }
}
|
google | chromium | anon3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/anon3.C | 432 | utf_8 | 3c9216120f190b77a1d7b69a45f4d65b | // { dg-do assemble }
// Bug: g++ dies.
class cl {
public:
cl();
void set(void *, char *, int);
private:
union {
float vf;
struct ff { // { dg-error "" } nested class in anonymous union
void *ptr;
char *name;
int sz;
} *vff;
};
};
void cl::set(void *p, char *n, int sz)
{
vff... |
google | chromium | access8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/access8.C | 533 | utf_8 | 179bfebe6c5e0c4b30b8730e2ad58238 | // { dg-do assemble }
// Date: 25 Jan 1994 23:41:33 -0500
// Bug: g++ forgets access decls after the definition.
class inh { // { dg-error "" } inaccessible
int a;
protected:
void myf(int);
};
class mel : private inh {
protected:
int t;
inh::myf;
};
class top_t : protected mel {
public:
... |
google | chromium | c-inline | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/c-inline.C | 287 | utf_8 | cf06a8bbf7aa350ee56e4d98d2401d80 | // { dg-do assemble }
// Bug: the compiler gets hopelessly confused.
#line 1 "c-inline.h"
#pragma interface
inline double abs (double) { return 0.0; }
inline short abs (short) { return 0; }
#line 2 "c-inline.C"
extern "C" {
inline int abs (int) { return 0; } // causes segfault -
}
|
google | chromium | pmf7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/pmf7.C | 362 | utf_8 | 841637bdd1bf4e8fb59bbe43bff3870a | // { dg-do run }
// PRMS Id: 6486
// Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes
// with the number of calls to foo.
int c;
struct A {
void f () {}
virtual void g () {}
};
A& foo ()
{
static A a;
++c;
return a;
}
int main ()
{
void (A::*p)() = &A::f;
(foo ().*p)();
p = &... |
google | chromium | anon2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/anon2.C | 105 | utf_8 | 6d6ae514cd2c77286bbf074fc8bb8d87 | // { dg-do assemble }
// g++ should not complain about anonymous bitfields.
struct A
{
int : 2;
};
|
google | chromium | warning10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/warning10.C | 297 | utf_8 | e75b78d24078dbf9a96ada8194eef893 | // { dg-do assemble }
// { dg-options "-W -Wall" }
// Don't warn about these comparisons.
struct A {
unsigned int b : 14;
};
int f (int i, unsigned char u, A a, unsigned long ul)
{
if ((u & 0x10) == 0)
return 1;
if (i == 0U)
return 1;
if (a.b > ul)
return 1;
return 0;
}
|
google | chromium | optimize2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/optimize2.C | 274 | utf_8 | 796c0d119fc65e4ae223644438d7907e | // { dg-do run }
// { dg-options "-w" }
// Used to crash on the alpha with optimization.
extern "C" void abort (void);
struct Fix {
unsigned short l;
};
static inline void f (int len)
{
if (len > 65535)
abort ();
}
struct Fix a = { 33 };
main()
{
f (a.l);
}
|
google | chromium | new3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/new3.C | 526 | utf_8 | eb117dc6d9c6a4627be2ca6a7a06236e | // { dg-do run }
// { dg-options "-fcheck-new -pedantic -Wno-long-long" }
// PRMS Id: 6037
extern "C" void * malloc (__SIZE_TYPE__);
int ena = 0;
struct A {
int i;
A () { i = 2; }
void * operator new (__SIZE_TYPE__ s)
{
if (ena)
return 0;
return malloc (s);
}
};
struct B {
int i;
B () {... |
google | chromium | template39 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template39.C | 294 | utf_8 | 1ef0ca563dd56e9475343428fa1d8a6b | // { dg-do assemble }
// PRMS Id: 10283
template <class T> struct B {
static void (*p)();
static void f ();
};
template <class T>
void (*B<T>::p)() = &B<T>::f;
B<int> b;
template <int i> struct A {
static const int j = i;
int k[j];
};
A<1> a;
template <int i>
const int A<i>::j;
|
google | chromium | scoping10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C | 348 | utf_8 | 589a3fb4035928b6ce72b50e7ea4caa0 | // { dg-do assemble }
// Test for scope-based hiding of functions.
void f (char *);
struct A {
void f (); // { dg-message "candidates" } referred to
};
struct B : public A {
void g (char *);
void h () {
extern void g (); // { dg-error "" }
f("foo"); // { dg-error "" } hidden
g("foo"); // { ... |
google | chromium | rfg27 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/rfg27.C | 437 | utf_8 | 17473da0acd5750f39db482e49ae925d | // { dg-do assemble }
// { dg-options "-pedantic-errors" }
// Don't compile this one with -Wno-long-long...
short volatile short var_0_2; /* { dg-error "" } duplicate short */
long volatile long var_0_3; /* { dg-error "" } duplicate long */
signed volatile signed var_0_7; /* { d... |
google | chromium | tredecl | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/tredecl.C | 404 | utf_8 | 776a6eba4666d06b4325a2d0850afe81 | // { dg-do assemble }
// Bug: Foo<Bar> *p semi-instantiates Foo<Bar> in local scope, so
// when Foo<Bar> f tries to instantiate it later, it only finds the partial
// instantiation from before.
//
// No PR; distilled from James Clark's SGML project.
//
class Bar { };
template<class T> class Foo;
Foo<Bar> *p;
temp... |
google | chromium | friend2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/friend2.C | 346 | utf_8 | 0c48f31e1970e425bf9b46f60cb18ba5 | // { dg-do assemble }
// PRMS Id: 5189
// Bug: g++ fails to collapse the several declarations of freefoo, so it isn't
// recognized as a friend.
extern "C"
void freefoo(void);
class foo {
friend void freefoo(void);
protected:
static void foomem();
public:
foo();
~foo();
};
void freefoo(vo... |
google | chromium | ref1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref1.C | 187 | utf_8 | af741a2ea7ec1635196be2334010d100 | // { dg-do assemble }
// Bug: g++ tries to call a constructor for a reference. Doh!
class B;
struct A {
B & b;
A (B & x) : b (x) { } // { dg-bogus "" }
}; // { dg-bogus "" }
|
google | chromium | bool6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/bool6.C | 127 | utf_8 | 81a65b9417af676af77db7a2cae52e06 | // { dg-do assemble }
// Bug: The conversion from bool to int gets stripped.
bool b;
int main ()
{
return ((!b) != 0);
}
|
google | chromium | access10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/access10.C | 253 | utf_8 | 19664a186dd5faf025cae18124258b74 | // { dg-do assemble }
// PRMS Id: 4839
// Bug: The initializer of a static member of a class has the same acess
// rights as a member function. g++ doesn't realize that.
class X
{
X (int);
static X foo;
public:
void dummy();
};
X X::foo = 9;
|
google | chromium | template26 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template26.C | 2,396 | utf_8 | b9e4c85b77c73c73d4a668ac75ec5db0 | // { dg-do run }
// PRMS Id: 6275
// Bug: unification fails for call to find_parameter_in_stack.
#include <stdio.h>
#include <stdlib.h>
const int max_stack_size = 20;
template <class T>
class Stack {
private:
T objects[max_stack_size];
int nobjects;
public:
Stack(): nobjects(0) {}
void push(cons... |
google | chromium | scoping | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/scoping.C | 199 | utf_8 | 647286463ce7ee3841394dc65c3053c9 | // { dg-do assemble }
// PRMS Id: 3977
// Bug: A member function is not hidden properly by a later use of its name.
struct A {
void index ();
};
struct B: A {
int index;
B(): index(4) {}
};
|
google | chromium | lvalue4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/lvalue4.C | 84 | utf_8 | 5806155b87c1a7e1fef0b91fb93f390d | // { dg-do run }
int main() {
int i = 2;
int *pi = &(++i);
return i != 3;
}
|
google | chromium | template34 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/template34.C | 481 | utf_8 | 50a283de5b9bae6b741e94ab5099764a | // { dg-do run }
template<class T>
class Set {
public:
typedef int (*Compare)(const T&, const T&);
static Compare cmp1;
static int (*cmp2)(const T&, const T&);
};
template<class T>
int gen_cmp(const T& a, const T& b) {
if (a<b) return -1;
else if (a==b) return 0;
else return 1;
}
template<c... |
google | chromium | temporary3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/temporary3.C | 386 | utf_8 | 852f61e7f2559e88807caba3b50ea8e2 | // { dg-do run }
// Bug: the temporary returned from f is elided, causing a to be constructed
// twice but only destroyed once.
extern "C" int printf (const char *, ...);
int c,d;
struct A {
A (int) { c++; }
~A () { d++; }
A (const A&) { c++; }
int i;
};
A f ()
{ return 1; }
int main ()
{
{
A a (1);... |
google | chromium | ref5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref5.C | 168 | utf_8 | 842e17b828806bc6f661a1a0019f3b6d | // { dg-do assemble }
int i;
int &const j = i; // { dg-error "" } invalid const
int &const f(); // { dg-error "" } invalid const
void g ()
{
j = 1;
f() = 1;
}
|
google | chromium | overload3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload3.C | 294 | utf_8 | e54b50f23269d12102e222619f2a54e1 | // { dg-do assemble }
// Bug: bar is considered to be overloaded (i.e. its
// IDENTIFIER_GLOBAL_VALUES are TREE_LISTs) even though it isn't,
// so default_conversion thinks it can't resolve the name.
void foo ();
void bar ();
void baz ()
{
void (*p)() = 1 ? (void (*)()) &foo : bar;
}
|
google | chromium | special | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/special.C | 225 | utf_8 | 6ae3f3bde787593240dc6100cd27cf10 | // { dg-do assemble }
// Make sure that forward declarations of specializations work...
template <class T> class A { };
template <> class A<int>;
A<int> a; // { dg-error "" } incomplete type
template <> class A<int> { };
|
google | chromium | overload15 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/overload15.C | 157 | utf_8 | b6d3a46381478f8b7d432201d4dc2c64 | // { dg-do assemble }
// Bug: g++ thinks that int->long is a promotion.
long f (long, long);
double f (double, double);
void g (double d)
{
f (d, 0);
}
|
google | chromium | dcast3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/dcast3.C | 625 | utf_8 | d869c2d816bc0cfa610b34ed7aa7f57e | // { dg-do run }
// Testcase for tricky dynamic cast situations.
struct A {
virtual void f () { }
};
struct B : public A { };
struct C : public B { };
struct D : public B { };
struct E : public C, public D { };
struct B2 : public virtual A { };
struct C2 : public B2 { };
struct D2 : public B2 { };
struct E2 : pub... |
google | chromium | parse9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse9.C | 302 | utf_8 | b042f1871337323f019cbab8f343e519 | // { dg-do run }
// PRMS Id: 5720
// Bug: the extra set of parens confuses the expr/declarator disambiguation.
class Fu
{
int val;
public:
Fu(int i) : val(i) { }
void print() { }
};
int main(int argc, char * argv[])
{
int * i = &argc;
Fu((*i)).print(); // { dg-bogus "" }
Fu((*j));
}
|
google | chromium | builtin | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/builtin.C | 186 | utf_8 | 53aef353e2e1a9a9eaac3faea32e02e5 | // { dg-do assemble }
// { dg-options "-w" }
// Bug: g++ overloads strlen instead of bashing the builtin version.
extern "C" void strlen (const char *);
void f ()
{
strlen("Hi");
}
|
google | chromium | conversion9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/conversion9.C | 169 | utf_8 | 75d3a37da568ed0385b73bc311845a19 | // { dg-do run }
// PRMS Id: 8475
class SomeClass {
public:
operator int & () {
static int x;
return x;
}
} a;
int main (int, char**) {
return a + 0;
}
|
google | chromium | ref7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/ref7.C | 328 | utf_8 | 256c9d6626ad42870e64aface1ccd6e2 | // { dg-do run }
// Testcase for the lifetime of a temporary object which is used to
// initialize a reference.
int destroyed = 0;
struct A {
A() { }
A(int) { }
~A() { destroyed++; }
};
A a;
A foo () { return a; }
int main()
{
const A& ar = foo();
const A& ar2 = A();
const A& ar3 = (A)1;
return destr... |
google | chromium | temporary4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/temporary4.C | 448 | utf_8 | 6101f026315976121bdd39bc042b0790 | // { dg-do run }
// Bug: g++ initializes both B::i and B::j before destroying any temps.
extern "C" int printf (const char *, ...);
int c = 0;
int d = 0;
int r = 0;
struct A {
A() { if (c != d) r = 1; ++c; }
A(const A&); // declare so g++ returns A on the stack
~A() { ++d; }
operator int () { return 0; }
}... |
google | chromium | default3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/default3.C | 148 | utf_8 | d0074ebb32b10bb09619461814aaee7e | // { dg-do assemble }
// Bug: type_list_equal aborts when it sees lang-specific tree nodes.
struct A { };
void f (A a = A());
void g (A a = A());
|
google | chromium | parse1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.jason/parse1.C | 157 | utf_8 | 8de8c00c90b1c1c9fc5ef99276b6c06f | // { dg-do assemble }
// Bug: g++ parses the declaration of r as a function declaration.
void foo (int i)
{
int &r (i);
r = 1; // { dg-bogus "" }
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.