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 | eb2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb2.C | 242 | utf_8 | 8767b204079f14a768b1e30e16817c5c | // { dg-do assemble }
typedef __SIZE_TYPE__ size_t;
inline void *operator new(size_t, void *place) throw() { return place; }
struct A
{
A();
~A();
};
void testfunc( void )
{
A* mybuf;
A v[1];
new (mybuf) A();
}
|
google | chromium | eb22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C | 734 | utf_8 | 8cf9dafa3143f6c3a605830e09aecfec | // { dg-do assemble }
// Ambiguous conversion, three candidates:
// builtin == (int, int), and the two user-defined operators
// Each one requires a user-defined ICS where another uses builtin conversions,
// so none is the best viable function.
class MyInt
{
public:
MyInt(int = 0) {}
operator int() c... |
google | chromium | eb105 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb105.C | 340 | utf_8 | 3659e47043ebbb544b5bad1e021405df | // { dg-do assemble }
template< class T >
void sort( T* t, int n )
{
struct
/*line5*/ {
int operator()(T i, T j)
{
return (i < j) ? -1 : ((j < i) ? 1 : 0) ;
}
} c ;
sort(t, n... |
google | chromium | eb52 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb52.C | 422 | utf_8 | ad16b6909db3b254930c04fed0ec8d0f | // { dg-do assemble }
class base {
protected:
virtual void f();
};
class d1 : public virtual base {
protected:
void f();
};
void d1::f()
{
base::f();
}
class dd1 : public virtual d1 {
protected:
void f();
};
void dd1::f()
{
d1::f();
base::f();
}
class d1_and_base : public virtual d1, publ... |
google | chromium | eb77 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C | 447 | utf_8 | 349f93b6aba01075501dbe0c1897a06a | // { dg-do run }
#include <iostream>
#include <sstream>
using namespace std;
int
main(int, char* [])
{
stringstream s;
s << "line 1\nline 2\n\nline 4";
s << std::ends;
int nLine = 0;
while( true ) {
char line[100];
s.get(line, 100);
if( ! line ) {
break;
}
++nLine;
std::c... |
google | chromium | ebnull | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/ebnull.C | 235 | utf_8 | 8cbd42dfdf5c3d1001c2ccf679b53f55 | // { dg-do run }
class null {
null (null const&);
void operator& ();
public:
null () {}
template <typename T>
operator T* () const { return 0; }
} const null;
int main ()
{
int *p = null;
return 0;
}
|
google | chromium | eb6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb6.C | 185 | utf_8 | 1a1f9e745e06ee3866366991f2da25eb | // { dg-do assemble }
class A {
public:
A() { t=0; }
double t;
};
template <class T>
class B {
public:
void f1() { new T; f2(); }
void f2() { new T; }
};
template class B<A>;
|
google | chromium | eb131 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C | 459 | utf_8 | 5324dd7dee0066d6b8ddf4bc6a9d064d | // { dg-do assemble }
// Reported against EGCS snaps 98/06/18.
struct a {
a();
void junk( float );
void junk( double );
void bar( double );
void bar( float );
void foo( void (a::*member)(float) ); // { dg-message "candidate" }
};
a::a()
{
foo( &junk ); // { dg-error "match" } junk is an unqualified-id.
foo... |
google | chromium | eb33 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C | 182 | utf_8 | ef46f07e495b4e06388c1bda41791a72 | // { dg-do run }
#include <fstream>
#include <cstdio>
int
main()
{
std::printf("If you see this, you don't have a problem!\n");
#ifdef EXPOSE_BUG
std::ifstream a;
#endif
}
|
google | chromium | eb24 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C | 289 | utf_8 | 6746831f359d3159b992e820ac0aa390 | // { dg-do assemble }
#include <iostream>
template < class T >
class X
{
protected:
union {
int x;
double y;
};
};
template < class T >
class Y : public X<T>
{
public:
using X<T>::x;
void f () { std::cout << this->x << std::endl; }
};
|
google | chromium | cleanup2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/cleanup2.C | 1,003 | utf_8 | 57ecd5105431558454404c7819e3a288 | // { dg-do run }
// make sure we don't call base dtors, if we failed to call the
// base ctor due to exception throwing
#include <stdio.h>
static bool bad = false;
static int thrower ()
{
printf ("in %s\n", __PRETTY_FUNCTION__);
throw 0;
return 0;
}
struct X
{
X (int) throw (int);
~X () throw ();
};
X::X (in... |
google | chromium | rethrow1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow1.C | 638 | utf_8 | 14439300d0eacee555d7a12aeba4e6b8 | // { dg-do run }
// Testcase for proper handling of rethrow.
#include <stdio.h>
int c, d;
struct A
{
int i;
A () { i = ++c; printf ("A() %d\n", i); }
A (const A&) { i = ++c; printf ("A(const A&) %d\n", i); }
~A() { printf ("~A() %d\n", i); ++d; }
};
int
main ()
{
try
{
try
{
printf ("Throwi... |
google | chromium | catch5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch5.C | 3,548 | utf_8 | a71ea0d01a33b5b4e9fb212065f0ee4c | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D--B==A
// +--C==A
// +--AA-A
struct A { int m; };
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct AA : A { int m; };
struct D : B, C, AA { int m; };
void fna(A *obj) { t... |
google | chromium | crash2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash2.C | 366 | utf_8 | 1604e9f615755f1d4b2fbb38669a2a74 | // { dg-do assemble }
// { dg-options "-O" }
struct C {
~C();
};
struct R {
bool empty() const;
C m_;
};
struct R1 {
R1( const R& a );
~R1 ();
C m_;
};
R1 get_empty();
R1::R1( const R& a ) :
m_( a.empty() ? get_empty().m_ : C() )
{}
void qnorm( const R & r)
{ R1 n( r ); } |
google | chromium | ctor1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C | 320 | utf_8 | a8588cae0f30dee79221e34403a895d2 | // { dg-do assemble }
struct A
{
A(); // { dg-message "" } candidate
A(A&); // { dg-message "candidates" } referenced below
};
int
main ()
{
try
{
throw A(); // { dg-error "no matching" "match" } can't copy
// { dg-error "thrown expression" "expr" { target *-*-* } 13 }
}
catch (...) { }
}
|
google | chromium | flow1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/flow1.C | 252 | utf_8 | 69dc075b8772cb01d011939a1a0896fb | // { dg-do run }
#include <stdio.h>
int bar ()
{
throw 100;
return 0;
}
int main ()
{
int i = 0; // this gets deleted after flow analysis
try
{
i = bar ();
}
catch (...)
{
}
printf ("i = %d\n", i);
return i;
}
|
google | chromium | tmpl6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl6.C | 199 | utf_8 | fefbac87316860d887029e17e36d1d08 | // { dg-do assemble }
struct S
{
int i;
};
template <class T>
void f ()
{
try {
} catch (S& s) {
s.i = 3;
}
}
template void f<int>(); |
google | chromium | crash3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash3.C | 291 | utf_8 | 739c732403e3a10677bc952248d7b3cf | // { dg-do assemble }
// Used to use -fsjlj-exceptions, but that isn't an option anymore.
extern double f(double a);
void
a()
{
double e;
double value;
if (e == 0)
throw 1;
value = f(e);
} |
google | chromium | vbase1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/vbase1.C | 284 | utf_8 | 52161bf0667ab5bb0976ef620f54a3e7 | // { dg-do run }
int i;
int j;
struct B
{
B() { i = 1; }
~B() { j = 7; }
};
struct D : virtual public B {
D () { throw 3; }
};
int main ()
{
try {
D d;
} catch (int) {
if (i != 1 || j != 7)
return 1;
}
} |
google | chromium | tmpl3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl3.C | 188 | utf_8 | 6d0c3812ec0559cc3638491900029f8e | // { dg-do assemble }
template<class T> struct A {
void X() throw(T);
};
template<class T>
inline void A<T>::X()
throw(T) { } |
google | chromium | catch4p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch4p.C | 2,508 | utf_8 | f76e4f74d7a5922b67ca155ccb12af53 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class. Check with a virtual
// polymorphic public DAG.
// -- public, << private, == virtual
// D--B==A
// +--C==A
struct A { int m; virtual ~A(){}};
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct D : B, C { int m; }... |
google | chromium | spec2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec2.C | 526 | utf_8 | 9189513b7373fcafd70354c0feffe753 | // { dg-do run }
// Testing exception specifications.
// Test 2: the second throw succeeds.
#include <stdlib.h>
#include <exception>
void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
f () throw (int, std::bad_exception)
{
throw 'a';
}
int main ()
{
std::set_terminate (my_term);
std::set_unex... |
google | chromium | cleanup1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/cleanup1.C | 491 | utf_8 | 1cc33ca0d264eecaa7569209bd88e447 | // { dg-do run }
// Bug: obj gets destroyed twice because the fixups for the return are
// inside its cleanup region.
extern "C" int printf (const char *, ...);
int d;
struct myExc { };
struct myExcRaiser {
~myExcRaiser() { throw myExc(); }
};
struct stackObj {
~stackObj() { ++d; printf ("stackObj::~stackObj(... |
google | chromium | vbase2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/vbase2.C | 311 | utf_8 | 29c8219607403d8ae6a93ba3cc8bbfd5 | // { dg-do run }
int i;
struct A
{
A () { i++; }
~A () { i--; }
};
struct B : public virtual A
{
B () { throw 1; }
};
struct D: public B, virtual public A
{
};
void f()
{
D d;
}
int main ()
{
try {
f();
} catch (int) {
}
return i;
} |
google | chromium | crash6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash6.C | 493 | utf_8 | c80d5660b1728bc2ac055847f51343bc | // { dg-do assemble }
//
// Bug 2368. When checking shadowed catchers, we didn't ignore
// template type parms etc, leading to an ICE
template<class CatchType1, class CatchType2>
void call(int& a)
{
try
{
}
catch (CatchType1&)
{
}
catch (CatchType2&)
{
}
} |
google | chromium | catch14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch14.C | 404 | utf_8 | 9d8e8ea3328cf56e911bdfa42b0fa662 | // { dg-do assemble }
// { dg-options "-O1" }
void foo();
struct A {
A (int x) { };
~A() {
try {
foo ();
} catch (...) { }
};
};
struct B;
B *x;
struct B {
void a();
void b();
static B* c() {
A y = 0;
return x;
};
};
void B::a() {
c()->b();
} |
google | chromium | terminate1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/terminate1.C | 488 | utf_8 | 52f0d9c99c2f28d0aca8af009027b25d | // { dg-do run }
// Test that an exception thrown out of the constructor for the exception
// object (i.e. "after completing evaluation of the expression to be thrown
// but before the exception is caught") causes us to call terminate.
#include <exception>
#include <cstdlib>
void my_terminate ()
{
std::exit (0);
}... |
google | chromium | catch6p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch6p.C | 4,391 | utf_8 | 959f98c90792e99105ba3cc5ac5cf39b | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// E==D--B==A
// +--C==A
// +--AA-A
struct A { int m; virtual ~A(){}};
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct AA : A { int m; };
struct D : B, C, AA { int m; ... |
google | chromium | tmpl2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C | 411 | utf_8 | 10ba7935836a909b4eeef0ac2a8431b5 | // { dg-do assemble }
// { dg-options "-O" }
template<class T>
class FixSeq
{
public:
void append(const T&);
};
class foo
{
public:
void setupIR();
};
typedef FixSeq<foo *> bar;
extern void dummy (foo *);
void *
foobar (bar &x, foo *p)
{
try
{
p -> setupIR();
}
catch(...)
{
... |
google | chromium | spec7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec7.C | 277 | utf_8 | 1686e3d422e36e72d9253483d71d76dd | // { dg-do run }
// Test that we allow simple throw specs on pointers.
void f() throw () { }
void (*pf)() throw () = f;
struct A
{
void g() throw () { }
static void (A::*pmf)() throw ();
};
void (A::* A::pmf)() = &A::g;
int main()
{
pf ();
A a;
(a.*A::pmf)();
}
|
google | chromium | inline1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/inline1.C | 345 | utf_8 | 039eb5ce59747bf780d3040d05a5b84f | // { dg-do assemble }
// { dg-options "-ansi -pedantic-errors -O2" }
struct Foo
{
inline ~Foo ();
};
inline void Wibble (int) throw ()
{
}
inline Foo::~Foo ()
{
Wibble (6);
}
int ExtendFoos ()
{
Foo tmp;
return 0;
} |
google | chromium | inline2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/inline2.C | 324 | utf_8 | 1f10a9c93f1ab6845ba1a02819abf154 | // { dg-do run }
// { dg-options "-O" }
// Test that inlining a destructor with a catch block doesn't confuse the
// enclosing try block.
struct A {
~A()
{
try { throw 1; }
catch (...) { }
}
};
int main ()
{
try
{
A a;
throw 42;
}
catch (int i)
{
return (i != 42);
... |
google | chromium | spec1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec1.C | 538 | utf_8 | 48f9e05c20869ab203537dfe4e333f61 | // { dg-do run }
// Testing exception specifications.
// Test 1: the original exception succeeds.
#include <stdlib.h>
#include <exception>
void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
f () throw (char, int, std::bad_exception)
{
throw 'a';
}
int main ()
{
std::set_terminate (my_term);
s... |
google | chromium | new2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/new2.C | 675 | utf_8 | d8c3feae6c98e7b276d2825215b3ac7d | // { dg-do run }
// Test that a throw in B's constructor destroys the A and frees the memory.
#include <cstddef>
#include <cstdlib>
#include <new>
struct A {
A();
~A();
};
struct B {
B (A);
};
void foo (B*);
int newed, created;
int main ()
{
newed = 0; // The libraries might call new before main starts.
... |
google | chromium | tmpl5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl5.C | 178 | utf_8 | ea01e485e96a2b4fc269ec88d516498b | // { dg-do assemble }
template <class T = int>
struct S
{
void f ()
{
try {
} catch (int) {
}
}
}; |
google | chromium | terminate2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C | 248 | utf_8 | e119c0abf28a26060ddb1897af1b2f33 | // { dg-do run }
// Test that an unhandled exception causes us to call terminate.
#include <exception>
#include <cstdlib>
void my_terminate ()
{
std::exit (0);
}
int main (void)
{
std::set_terminate (my_terminate);
throw 1;
return 1;
}
|
google | chromium | spec5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec5.C | 64 | utf_8 | 6661bd6d7f84a5facb2e16615b994483 | // { dg-do assemble }
extern void *f(unsigned int k) throw();
|
google | chromium | catch7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch7.C | 4,259 | utf_8 | fb1572d0a22c1c07bc651b89054e61f2 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// different levels
// F--D--B--A
// +--C--A
// +--E--A
struct A { int m; };
struct B : A { int m; };
struct C : A { int m; };
struct D : B, C { int m; };
struct E : A { int m; };
struct F : D, E... |
google | chromium | pdel1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/pdel1.C | 377 | utf_8 | dcd0f11cabbfb7e54d51c61ccdd6c00e | // { dg-do run }
// Test for calling placement delete.
#include <new>
#include <stddef.h>
int r = 1;
struct A {
A() { throw 1; }
void operator delete (void *p, int, int) { r = 0; ::operator delete (p); }
};
void * operator new (size_t size, int, int) { return operator new (size); }
int main ()
{
try {
A... |
google | chromium | catch5p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch5p.C | 3,562 | utf_8 | 55071b04c42ba6a5afb0653fdfa950c0 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D--B==A
// +--C==A
// +--AA-A
struct A { int m; virtual ~A(){}};
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct AA : A { int m; };
struct D : B, C, AA { int m; };
void f... |
google | chromium | ptr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/ptr1.C | 372 | utf_8 | b785622dc330cbfc73460329d254e2ed | // { dg-do run }
// Bug: catching pointers by reference doesn't work right.
extern "C" int printf (const char *, ...);
struct E {
int x;
E(int i) { x = i; }
};
int main()
{
try {
E *p = new E(5);
throw p;
}
catch (E *&e) {
printf ("address of e is 0x%lx\n", (__SIZE_TYPE__)e);
return !((__... |
google | chromium | vbase4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/vbase4.C | 596 | utf_8 | 01f7195df499dc15c0d0dfbe87e33fab | // { dg-do run }
// Derived from PR#7
// We need to destroy the thrown object when exiting the catch
// clause. That needs to destroy the original thrown object, not
// the caught one (which might be a base).
static int ok = 0;
struct A
{
A (){}
virtual ~A () {}
};
struct B : virtual A
{
int value;
B ()
:v... |
google | chromium | spec3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec3.C | 528 | utf_8 | a8575b670854fb806d0acdc9fea626a3 | // { dg-do run }
// Testing exception specifications.
// Test 3: the bad_exception throw succeeds.
#include <stdlib.h>
#include <exception>
void my_term () { exit (1); }
void my_unexp () { throw 42; }
void
f () throw (std::bad_exception)
{
throw 'a';
}
int main ()
{
std::set_terminate (my_term);
std::set_un... |
google | chromium | catch8p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch8p.C | 2,496 | utf_8 | f53033f53b20e92e0c7776246dec74d0 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D--B--A
// +--C<<A
struct A { int m; virtual ~A(){}};
struct B : A { int m; };
struct C : private A { int m; };
struct D : B, C { int m; };
void fna(A *obj) { throw obj; }
void fnb(B *obj) { thro... |
google | chromium | catch8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch8.C | 2,459 | utf_8 | 4b044e61d0b42f90c9174dd04acc1df0 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D--B--A
// +--C<<A
struct A { int m; };
struct B : A { int m; };
struct C : private A { int m; };
struct D : B, C { int m; };
void fna(A *obj) { throw obj; }
void fnb(B *obj) { throw obj; }
void ... |
google | chromium | catch9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch9.C | 2,611 | utf_8 | 197f4b69d68dd216bc930fead97cdf75 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D==B--A
// +==C--A
struct A { int m; };
struct B : A { int m; };
struct C : A { int m; };
struct D : virtual B, virtual C { int m; };
void fna(A *obj) { throw obj; }
void fnb(B *obj) { throw obj;... |
google | chromium | catch10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch10.C | 461 | utf_8 | 1e641d82ee233ceda2ae0ab2028661f9 | // { dg-do assemble }
// Test that we notice unfortunate handler ordering.
struct A { };
struct B: public A { };
struct C: private A { };
void f();
void g()
{
try { f(); }
catch (...) { } // { dg-error "" } ... followed by others
catch (A*) { }
try { f(); }
catch (A*) { } // { dg-warning "" } A* before ... |
google | chromium | catch13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch13.C | 303 | utf_8 | 6a61b8e436a8ce420adde9146b5c36df | // { dg-do assemble }
// { dg-options "-O2" }
struct A;
A *foo();
struct A {
A *a() { try { return foo(); } catch (...) {} }
void b();
void c();
};
void A::b() {
a()->c();
} |
google | chromium | rethrow4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow4.C | 638 | utf_8 | 34717a940f38a3059d5e85f5417dfc31 | // { dg-do run }
// Testcase for proper handling of rethrow.
#include <stdio.h>
int c, d;
struct A
{
int i;
A () { i = ++c; printf ("A() %d\n", i); }
A (const A&) { i = ++c; printf ("A(const A&) %d\n", i); }
~A() { printf ("~A() %d\n", i); ++d; }
};
int
main ()
{
try
{
try
{
printf ("Throwi... |
google | chromium | crash5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash5.C | 133 | utf_8 | 6f112400ec69874c71a11839a262eb16 | // { dg-do assemble }
int i;
int j;
void
f ()
{
j = j + (i ? 7 : throw 1);
}
|
google | chromium | spec4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec4.C | 514 | utf_8 | 0000aedd1cb7d3fa4ce75d4e5e1f7e03 | // { dg-do run }
// Testing exception specifications.
// Test 4: all throws fail, call terminate.
#include <stdlib.h>
#include <exception>
void my_term () { exit (0); }
void my_unexp () { throw 42; }
void
f () throw (short)
{
throw 'a';
}
int main ()
{
std::set_terminate (my_term);
std::set_unexpected (my_u... |
google | chromium | catch3p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch3p.C | 2,650 | utf_8 | e29f056220140463c6ac35c897fd3486 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class. Check with a non-virtual
// polymorphic public DAG.
// -- public, << private, == virtual
// D--B--A
// +--C--A
struct A { int m; virtual ~A(){}};
struct B : A { int m; };
struct C : A { int m; };
struct D : B, C { int m; };
void fna(A ... |
google | chromium | vbase3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/vbase3.C | 260 | utf_8 | 787cd08bcfea446b1d5bdff831e7b361 | // { dg-do assemble }
// Used to use -fsjlj-exceptions, but that isn't an option anymore.
struct ios {
virtual ~ios();
};
struct fstreambase : virtual public ios {
fstreambase();
};
fstreambase::fstreambase()
{
} |
google | chromium | rethrow6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow6.C | 1,081 | utf_8 | 7d8ba296412c83f633f9284c22944391 | // { dg-do run }
// Testcase for proper handling of rethrow.
#include <stdio.h>
int c, d;
int wrong;
struct A
{
int i;
A () { i = c++; printf ("A() %d\n", i); }
A (const A&) { i = c++; printf ("A(const A&) %d\n", i); }
~A() { printf ("~A() %d\n", i); ++d; }
};
struct B
{
~B () {
try
{
printf (... |
google | chromium | badalloc1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 2,959 | utf_8 | 8ce211dcfbbb9e15328d83d047c2df10 | // This fails for VxWorks RTPs because the initialization of
// __cxa_allocate_exception's emergency buffer mutex will
// itself call malloc(), and will fail if there is no more
// memory available.
// { dg-do run { xfail { { xstormy16-*-* *-*-darwin[3-7]* } || vxworks_rtp } } }
const int arena_size = 262144;
#else
con... |
google | chromium | tmpl4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl4.C | 167 | utf_8 | 10467f823d0bb353512055f6c0547e95 | // { dg-do assemble }
template <class T> void test(){
try {
}
catch(int x){
}
}
template void test<int>(); |
google | chromium | cond1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/cond1.C | 1,000 | utf_8 | cdc579ac8c8f4328b5b16917b301b7e8 | // { dg-do assemble }
// http://gcc.gnu.org/ml/gcc-bugs/1999-03n/msg00888.html
// conditional exprs have some funny rules when one of the types is void.
// [expr.cond] 5.16, make sure we do the right things
// We implement an extension, allowing one side to be void, check we
// pedantically moan.
struct X {};
void fn(... |
google | chromium | rethrow2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow2.C | 634 | utf_8 | 95550e7ef609ae5195a6a1e6cc4baa59 | // { dg-do run }
// Testcase for proper handling of rethrow.
#include <stdio.h>
int c, d;
struct A
{
int i;
A () { i = ++c; printf ("A() %d\n", i); }
A (const A&) { i = ++c; printf ("A(const A&) %d\n", i); }
~A() { printf ("~A() %d\n", i); ++d; }
};
int
main ()
{
try
{
try
{
printf ("Throwi... |
google | chromium | catch4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch4.C | 2,481 | utf_8 | 633708e13e461fa275be7a0b1b690d9c | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class. Check with a virtual public
// DAG.
// -- public, << private, == virtual
// D--B==A
// +--C==A
struct A { int m; };
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct D : B, C { int m; };
void fna(A *obj) { throw ... |
google | chromium | tmpl1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/tmpl1.C | 146 | utf_8 | bfcd96a6be46cd19e464b5a874591ba6 | // { dg-do run }
template <class T>
void f() throw (T)
{
throw 7;
}
int main()
{
try {
f<int>();
} catch (...) {
return 0;
}
}
|
google | chromium | new1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/new1.C | 614 | utf_8 | bc3be4ed3cbbdaf45e37fd25ea03d76b | // { dg-do run }
// Test that a throw in foo destroys the A, but does not free the memory.
#include <cstddef>
#include <cstdlib>
#include <new>
struct A {
A();
~A();
};
struct B {
B (A);
};
void foo (B*);
int newed, created;
int main ()
{
try {
foo (new B (A ()));
} catch (...) { }
return !(newe... |
google | chromium | catch11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch11.C | 1,125 | utf_8 | a83d60c4fb96f4454d525c1e8b6a33a7 | // { dg-do run }
// we should be able to catch a base a virtual, provided it is accessible by at
// least one public path
// -- public, << private, == virtual
// E<<B==A
// +--C==A
// +<<D==A
struct A {};
struct B : virtual A {};
struct C : virtual A {};
struct D : virtual A {};
struct E : private B, public C, private... |
google | chromium | catch12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch12.C | 1,188 | utf_8 | 22f50aa9e05125f9a73411eeae9cd099 | // { dg-do run }
// we should be able to catch a base a virtual, provided it is accessible by at
// least one public path
// -- public, << private, == virtual
// E--B<<==A
// +--C--==A
// +--D<<==A
struct A {};
struct B : private virtual A {};
struct C : virtual A {};
struct D : private virtual A {};
struct E : public... |
google | chromium | catch3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch3.C | 2,629 | utf_8 | d4c0ba3d45a00d15821ab3121af637c5 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class. Check with a non-virtual public
// DAG.
// -- public, << private, == virtual
// D--B--A
// +--C--A
struct A { int m; };
struct B : A { int m; };
struct C : A { int m; };
struct D : B, C { int m; };
void fna(A *obj) { throw obj; }
void ... |
google | chromium | catch2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch2.C | 139 | utf_8 | 3324d129f93366b1521e80f1d4b9bdd6 | // { dg-do assemble }
typedef char TCHAR;
int main()
{
try {}
catch( TCHAR* Err ) {}
} |
google | chromium | catch7p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch7p.C | 4,273 | utf_8 | da860acfae474cb40b3c3d4201980b67 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// different levels
// F--D--B--A
// +--C--A
// +--E--A
struct A { int m; virtual ~A(){}};
struct B : A { int m; };
struct C : A { int m; };
struct D : B, C { int m; };
struct E : A { int m; };
s... |
google | chromium | rethrow5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow5.C | 621 | utf_8 | b08fe5424b926c4b2ba51c914a22ebd3 | // { dg-do run }
// Testcase for proper handling of rethrow.
#include <stdio.h>
int c, d;
struct A
{
int i;
A () { i = ++c; printf ("A() %d\n", i); }
A (const A&) { i = ++c; printf ("A(const A&) %d\n", i); }
~A() { printf ("~A() %d\n", i); ++d; }
};
int
main ()
{
try
{
try
{
printf ("Throwi... |
google | chromium | ia64-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/ia64-1.C | 1,667 | utf_8 | 61d2aa8a2e535da0c60a9ce1a83a3357 | // { dg-do run }
// { dg-options "-O2" }
#include <exception>
using namespace std;
extern "C" void abort();
int i_0, i_1, i_2, i_3, i_4, i_5, i_6, i_7, i_8, i_9;
int j_0, j_1, j_2, j_3, j_4, j_5, j_6, j_7, j_8, j_9;
int k_0, k_1, k_2, k_3, k_4, k_5, k_6, k_7, k_8, k_9;
int l_0, l_1, l_2, l_3, l_4, l_5, l_6, l_7, l... |
google | chromium | spec6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/spec6.C | 5,908 | utf_8 | 61689abc5da47a4419be22a673165916 | // { dg-do assemble }
// Determine that throw specifiers are checked correctly.
// [except.spec] 1, a type in an exception specifier shall not be incomplete,
// or pointer or ref to incomplete
struct X; // { dg-error "" } forward declaration.*
void fn1() throw(X); // { dg-error "" ... |
google | chromium | crash1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash1.C | 210 | utf_8 | 5465c867aef7fe0b375e0b733300bc1b | // { dg-do assemble }
// { dg-options "-O1 -fno-inline-functions" }
struct A
{
~A ();
};
bool foo ();
int i;
int j;
A bar ()
{
for (i = 0; i < 1; ++i)
if (j)
{
A tmp;
return tmp;
}
}
|
google | chromium | fntry1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/fntry1.C | 429 | utf_8 | 4d9e6f65aec19c778c890a288bae5690 | // { dg-do run }
// Bug: g++ fails to treat function-try-blocks in ctors specially.
int c;
int r;
struct A {
int i;
A(int j) { i = j; }
~A() { c += i; }
};
struct B: public A {
A a;
B() try : A(1), a(2)
{ throw 1; }
catch (...)
{ if (c != 3) r |= 1; }
};
int main ()
{
try
{ B b; }
catch (..... |
google | chromium | catchptr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catchptr1.C | 3,051 | utf_8 | e04cf950955ebdaeda17f9fc71317cc7 | // { dg-do run }
// Test pointer chain catching
#include <stdio.h>
void fn () {}
struct A {void fn () {}};
static int var = 1;
static const int const_var = 2;
struct B;
struct C;
int test0 ()
{
try
{
throw &fn;
}
catch (void *)
{
// should not decay to void *
return 1;
}
catch (... |
google | chromium | catch9p | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch9p.C | 2,615 | utf_8 | 0c50a52f2e135d4383841ee8705917e9 | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// D==B--A
// +==C--A
struct A { int m; virtual ~A(){}};
struct B : A { int m; };
struct C : A { int m; };
struct D : virtual B, virtual C { int m; };
void fna(A *obj) { throw obj; }
void fnb(B *obj... |
google | chromium | ptrmem1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/ptrmem1.C | 235 | utf_8 | f719d5e34281fd7f7695b6c2eb8f292e | // { dg-do run }
extern "C" void exit (int);
extern "C" void abort (void);
struct A { int i; };
int main ()
{
try { throw &A::i; }
catch (int A::*p)
{
if (p == &A::i)
exit (0);
else
abort ();
}
abort ();
}
|
google | chromium | pdel2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/pdel2.C | 393 | utf_8 | e1c4cc132ea9728d91e30c0754ea6300 | // { dg-do run }
// Test for not calling mismatched placement delete.
#include <new>
#include <stddef.h>
int r = 0;
struct A {
A() { throw 1; }
void operator delete (void *p, int, long) { r = 1; ::operator delete (p); }
};
void * operator new (size_t size, int, int) { return operator new (size); }
int main ()... |
google | chromium | crash4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/crash4.C | 214 | utf_8 | 328c615c13278b502e18b7a38ea32810 | // { dg-do assemble }
// { dg-options "-O2" }
struct A
{
A (int) { }
~A () { }
int get () const { return 0; }
};
void f (const A &s) {
f (s.get ());
} |
google | chromium | rethrow3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C | 503 | utf_8 | 12e5b71c334940b1fa0faec9ac801e8f | // { dg-do run }
#include <stdio.h>
#include <stdlib.h>
#include <exception>
static void
eh_terminate ()
{
printf ("CALLING TERMINATE\n");
exit (1);
}
void
eh_test (int level)
{
try
{
if (level < 2)
eh_test (level + 1);
else
{
printf ("%d: Throwing\n", level);
throw (level);
}
}
... |
google | chromium | throw2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/throw2.C | 285 | utf_8 | b17358a7b7abb8e03e2200e1d687babd | // { dg-do assemble }
#define ANY int // a class with a public constructor
void athrow(const ANY & e) throw(ANY)
{
throw e; // { dg-bogus "" } discarding const
}
int main(void)
{
athrow(ANY());
return 0;
} |
google | chromium | catch6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch6.C | 4,377 | utf_8 | a36acf1ee545471cf23048b2e8a2df6b | // { dg-do run }
// { dg-options "-w" }
// We cannot catch an ambiguous base class.
// -- public, << private, == virtual
// E==D--B==A
// +--C==A
// +--AA-A
struct A { int m; };
struct B : virtual A { int m; };
struct C : virtual A { int m; };
struct AA : A { int m; };
struct D : B, C, AA { int m; };
struct E : ... |
google | chromium | unwind1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/unwind1.C | 319 | utf_8 | 9bca9f25779ab51cf9eb8a105e239597 | // { dg-do run }
// Test that unwinding properly restores SP.
void f (int i)
{
throw i;
}
int main ()
{
void *sp1 = __builtin_alloca (0);
try
{
f (0);
}
catch (int)
{
}
void *sp2 = __builtin_alloca (0);
return (sp1 != sp2);
} |
google | chromium | throw1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/throw1.C | 129 | utf_8 | 5670e8b41fe518da30777cff2b48b76f | // { dg-do assemble }
void athrow(const int & e) throw(int)
{
throw e;
}
int main(void)
{
athrow(int());
return 0;
}
|
google | chromium | catch1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.eh/catch1.C | 418 | utf_8 | f9b83360c3e457b4d7a952e5cfea8d08 | // { dg-do assemble }
//
// We cannot catch an incomplete type, or ptr to one
struct A; // { dg-error "" } forward decl
void fn()
{
try {}
catch (A *p) {} // { dg-error "" } undefined type
try {}
catch (A p) {} // { dg-error "" } undefined type
try {}
catch (void const *p) {} // ok
} |
google | chromium | ns1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/ns1.C | 281 | utf_8 | ad3eac5cce6247b57053146272ad863a | // { dg-do assemble }
void foo();
namespace bar {
class baz {
friend void ::foo(); // { dg-bogus "" } parse error
};
} |
google | chromium | delete2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/delete2.C | 431 | utf_8 | 8c0b3f49c2e5d5c224c1e0aae235e1d8 | // { dg-do run }
// Test whether dtors of vbases are called on delete[].
extern "C" void abort();
extern "C" void exit(int);
struct Foo {
~Foo() {
exit(0);
}
};
struct Bar : virtual Foo {
};
int main() {
delete [] new Bar[1];
abort();
} |
google | chromium | ctor1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/ctor1.C | 353 | utf_8 | c17ab5a5d39a20786219d5cb72e8a956 | // { dg-do assemble }
struct A {
A() : x; // { dg-error "" } missing body
};
struct B {
void m() {}
};
struct C {
// The error message below says it is within A::B::m()!
void n() {}
}; |
google | chromium | template3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/template3.C | 284 | utf_8 | 443bfe7e24350c24cc6466f4ec914d30 | // { dg-do assemble }
template <class T> class C {};
class foo {} bar = bar.C(); // { dg-error "" } call to template |
google | chromium | dwarf1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/dwarf1.C | 329 | utf_8 | e0d3e8aef40e06d214dac0b24734a598 | // { dg-do assemble }
// Used to fail with dwarf debugging.
template <class T = void>
struct foo {
static const int ELEMENTS = 1;
int bar[ELEMENTS];
};
foo<> bar; |
google | chromium | delete1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C | 964 | utf_8 | d5a79bc5cd269747572d454134bc7e04 | // { dg-do assemble }
// based on analysis by Martin v. Loewis
// [class.dtor]/11: delete must be implicitly checked for
// accessibility only in the definition of virtual destructors,
// implicitly defined or not.
struct foo {
foo() {}
private:
void operator delete(void *) {} // { dg-error "" } private
} foo_;
st... |
google | chromium | template6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/template6.C | 414 | utf_8 | 5a12a509e3ad4f540060b19515931b54 | // { dg-do assemble }
template <typename> struct foo {};
template <> void foo(); // { dg-error "not a template function" } bad specialization
struct baz {};
template <> void baz (); // { dg-error "not a template function" } bad specialization |
google | chromium | template5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/template5.C | 257 | utf_8 | ca9037b495f56944f828e7c59cd45614 | // { dg-do assemble }
template <typename> class X {
template <typename> class Z;
};
X<void> a; |
google | chromium | expr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/expr1.C | 373 | utf_8 | f8dc1e3b047760a647ca3fc66b22ab14 | // { dg-do assemble }
// gcc 2.95 reports:
// invalid operands `foo' and `int' to binary `operator !='
class foo {} bar;
int i = void(bar) ? 1 : 0; // { dg-bogus "" "" { xfail *-*-* } } - operator!= - |
google | chromium | friend1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/friend1.C | 249 | utf_8 | 157f8168456e389ac4f34a5082e75a7c | // { dg-do assemble }
// We shouldn't warn about bar referring to a non-template in this case.
template <typename T>
class foo {
friend int bar(int);
}; |
google | chromium | ns2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/ns2.C | 332 | utf_8 | 6145af5e9f76316b1d149f4bc47f97db | // { dg-do assemble }
// variation of ns1.C
void foo();
namespace bar {
using ::foo;
class baz {
friend void foo(); // { dg-bogus "" "" { xfail *-*-* } } - conflict -
};
} |
google | chromium | template4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/template4.C | 465 | utf_8 | 4bf2b2de8531cb926b80c542226b064c | // { dg-do assemble }
template <const int&> struct X {};
int a = 1;
X<a> x; // ok, a has external linkage
const int b = 2;
X<b> y; // { dg-error "" } const b has internal linkage
extern const int c;
X<c> z; // ok, c has external linkage
extern const int c = 3;
X<c> z_; // { dg-bogus "" } using c as constant |
google | chromium | inline1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/inline1.C | 400 | utf_8 | 410d7d1fd1d6e3575100642f8c9a65e8 | // { dg-do assemble }
// Derived from GNU lilypond.
struct foo {
foo();
foo(const foo&);
~foo();
};
struct bar {
foo foo_member;
bar();
bar(const bar&);
// ~bar();
};
struct baz {
void error (bar s);
};
void fail() __attribute__((noreturn));
void baz::error (bar s) {
fail();
} |
google | chromium | template7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/template7.C | 359 | utf_8 | 653ffd8fb42a52f23da2a7d4afdb6109 | // { dg-do assemble }
template<class> struct A {};
template<template<class> class T> struct B {
B() {
T<B>(); // { dg-bogus "" } conversion from int to non-scalar
}
};
B<A> foo; |
google | chromium | ext1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/ext1.C | 523 | utf_8 | 0207e523c92eab8efadd6a868b5b3fe1 | // { dg-do run }
// { dg-options "" }
extern "C" void abort();
int main () {
char x[1];
char *y = x ? /* implicit x */ : 0;
/* For some reason, the array x is copied twice, and y points to the
second copy (the first is never used). If x is explicit, no copy
is created, and the program succeeds. */
... |
google | chromium | linkage1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/linkage1.C | 579 | utf_8 | 0600de20dd7c2cf10dfb97ea4eb07915 | // { dg-do link }
// { dg-additional-sources " linkage1-main.cc" }
// Verify that a member of a class is given global linkage when it's a
// member of a function whose name is taken from a typedef, by
// checking that another translation unit can call it. We don't do
// the right things on functions, but we do on data... |
google | chromium | typename1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/typename1.C | 360 | utf_8 | d4ea4be0f27972210ed708dce5e36278 | // { dg-do assemble }
template <class T> struct foo;
template <class T> struct bar {
typedef int foo;
};
template <class T> struct baz {
typedef bar<T>::foo foo; // { dg-error "" } missing typename
}; |
google | chromium | expr2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.oliva/expr2.C | 296 | utf_8 | c0514fbc4a06765f363ceaa37f304896 | // { dg-do run }
int i, j;
const int &f(const int& I, const int& J) {
// this must not be optimized to I because it's an lvalue
return (I != J) ? I : J;
}
int main () {
return (&f(i, j) != &j);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.