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 | android | new1_y | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/new1_y.C | 268 | utf_8 | 92b09e498a208e31dde6df42c466c11a | #include <new>
#include <cstddef>
extern int ret;
void *ptr;
void * operator new[] (std::size_t s) throw (std::bad_alloc)
{
ptr = operator new (s);
return ptr;
}
void operator delete[] (void *p) throw ()
{
if (p == ptr)
ret = 0;
operator delete (p);
}
|
google | android | new1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/new1_main.C | 250 | utf_8 | 38e1dfdb58be8ee752ace0ded7df8d8f | // PR c++/5757
// Test that when a constructor throws in a new-expression, we pass the
// right pointer to operator delete.
// Split into pieces for binary compatibility testing October 2002
extern void new1_x (void);
int
main ()
{
new1_x ();
}
|
google | android | filter1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/filter1_main.C | 198 | utf_8 | 9c2ea2f2cc5e5b2283f45eeade96358c | // Test that cleanups get run when a catch filter fails to match.
// Split into pieces for binary compatibility testing October 2002
extern void filter1_x (void);
int
main ()
{
filter1_x ();
}
|
google | android | spec3_y | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/spec3_y.C | 72 | utf_8 | 508954403be93157fb5a4d1acac0da9a | #include "spec3.h"
A::A() {}
void func() throw (B,A)
{
throw A();
}
|
google | android | filter2_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/filter2_x.C | 268 | utf_8 | 93ea6392a008bc4ab584a68bd3d08d74 | #include <exception>
#include <cstdlib>
extern "C" void abort (void);
extern void my_terminate (void);
extern void ex_test (void);
void
filter2_x ()
{
std::set_terminate (my_terminate);
try
{
ex_test ();
}
catch (...)
{
}
abort ();
}
|
google | android | dtor1_y | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/dtor1_y.C | 155 | utf_8 | 387901206dc245414a4deeecde9f8323 | extern int r;
int ad;
#include "dtor1.h"
A::~A () { ++ad; }
B::~B ()
try
{
throw 1;
}
catch (...)
{
if (!ad)
r = 1;
return;
}
|
google | android | template1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/template1_x.C | 257 | utf_8 | cc55eca6c7503bffbb9c4c730b4fbc32 | extern "C" void exit (int);
extern "C" void abort (void);
#include "template1.h"
void template1_x ()
{
int caught = 0;
try
{
C<int> x;
x.f();
}
catch (A)
{
++caught;
}
if (caught != 1)
abort ();
exit (0);
}
|
google | android | nrv1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/nrv1_main.C | 214 | utf_8 | 4b1db86bc09112a3c5dcadf8c1f37ed2 | // PR c++/5636
// Bug: the named return value optimization interfered with EH cleanups.
// Split into pieces for binary compatibility testing October 2002
extern void nrv1_x (void);
int
main ()
{
nrv1_x ();
}
|
google | android | unexpected1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/unexpected1_x.C | 314 | utf_8 | 44115c4623ba7f70d9a798029cdb996d | #include <exception>
struct One { };
struct Two { };
extern "C" void abort ();
extern void doit (void) throw (Two);
extern void handle_unexpected (void);
void
unexpected1_x ()
{
std::set_unexpected (handle_unexpected);
try
{
doit ();
}
catch (Two &)
{
}
catch (...)
{
abort ();
}
}
|
google | android | filter2_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/filter2_main.C | 276 | utf_8 | f858c620725c1fa9e60d5f73d3262345 | // Test that terminate gets run when a catch filter fails to match while
// running destructors. Original bug depended on a::~a being inlined.
// Split into pieces for binary compatibility testing October 2002
extern void filter2_x (void);
int
main ()
{
filter2_x ();
}
|
google | android | ctor2_y | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/ctor2_y.C | 191 | utf_8 | 0f35be1d041aff390ee492433aa2d4e2 | extern int r;
void *p;
#include "ctor2.h"
VBase::VBase ()
{
p = this;
}
VBase::~VBase ()
{
if (p != this) r = 1;
}
Stream::Stream () {}
DerivedStream::DerivedStream ()
{
throw 1;
}
|
google | android | template1_y | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/template1_y.C | 113 | utf_8 | afd58e33c0f82e6f79a20b57f3d3d543 | #include "template1.h"
template<class T> void C<T>::f (void) throw (E)
{
throw E();
}
template class C<int>;
|
google | android | nrv1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/nrv1_x.C | 244 | utf_8 | e9b38e15c3e28368fa741de9b55c0651 | extern "C" void exit (int);
extern "C" void abort (void);
#include "nrv1.h"
extern A f (void);
int c, d;
void nrv1_x ()
{
try
{ A a = f(); }
catch (...) { }
if (d < c)
abort ();
exit (0);
}
A::A() { ++c; }
A::~A() { ++d; }
|
google | android | template1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/template1_main.C | 252 | utf_8 | bcdcff6986bfc8964bcdb7735b5f4204 | // Test whether exception specifier dependent on template parameter
// is accepted during template decl processing.
// Split into pieces for binary compatibility testing October 2002
extern void template1_x (void);
int
main ()
{
template1_x ();
}
|
google | android | ctor1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/ctor1_main.C | 269 | utf_8 | 74d8ae87a4aa4945c36db0894fcdbc87 | // PR 411
// Split into pieces for binary compatibility testing October 2002
extern void ctor1_x (void);
int
main ()
{
ctor1_x ();
} |
google | android | ctor1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/ctor1_x.C | 258 | utf_8 | 5919ecfa4fa000ff8d0708eff1caafd0 | extern "C" void abort (void);
extern "C" void exit (int);
#include "ctor1.h"
bool was_f_in_Bar_destroyed=false;
void ctor1_x ()
{
try
{
Bar f;
}
catch(int i)
{
if(was_f_in_Bar_destroyed)
{
exit (0);
}
}
abort ();
}
|
google | android | filter1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/filter1_x.C | 239 | utf_8 | 790ecc4df54d29594a1afbcd3eb446cc | #include "filter1.h"
extern "C" void exit (int);
extern "C" void abort (void);
extern void ex_test (void);
void
filter1_x ()
{
try
{
ex_test ();
}
catch (...)
{
}
abort ();
}
a::a() { }
a::~a() { exit (0); }
|
google | android | new1_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/new1_x.C | 391 | utf_8 | 776feefd2e68940a9d16fef92f39fbbf | #include <new>
#include <cstddef>
extern "C" void exit (int);
extern "C" void abort (void);
extern void * operator new[] (std::size_t s) throw (std::bad_alloc);
extern void operator delete[] (void *p) throw ();
struct A
{
A() { throw 1; }
~A() {}
};
int ret = 1;
void
new1_x ()
{
try
{
A *p = new A[... |
google | android | dtor1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/dtor1_main.C | 265 | utf_8 | be684e295c4596152951b27d97ac5230 | // PR c++/411
// Test that a fully-constructed base is destroyed before transferring
// control to the handler of a function-try-block.
// Split into pieces for binary compatibility testing October 2002
extern void dtor1_x (void);
int
main ()
{
dtor1_x ();
}
|
google | android | unexpected1_main | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/unexpected1_main.C | 209 | utf_8 | 63e2df9df15791b47fb2317e1cda976a | // PR 3719
// Test that an unexpected handler can rethrow to categorize.
// Split into pieces for binary compatibility testing October 2002
extern void unexpected1_x ();
int
main ()
{
unexpected1_x ();
}
|
google | android | spec3_x | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/compat/eh/spec3_x.C | 115 | utf_8 | cf5c2475c71752fe4fdfa22840b5e2d0 | #include "spec3.h"
extern void func () throw (B,A);
void spec3_x (void)
{
try { func(); }
catch (A& a) { }
}
|
google | android | pr63913 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr63913.C | 175 | utf_8 | a84e2582a036f0562ca82b54e5c2ead4 | // PR sanitizer/63913
// { dg-do compile }
// { dg-options "-fsanitize=bool -fnon-call-exceptions" }
struct B { B (); ~B (); };
double
foo (bool *x)
{
B b;
return *x;
}
|
google | android | pr59331 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59331.C | 189 | utf_8 | 79755a51c3cbb97ff48bd411272f6b08 | /* { dg-do compile } */
/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
void foo(int i)
{
/* Don't warn here with "value computed is not used". */
char a[i];
}
|
google | android | return-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/return-1.C | 338 | utf_8 | 23b03c04f7b3df05a2e3c261dbfbc91d | // { dg-do run }
// { dg-options "-fsanitize=return" }
// { dg-shouldfail "ubsan" }
struct S { S (); ~S (); };
S::S () {}
S::~S () {}
int
foo (int x)
{
S a;
{
S b;
if (x)
return 1;
}
}
int
main ()
{
foo (0);
}
// { dg-output "execution reached the end of a value-returning function without ret... |
google | android | pr59415 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59415.C | 121 | utf_8 | 362dc721b3701a8d4ba53617ee7bbac3 | /* { dg-do compile } */
/* { dg-options "-fsanitize=null -Wall -fvtable-verify=std" } */
void
foo (void)
{
throw 0;
}
|
google | android | pr59250 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59250.C | 223 | utf_8 | a654df71119821a4303cc9fe0501191b | // PR sanitizer/59250
// { dg-do compile }
// { dg-options "-fsanitize=undefined" }
struct E {
int i;
};
struct S {
const char *s;
S (const char *);
static E *e;
};
S::S (const char *) : s (0)
{
e = new E ();
}
|
google | android | pr60569 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr60569.C | 261 | utf_8 | f79c5c3fe416583c001d6aaea7674732 | // PR sanitizer/60569
// { dg-do link }
// { dg-require-effective-target lto }
// { dg-options "-fsanitize=undefined -flto" }
struct A
{
void foo ();
struct
{
int i;
void bar () { i = 0; }
} s;
};
void A::foo () { s.bar (); }
int
main ()
{
}
|
google | android | pr59437 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59437.C | 398 | utf_8 | c01510327223fa5084d138538e05d01f | // { dg-do compile }
// { dg-options "-fsanitize=null -fvtable-verify=std" }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
template < typename T > struct A
{
T foo ();
};
template < typename T > struct C: virtual public A < T >
{
C & operator<< (C & (C &));
};
template < typename T >
C < T > &endl (C < int > &... |
google | android | cxx1y-vla | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/cxx1y-vla.C | 267 | utf_8 | 3787b044d92b520ab51bdee4b0c87718 | /* { dg-do run { target c++1y } } */
/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
/* { dg-shouldfail "ubsan" } */
int
main (void)
{
int y = -18;
int a[y];
return 0;
}
/* { dg-output "terminate called after throwing an instance" } */
|
google | android | div-by-zero-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/div-by-zero-1.C | 195 | utf_8 | d3199de2381370cc53674bd90925e8b0 | /* { dg-do compile } */
/* { dg-options "-fsanitize=integer-divide-by-zero -w" } */
void
foo (int i)
{
switch (i)
case 0 * (1 / 0): /* { dg-error "is not a constant expression" } */
;
}
|
google | android | cxx11-shift-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/cxx11-shift-1.C | 304 | utf_8 | 678da6c2e5888bc120393ce672fc29d4 | /* { dg-do run { target c++11 } } */
/* { dg-options "-fsanitize=shift -w" } */
#include <stdio.h>
int
main (void)
{
fputs ("UBSAN TEST START\n", stderr);
int a = 1;
a <<= 31;
fputs ("UBSAN TEST END\n", stderr);
return 0;
}
/* { dg-output "UBSAN TEST START(\n|\r\n|\r)UBSAN TEST END" } */
|
google | android | cxx11-shift-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/cxx11-shift-2.C | 182 | utf_8 | 94c1c6472b0a4f2c31978696e4f236d5 | /* { dg-do run { target c++11 } } */
/* { dg-options "-fsanitize=shift -w" } */
int
main (void)
{
int a = -42;
a <<= 1;
}
/* { dg-output "left shift of negative value -42" } */
|
google | android | pr59306 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr59306.C | 173 | utf_8 | 420a6623146bb014dc1310134356d81f | // { dg-do compile }
// { dg-options "-fsanitize=undefined" }
class A {
void bar (void (A::*) (int));
void foo (int);
void B ();
};
void A::B()
{
bar (&A::foo);
}
|
google | android | return-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/return-2.C | 385 | utf_8 | fef7db870df372327eb87bf1655ace1d | // { dg-do run }
// { dg-options "-fsanitize=return" }
#include <stdio.h>
struct S { S (); ~S (); };
S::S () {}
S::~S () {}
int
foo (int x)
{
S a;
{
S b;
if (x)
return 1;
}
}
int
main ()
{
fputs ("UBSAN TEST START\n", stderr);
foo (1);
foo (14);
fputs ("UBSAN TEST END\n", stderr);
}
... |
google | android | pr61272 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/ubsan/pr61272.C | 1,128 | utf_8 | 143b3900a6cd791bdac721a5bbc89957 | // PR sanitizer/61272
// { dg-do compile }
// { dg-options "-fsanitize=undefined -std=c++11" }
namespace std
{
template < typename _Tp > class allocator;
template < typename _Alloc > struct allocator_traits {
private:
template < typename _Tp > auto construct ( _Alloc & __a, _Tp * __p)-> // { dg-error "is p... |
google | android | const2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/const2.C | 379 | utf_8 | 65c0a747dff974d4f19eda6304e002f9 | // PR c++/3331: just because 'this' is readonly and bars[0].b is readonly
// doesn't mean that the result of the member reference is readonly.
struct foo
{
int a;
struct bar
{ int foo::* b ;};
static const bar bars[];
void bad ()
{
this->*(bars[0].b) = 42; // { dg-bogus "read-only" "" }
}
};
cons... |
google | android | error20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error20.C | 283 | utf_8 | 863caf5538f8d3b9435d82b33abd3d50 | // PR c++/34275
// { dg-do compile }
struct A // { dg-message "operator=|no known conversion" }
{
virtual A foo ();
};
void bar (A& a)
{
a.foo () = 0; // { dg-error "operand types are 'A' and 'int'" }
// { dg-message "candidate" "candidate note" { target *-*-* } 11 }
}
|
google | android | enum3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/enum3.C | 82 | utf_8 | 0067ce75ae387639a9f67e6ceb464f94 | // PR c++/53848
extern "C"
{
struct s {
enum {
e = 0
} f;
};
}
|
google | android | mmintrin | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/mmintrin.C | 102 | utf_8 | 688ada87fb447bcc4f314e612d65b84b | // { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-msse" }
#include <xmmintrin.h>
|
google | android | anon-union2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union2.C | 137 | utf_8 | a0196ebfddfdcb265613530b34c75302 | // PR c++/52915
struct S {
int val;
S(int v) : val(v) {}
};
void f() {
union { S a; }; // { dg-error "constructor|no match" }
}
|
google | android | large-size-array | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/large-size-array.C | 364 | utf_8 | 9273b23a9fe39abe84376e8c4b5847c5 | /* { dg-do compile } */
#include <limits.h>
#ifdef _WIN64
#define DIM ULLONG_MAX>>1
#else
#ifdef __LP64__
#define DIM UINT_MAX>>1
#else
#define DIM USHRT_MAX>>1
#endif
#endif
int
sub (int *a)
{
return a[0];
}
int
main (void)
{
int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */
return sub (&a... |
google | android | crash-10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/crash-10.C | 272 | utf_8 | 9c5998180b3fe539eb2b8de2217f48d6 | // Origin: PR c++/43327
// { dg-do compile }
template <typename _T>
struct A
{
template <int _N, int _M> struct B;
template <int _N>
struct B<_N, _T::m>
{
static void f();
};
};
struct C
{
static const int m = 4;
};
void m()
{
A<C>::B<1, 4>::f();
}
|
google | android | anon5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/anon5.C | 542 | utf_8 | 7d476dd9937f80ce401ec66ab9274c0a | // PR c++/34094
// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } }
// { dg-options "-g" }
// Ignore additional message on powerpc-ibm-aix
// { dg-prune-output "obtain more information" } */
namespace {
struct c
{
static const bool t = 0;
};
}
const bool &f()
{
return c::t; // { dg... |
google | android | vararg-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/vararg-2.C | 285 | utf_8 | 60563e69386b8a906233c2d479c02e6b | // { dg-do compile }
struct QString {};
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
QString & sprintf(QString &s,const QString &szFmt,...)
{
va_list list;
__builtin_va_start(list,((const char *)(&(szFmt))));
__builtin_va_end(list);
return s;
}
|
google | android | crash-8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/crash-8.C | 2,612 | utf_8 | aa54a0fbf159d1923c9a3b8630071cf6 | // Origin: PR c++/42797
// { dg-do compile { target c++11 } }
// { dg-options "-g -O2" }
template<typename _Tp, _Tp __v> struct integral_constant {
static const _Tp value = __v;
};
template<typename _Tp> _Tp declval();
template<typename _Tp, typename... _Args>
class __is_constructible_helper {
};
t... |
google | android | incomplete2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/incomplete2.C | 160 | utf_8 | 468830bf97b25deba68d737c1fdec540 | // PR c++/19963
// { dg-do compile }
struct A;
struct B
{
A a : 1; // { dg-error "incomplete" }
};
struct S
{
S : 1; // { dg-error "incomplete" }
};
|
google | android | pr42685 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr42685.C | 264 | utf_8 | bbe090ec74659e0ef5b2e8d1f6c4ddd5 | // { dg-do compile }
// { dg-options "-O -funroll-loops -fcompare-debug" }
// { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } }
void Remap(int n, int *src, int *dst, int *map)
{
do {
int i = *src;
if (i != 0) *dst = map[i];
} while (--n != 0);
}
|
google | android | macro-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/macro-1.C | 91 | utf_8 | a9c2bd4786300d7cf805e7ef57335a2c | /* { dg-do compile } */
short array[3] __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)));
|
google | android | pr59492 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr59492.C | 521 | utf_8 | ef2ab4aae234afefacfc233b4d897d81 | // { dg-do assemble { target { { i?86-*-* x86_64-*-* } && fpic } } }
// { dg-options "-mx32 -fPIC" }
// { dg-require-ifunc "" }
// { dg-require-effective-target maybe_x32 }
void
__throw_runtime_error(const char*) __attribute__((__noreturn__));
unsigned int
__attribute__ ((target("rdrnd")))
__x86_rdrand(void)
{
unsig... |
google | android | packed1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/packed1.C | 675 | utf_8 | 6be92beab52e0fd0c83b0cabc3f7e83a | // { dg-do run { xfail lm32-*-* } }
// NMS:2003-04-21 this fails on strict aligned architectures again,
// the patch was reverted because it broke something more important.
// WRS SPR 63496, lost packed attribute when accessing a packed
// field. This matters on aligned architectures like sh
struct thing { int m; };
st... |
google | android | abstract1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/abstract1.C | 1,650 | utf_8 | 6fee34d8b3b51c74ff33cdfe391ca591 | // { dg-do compile }
// Contributed by <giovannibajo at gcc dot gnu dot org>,
// <pavel_vozenilek at hotmail dot com>,
// <bangerth at dealii dot org>
// c++/9256: Make sure that a pointer to an array of abstract elements
// cannot be created, not even during template substitution (DR337)... |
google | android | pr42645-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr42645-1.C | 436 | utf_8 | a8acf41a97484b62691a92779ee9fc71 | // PR tree-optimization/42645
// { dg-do compile }
// { dg-options "-fcompare-debug -O1" }
extern void foo ();
struct S
{
struct T
{
int t1;
char t2[4];
T *t3;
} t;
int m1 () const { return t.t3[0].t1; }
char *m2 () { foo (); }
void m3 (int x) { char *m = m2 (); if (m1 () > 0 && x > 0); }
vo... |
google | android | incomplete3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/incomplete3.C | 94 | utf_8 | f917991e6dd65d861c6bb45ad931fe8c | //PR c++/28054
struct A;
struct B
{
friend A : 2; // { dg-error "incomplete type" }
};
|
google | android | anon-union | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/anon-union.C | 273 | utf_8 | e7bda64a0fd9d0057a48814a978e1851 | // { dg-do compile }
// { dg-options -O2 }
int foo ();
double bar (void)
{
union
{
char a[8];
double b;
};
a[0] = foo ();
a[1] = foo ();
a[2] = foo ();
a[3] = foo ();
a[4] = foo ();
a[5] = foo ();
a[6] = foo ();
a[7] = foo ();
return b;
}
|
google | android | static11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/static11.C | 511 | utf_8 | e789e85b8e83c35e7e483d4d892e55fd | // This is a copy of g++.old-deja/g++.pt/static11.C which at one
// time got a SEGV for mmix-knuth-mmixware when compiled with
// -da (or either -dj or -df).
// { dg-do compile }
// { dg-options "-da" }
extern "C" void _exit (int);
int r = 1;
struct A
{
void f(){};
A(){ ++r; }
~A(){ r -= 2; _exit (r); }
};
te... |
google | android | gc2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/gc2.C | 576 | utf_8 | bc5371eb8e8dcf79efb0889828991560 | // PR c++/12316
// { dg-do compile }
// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
inline void FOO() {}
template<typename> struct A
{
A() {}
~A() throw() {}
};
template<typename> struct B
{
static void foo();
static void bar() { foo(); }
};
struct C {};
template<typename> struc... |
google | android | do1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/do1.C | 265 | utf_8 | d3370c196d18a12979ef3db733309686 | // { dg-do compile }
// PR 7640. ICE.
void init ()
{
do { } while (0)
obj = 0; // { dg-error "expected|not declared" "" }
} |
google | android | canon-33194 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/canon-33194.C | 356 | utf_8 | 099265a43fd784d7e5904d87397cd678 | // PR c++/33194
void c_translate_location (
void (*fail) (
const char *fmt, ...)
__attribute__ ((noreturn,
format (printf, 1, 2)))
);
struct dwflpp
{
static void loc2c_error (const char *fmt, ...)
{
}
void
translate_location()
{
return c_transl... |
google | android | pr50212 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr50212.C | 272 | utf_8 | ac3ba0e4d0da02a871ab3d83b9cc0bf2 | // PR rtl-optimization/50212
// { dg-do compile }
// { dg-require-effective-target freorder }
// { dg-options "-O -fnon-call-exceptions -ftrapv -freorder-blocks-and-partition" }
void
foo (int n)
{
try
{
int i = 0;
while (i++ < n);
}
catch (...)
{
}
}
|
google | android | error5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error5.C | 389 | utf_8 | 67c2da88e21fcb076690a6d9b53b2d97 | // { dg-do compile }
// PR c++/11106: Error message gives partially mangled operator name
template <typename T> struct S {
struct I {};
};
template <typename T> struct S2 : S<T> {
using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" }
};
template struct S2<int>; // { dg-message "requi... |
google | android | error14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error14.C | 103 | utf_8 | 199a456577f88591ddb34aaf3dc0fce4 | //PR c++/26269
void foo()
{
i; // { dg-error "not declared in this scope" }
int i;
}
|
google | android | nontype-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/nontype-1.C | 196 | utf_8 | 36156b7bb0f0bbac69e3b368b3b7bb86 | template <class Op>
bool asfun(Op f,
Op::first_argument_type a, // { dg-error "not a type" }
Op::second_argument_type b) // { dg-error "not a type" }
{
return Op(a, b);
}
|
google | android | i386-9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/i386-9.C | 270 | utf_8 | a97214a6af5f7594b62fcb2dd5277097 | // PR target/48142
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-options "-Os -mpreferred-stack-boundary=5 -fstack-check -fno-omit-frame-pointer" }
int main()
{
try { throw 0; }
catch (...) {}
return 0;
} |
google | android | final1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/final1.C | 475 | utf_8 | c1d3e37e4ea9fc766eeaabd04c47a73b | /* Verify that final methods are devirtualized */
/* { dg-do compile { target c++11 } } */
/* { dg-options "-fdump-tree-original" } */
struct A final
{
virtual void foo ()
{
}
};
struct B
{
virtual void foo () final
{
}
};
void fun(A* a, B* b)
{
a->foo();
b->foo();
}
/* { dg-final { scan-tree-dump-... |
google | android | pragma-re-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pragma-re-2.C | 357 | utf_8 | bdec0c9208af6ee3a9ab1f2c07d3ba19 | /* { dg-final { scan-assembler "new_name" } } */
/* { dg-final { scan-assembler-not "old_name" } } */
#ifndef __PRAGMA_REDEFINE_EXTNAME
#error
#endif
extern "C" {
struct old_name { int i; };
#pragma redefine_extname old_name new_name
int old_name(void);
}
int foo(void)
{
return old_name();
} |
google | android | canon-37342 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/canon-37342.C | 242 | utf_8 | ec0bfdcd03b57cf0c62a78d8c06e0334 | class Asm;
template<typename _CharT> class basic_ostream;
typedef basic_ostream<char> ostream;
class Options {
typedef void (Asm::* emitfunc_t) (ostream &);
emitfunc_t getemit () const { return emitfunc; }
emitfunc_t emitfunc;
};
|
google | android | stdarg3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/stdarg3.C | 328 | utf_8 | 3a012636be5f21fd2b652c229102e118 | // { dg-options "-mlp64" { target "ia64-*-hpux*" } }
union U
{
void *m[7];
};
struct C;
void f(struct C *c, float f, union U, ...)
{ } |
google | android | pr33558 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr33558.C | 106 | utf_8 | 2bce0ecd468a573ab63f7d3a15c66bcf | /* { dg-do compile } */
class X {
mutable int &q; /* { dg-error "cannot be declared 'mutable'" } */
};
|
google | android | array1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/array1.C | 204 | utf_8 | ceb0c0d2e878f1b7898a912bfe02d365 | // Test typeid of multidimensional array with no bounds.
// { dg-do compile }
#include <typeinfo>
int main()
{
const char *s = typeid(double[][]).name(); // { dg-error "bounds|confused" }
return 0;
}
|
google | android | error3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error3.C | 198 | utf_8 | 3820027b29c821fc3271c5cd12393a28 | // Test for proper error message formatting; the throw() should go inside
// the parens, as below.
void (*g() throw())(); // { dg-error "g\\(\\) throw" "" }
void (*g())(); // { dg-error "" "" }
|
google | android | ellipsis1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/ellipsis1.C | 375 | utf_8 | 639bf05e0524c96ac92d1182ca1e6d91 | // PR c++/26291
// { dg-do compile }
struct A
{
A& operator= (A,...); // { dg-error "variable number of arguments" }
A operator+ (...); // { dg-error "variable number of arguments" }
operator int(...); // { dg-error "variable number of arguments" }
int operator() (...);
};
A operator- (A,...)... |
google | android | complex1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/complex1.C | 404 | utf_8 | b0eb29945f04721ade114ff6651768e8 | // PR middle-end/18882
// { dg-do run }
// { dg-options "" }
extern "C" void abort ();
struct C {
__complex__ long double c;
};
void foo()
{
C x = {2+2i};
int n = 1;
if (__imag__ y.c != 2)
abort ();
}
int main(void)
{
foo ();
return 0;
} |
google | android | friend5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/friend5.C | 158 | utf_8 | 72049c1dcfc100c2460af2d110eae2b1 | /* PR c++/32111 */
/* This used to ICE. */
/* { dg-do compile } */
struct A
{
friend A::~A() {} /* { dg-error "implicitly friends of their class" } */
};
|
google | android | error25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error25.C | 128 | utf_8 | 0d6d68d045e0c2ed1b27b9b14ec1b229 | // PR c++/35338
// { dg-options "" }
int i = 0r; // { dg-error "not supported" }
bool b = !0r; // { dg-error "not supported" }
|
google | android | access1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/access1.C | 418 | utf_8 | 1952aeb9951f8c72a9b8ee8487e2991b | // { dg-do compile }
// PR c++/5659. Failed to notice default accessed changed
class Foo;
struct Foo
{
static int m;
};
class Outer {
private:
class Inner;
Inner *i;
public:
void pub();
};
struct Outer::Inner {
Inner(int i);
};
void Outer::pub() { i = new Inner(Foo::m); } |
google | android | error19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error19.C | 100 | utf_8 | 711e0290c8826b0e1a3830f597efd7aa | // PR c++/33495
void foo()
{
if (({while(true);})) // { dg-error "forbids|<statement>" }
;
}
|
google | android | abstract2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/abstract2.C | 1,810 | utf_8 | f08d1e182d4573cda49da8f5afb8ba41 | // { dg-do compile }
// Contributed by Gabriel Dos Reis <gdr at integrable-solutions dot net>
// PR c++/2204: Check for parameters of abstract type in function declarations.
namespace N1 {
struct X;
struct Y1 {
void g(X parm1); // { dg-error "abstract" }
void g(X parm2[2]); // { dg-error "abs... |
google | android | PR23205 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/PR23205.C | 434 | utf_8 | 7decd264fd36128df6634651acc91338 | /* { dg-do compile } */
/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* nios2-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */
const int foobar = 4;
int foo ()
{
return foobar + 1;
}
int main()
{
... |
google | android | pr35504 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr35504.C | 2,468 | utf_8 | 0a4dec0aed98e1bcb431b3643ea74a56 | // { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
#define ATTR0 __attribute__((__regparm__(0)))
#define ATTR1 __attribute__((__regparm__(1)))
#define ATTR2 __attribute__((__regparm__(2)))
#define ATTR3 __attribute__((__regparm__(3)))
#define ATTR4 __attribute__((__fastcall__))
#define ATTR5 __attribute__... |
google | android | static2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/static2.C | 198 | utf_8 | 87d669ec0ea49c18545b3b5213df2b0b | //PR c++/26573
void foo()
{
struct A { static int i; }; // { dg-error "shall not have" }
}
template<typename T>
void bar()
{
struct B { static int j; }; // { dg-error "shall not have" }
}
|
google | android | synth1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/synth1.C | 502 | utf_8 | 9bae0d01ef429f94e58c536f39c9ca7b | struct PTR
{
PTR ();
PTR (PTR&);
PTR& operator= (PTR&);
private:
PTR (const PTR&);
PTR& operator= (const PTR&);
};
struct XYZ
{
XYZ (PTR& p) : ptr(p) {}
mutable PTR ptr;
};
XYZ f1 ();
XYZ f2 (void) { return f1(); }
void f3 (XYZ& dst, const XYZ& src) { dst = src; } |
google | android | offsetof5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/offsetof5.C | 361 | utf_8 | c8a0394ef8dd7e34c554d30357574798 | // PR c++/35741
// { dg-do compile }
#include <stddef.h>
struct A
{
char c;
int &i;
};
int j = offsetof (A, i); // { dg-warning "invalid access|offsetof" }
template <typename T>
struct S
{
T h;
T &i;
static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" }
};
int k = S<int>::j; ... |
google | android | friend2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/friend2.C | 378 | utf_8 | 73acd7749bd5e8d5aea359a56c89a202 | // { dg-do run }
// PR c++/12370
// Wrong code because of the friend declaration
template <typename T> struct A
{
T x;
A(T t) : x(t) {}
friend A<int> foo (const A<unsigned>&);
};
A<int> foo (const A<unsigned>& a)
{
A<int> res(a.x);
return res;
}
int main()
{
return foo(A<unsigned>(0)).x;
} |
google | android | error30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error30.C | 205 | utf_8 | 197cf0c2a0b5a9515fb727c846451d1e | // PR c++/35336
// { dg-do compile }
// { dg-bogus "not supported by" "" { target *-*-* } 0 }
struct A
{
int i : 2;
};
void foo (bool b)
{
A a;
(a.i || b) (); // { dg-error "cannot be used as" }
}
|
google | android | pr34435 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr34435.C | 337 | utf_8 | 47a370bdf6f3680e4929c23a0cdc94af | /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-msse2 -Wno-abi" } */
#include <emmintrin.h>
class Vec {
__m128i vec;
public:
Vec(int mm) {
vec = _mm_set1_epi16(mm);
}
operator __m128i() const {
return vec;
}
};
int main() {
_mm_shuffle_epi32(Vec(5), _MM_SHUF... |
google | android | crash-11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/crash-11.C | 324 | utf_8 | 5d8d774628229a306ab795223b7c191d | // Origin: PR c++/43327
// { dg-do compile }
template <typename _T>
struct A
{
template <int _N, int _M> struct B;
template <int _N>
struct B<_N, _T::m>
{
static void f();
};
};
struct C
{
static int m;
};
void m()
{
A<C>::B<1, 4>::f(); // { dg-error "incomplete type|not a valid" }
}
int C::m = ... |
google | android | darwin-cfstring1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/darwin-cfstring1.C | 874 | utf_8 | 3b677387cd5cf367fe538e8a673a0c0f | /* Test whether the __builtin__CFStringMakeConstantString
"function" fails gracefully when handed a non-constant
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-options "-ftrack-macro-expansion=0 -mconstant-cfstrings" } */
#include <CoreFoundation/CFString.h>
#ifdef __CONSTANT_CFSTRINGS__
#undef CFSTR
#defin... |
google | android | struct-va_list | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/struct-va_list.C | 101 | utf_8 | 5e0beb379071427ec23de04edb342301 | // { dg-do compile }
// PR target/13302
#include <stdarg.h>
struct NumArgState{
va_list ap;
};
|
google | android | pr40561 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr40561.C | 656 | utf_8 | 5c8c2604c08c57cb2c21770bf3b416bf | // { dg-do compile }
#include <set>
class SyAccess;
class VamsBase
{
public:
virtual ~VamsBase(void);
};
class VamsFnct : public VamsBase
{
public:
~VamsFnct(void);
std::set<SyAccess*> getNullDependencies(void) const
{ return std::set<SyAccess*>();
}
};
class VamsFnctSystem:public VamsFnct
{ public:
Vams... |
google | android | const1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/const1.C | 344 | utf_8 | cf0cdff2ec717c636d8a5441b2399c4a | // { dg-do compile }
// PR 335. Missed diagnostic
struct Foo
{
unsigned i;
void Modify(unsigned j) const;
};
void Foo::Modify(unsigned j) const
{
Foo::i = j; // { dg-error "assignment of member" "" }
} |
google | android | error29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error29.C | 661 | utf_8 | f6ef4e2724fa7ce062da94fa1778b050 | // PR c++/35334
// { dg-do compile }
// { dg-bogus "not supported by" "" { target *-*-* } 0 }
__complex__ unsigned int i;
int j;
char k;
__complex__ double l;
double m;
float n;
void
foo ()
{
((__complex__ int)i)(); // { dg-error "cannot be used as a function" }
((__complex__ int)j)(); // { dg-error "cannot be ... |
google | android | opaque-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/opaque-2.C | 391 | utf_8 | b4568481fda7d8fe66f09f6c78ec5fab | /* { dg-do compile } */
/* { dg-options "-mcpu=8540 -mspe -mabi=spe -mfloat-gprs=single" } */
/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
#define __vector __attribute__((vector_size(8)))
typedef float __vector __ev64_fs__;
__ev64_fs__ f;
__ev64_opaque__ o;
extern void bar (__ev6... |
google | android | init1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/init1.C | 386 | utf_8 | 9a179a157dcd020b51f28328ef6fa43d | // { dg-do compile }
// Bug 3154
class A {};
struct B : A
{
typedef A Parent;
B () : Parent () {}
};
class T
{
typedef int Foo;
T () : Foo () {} // { dg-error "T::Foo' is not" "" }
};
struct S : B
{
int Parent;
S () :Parent (1) {}
}; |
google | android | qual1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/qual1.C | 129 | utf_8 | c1ee7e4e5d2dfa36042c3417fffae465 | // PR c++/28257
// { dg-do compile }
struct A
{
int i;
void foo()
{
int A::i = i; // { dg-error "qualified" }
}
};
|
google | android | gc5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/gc5.C | 688 | utf_8 | 47195a1b7ad4c24c5ccc7cbf50e26bb0 | // PR c++/51852
// { dg-do compile { target c++11 } }
// { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0" }
template <typename, typename>
class transformed {};
template <class R, class F>
transformed<F, R> transform (R r, F f);
template <typename, typename>
class joined {};
template <typename T, t... |
google | android | pr55650 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr55650.C | 305 | utf_8 | b0b6f71b5ed6569f39d6b7acb7d497be | // PR gcov-profile/55650
// { dg-do link }
// { dg-require-profiling "-fprofile-generate" }
// { dg-options "-O2 -fprofile-generate" }
// { dg-additional-sources "pr55650.cc" }
struct A
{
virtual void foo ();
};
struct B : public A
{
B ();
void foo () {}
};
inline A *
bar ()
{
return new B;
}
|
google | android | offsetof4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/offsetof4.C | 380 | utf_8 | a23d17ae20fd87361daea5c89ea2bf18 | /* { dg-do compile } */
/* { dg-options "-Wno-invalid-offsetof" } */
struct X
{
X() : x(3), y(4) { }
int x, y;
};
typedef X* pX;
typedef __SIZE_TYPE__ size_t;
size_t yoff = size_t(&(pX(0)->y)); |
google | android | pr43631 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr43631.C | 302 | utf_8 | d1a876567d4315b25ada60d25ecbd98f | // PR middle-end/43631
// { dg-do compile }
// { dg-options "-g -O2" }
// { dg-additional-options "-mtune=atom" { target i?86-*-* x86_64-*-* } }
typedef void (*T) ();
struct S { T t; };
void bar (T) __attribute__ ((__noreturn__));
S *p;
void
foo ()
{
try { bar (p->t); } catch (...) { throw 1; }
}
|
google | android | crash-12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/crash-12.C | 323 | utf_8 | 37816617cea0cac04699c02e3a6eb9f4 | // Origin: PR c++/43953
template<typename T,
typename U,
typename T::type V> class bad;
// partial specialization
// for T = U
template<typename T, typename T::type V>
class bad<T, T, V>
{
public:
static void foo() {}
};
struct dummy
{
typedef int type;
};
int main()
{
bad<dummy, dummy, 0>::foo();
... |
google | android | error33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error33.C | 240 | utf_8 | dc99910fb2d0aaf7a5c4306f76bad987 | // Origin: PR c++/42218
// { dg-do compile }
template<int> struct A
{
template<int> struct B;
};
int i = A<0>::B<0>::X::Y; // { dg-error "'A<0>::B<0>::X' has not been declared" } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.