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 | init-ref4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/init-ref4.C | 371 | utf_8 | 3f1579f55c69e948c03b96707c703c8c | // PR c++/11384
// foo<int>::_S_something was not being emitted (as a weak definition).
// { dg-do run }
// { dg-require-weak "" }
template<typename T>
struct foo
{
static const T _S_something;
};
template<typename T>
const T foo<T>::_S_something = T();
int main()
{
const int* p = &foo<int>::_S_something... |
google | chromium | array9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array9.C | 92 | utf_8 | b1c2a3438d19ab4734ef026ce6aba7fa | struct T {
T ();
};
void f () {
T t[2];
for (int i = 0; i < 10; ++i);
int i = 0;
}
|
google | chromium | const6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const6.C | 317 | utf_8 | 1e8e9dc83b9cc3b9c04e15495abf5871 | // PR c++/36688
// { dg-do run }
// { dg-options "-O2" }
struct S
{
long long a;
long long b;
long long c;
};
struct T
{
S g;
long long h[12];
};
static const S s = { 1, 2, 3 };
static const T t = { s, 0 };
int
main ()
{
T x = t;
if (__builtin_memcmp (&x, &t, sizeof (T)))
__builtin_abort ();
}
|
google | chromium | ref3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref3.C | 156 | utf_8 | e21984c05c21d067e3b20b37c68bec76 | struct Base { };
struct Derived : public Base { };
struct Choose {
operator Base&();
operator Derived&();
};
void f()
{
Choose c;
Base& ref = c;
}
|
google | chromium | ref12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref12.C | 269 | utf_8 | b5056183793160d509fa082d596ab38f | // PR c++/17435
// { dg-do run }
extern "C" void abort ();
bool ok;
struct A
{
void func() const
{
ok = 1;
}
~A()
{
if (!ok)
abort ();
}
};
struct B : public A
{
};
int main()
{
A const& r1 = B();
r1.func();
}
|
google | chromium | value2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value2.C | 224 | utf_8 | a827a35dd447a4d79aa21373dc3c82c4 | // PR c++/35116
// Test that break_out_target_exprs works properly with complex
// value-initialization.
struct A
{
virtual void f ();
};
struct B
{
A a;
};
struct C
{
C (int, B = B());
};
void f ()
{
C c (4);
}
|
google | chromium | dtor2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/dtor2.C | 191 | utf_8 | aa6675ad7ca1b7ce6a63c598c59f89a0 | // { dg-do run }
extern "C" void abort ();
struct A
{
~A();
};
A::~A () {
abort ();
}
struct B
{
~B();
};
B::~B () {
if(true) return;
A a;
}
int main()
{
B b;
return 0;
}
|
google | chromium | pmf1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/pmf1.C | 424 | utf_8 | 19c721af2055386319b10ee94a3d6a81 | // PR c++/14089
// { dg-do compile }
//
// C++ front end generated assignment between types that were not
// compatible in any sense visible to the optimizers.
struct pair {
typedef void (pair::*fp)();
int first;
pair::fp second;
pair(const int& a, const pair::fp& b) : first(a), second(b) {}
void f... |
google | chromium | new8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new8.C | 300 | utf_8 | 9e9ce794649ccc9a4507b42cb8c4c0d0 | typedef __SIZE_TYPE__ size_t;
enum Refcount_Type {
NO_REFCOUNT
};
struct d0_Unknown_Object
{
void* operator new (size_t, size_t, Refcount_Type type);
void operator delete (void*, size_t, Refcount_Type);
d0_Unknown_Object ();
};
void make ()
{
new (10, NO_REFCOUNT) d0_Unknown_Object;
}
|
google | chromium | array23 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array23.C | 150 | utf_8 | 7d6986e89f73715409b343d7a3f5801a | // PR C++/29002
// We ICE trying to set the "zero" initializer on the incomplete
// array
struct A {A();int A::* t;};
A x[]; // { dg-error "size" }
|
google | chromium | ref10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref10.C | 166 | utf_8 | bf98e501c2009d025916bc7e43853c8e | // PR c++/13478
struct A {};
struct B : protected A {
B() {}
B(const A& ) {}
private:
B(const B& ) {}
};
void foo(const A* ap)
{
const B& br = *ap;
}
|
google | chromium | ref16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref16.C | 220 | utf_8 | f44963a0cd9c1736b28dd8d5a81a4a94 | // PR c++/35548
// { dg-do run }
int c;
struct A
{
A() { ++c; }
A(const A&) { ++c; }
~A() { --c; }
};
A f()
{
return A();
}
int i;
const A* ap;
int main()
{
const A& ar = i ? *ap : f();
return (c == 0);
}
|
google | chromium | error1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/error1.C | 96 | utf_8 | d96c72d34c6d21b23080cbea9c0dc6f1 | // PR c++/12696
struct A {
static float b[10];
}
float A::b[] = {1,2,3}; // { dg-error "" }
|
google | chromium | array16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array16.C | 1,817 | utf_8 | 6f7bdd6f37f73dd850e92e2a6e120e80 | // Causes timeout for the MMIX simulator on a 3GHz P4 and we can't
// have "compile" for some targets and "run" for others.
// { dg-do run { target { ! mmix-*-* } } }
// { dg-options "-mstructure-size-boundary=8" { target arm-*-* } }
// NOTE: This test assumes that 4M instances of struct ELT can fit into
// a 5MB... |
google | chromium | assign1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/assign1.C | 389 | utf_8 | 590b4fffc5e2d0c7af7852413ab82a9e | // PR c++/13009
// { dg-do run }
struct A {
char a;
};
struct B: public virtual A {
#if 0 // this piece of code works around the problem
B& operator= (const B& other)
{
A::operator= (other);
}
#endif
};
struct C: public B {
char c;
};
int main() {
B b;
b.a = 'b';
C c;
c.a = c.c = 'c';
... |
google | chromium | ptrmem1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrmem1.C | 91 | utf_8 | d92713305e498425e3152fff2c8acf2d | // PR c++/16853
struct A {};
struct B {};
int B::* b;
int A::* a = b; // { dg-error "" }
|
google | chromium | copy5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/copy5.C | 525 | utf_8 | 02c689a173b02b7312d282add8f14591 | // { dg-options "-O2" }
struct BOOL {
int nVal:1, bSet:1;
BOOL (int i) : nVal(i!=0), bSet(1) {}
};
struct Fill {
void *d;
Fill() : d(0) {}
Fill( const Fill& ) {}
};
struct SvMetaSlot {
Fill aGroupId;
BOOL a8;
SvMetaSlot() :
a8(1) {}
SvMetaSlot* MakeClone() const;
};
SvMetaSlo... |
google | chromium | ctor6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor6.C | 343 | utf_8 | ecc9c501210a7d0fcb63a6b4e75e71ee | // PR c++/21340
struct Base{};
struct Iterator : virtual Base {};
bool operator==(const Iterator&, const Iterator&);
struct IteratorI : Iterator {};
struct Obj
{
bool operator==(const Obj&) const;
};
template <int>bool dummy()
{
Obj lhs, rhs;
return lhs == rhs;
}
int
main(int argc, char** argv)
{
IteratorI* it... |
google | chromium | attrib1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/attrib1.C | 128 | utf_8 | 3eee77105967418a88d56f0c30243408 | // { dg-do run }
void f() __attribute((__constructor__));
int i;
void f() { i = 1; }
int main(int, char **)
{
return 1-i;
}
|
google | chromium | new16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new16.C | 640 | utf_8 | c52e42cacc9e8e4d847ceae5031544ca | // { dg-do run }
// { dg-options "-O2 -fstrict-aliasing" }
// Test that we don't let TBAA reorder an assignment across a
// placement new.
// See PR 29286.
typedef __SIZE_TYPE__ size_t;
inline void* operator new(size_t, void* __p) throw() { return __p; }
void __attribute__((noinline)) bar() {}
long __attribute__((... |
google | chromium | value5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value5.C | 229 | utf_8 | a07f29cc13922f46ee402c672bab1763 | // PR c++/38232
class base {
public:
base();
virtual ~base();
private:
int& int_ref; // initialized by base ctor, not visible here
};
class derived : public base {
};
base *make_derived() {
return new derived();
}
|
google | chromium | new18 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new18.C | 1,236 | utf_8 | 5ca2a958aa1a666bff61b9a21c413595 | // { dg-do compile }
// { dg-options "-O2 -fstrict-aliasing" }
// This caused an ICE during placement new.
namespace Pooma {
typedef int Context_t;
namespace Arch {
}
inline Context_t context() {
}
inline int contexts() {
}
}
template<class DomT, class T, class NewDom1T> struct DomainTraitsScalar ... |
google | chromium | array25 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array25.C | 665 | utf_8 | cd3850e151894462d2f417f022f58b7c | // related to PR c++/38233
// test for value-init of a member array
// { dg-do run }
struct elt
{
virtual void f();
char c;
};
void elt::f() { }
struct foo {
elt buffer[500];
foo() ;
bool check () const;
};
foo::foo ()
: buffer()
{}
bool foo::check () const
{
for (unsigned ix = sizeof (buffer)/ size... |
google | chromium | ctor7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor7.C | 497 | utf_8 | 2c3e5a9bb93285c3f11607173fad5f0e | // { dg-do run }
struct B
{
virtual void Foo ();
};
void B::Foo ()
{
}
struct D : virtual B
{
};
struct E
{
B *ptr;
E (B *);
};
static B *ptr;
E::E (B *ptr_)
:ptr (ptr_)
{
}
struct G : D, E
{
G ();
};
G::G ()
: E (this)
{
}
int main ()
{
G object;
return object.ptr != &object;
} |
google | chromium | array13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array13.C | 199 | utf_8 | d0bb03e714f655f56840d4e660ac77be | template <typename DisjointSet>
struct test_disjoint_set {
static void do_test()
{
unsigned int elts[]
= { 0, 1, 2, 3 };
const int N = sizeof(elts)/sizeof(*elts);
}
};
|
google | chromium | bitfield2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/bitfield2.C | 421 | utf_8 | f93344289d2f2663e5df449820c5dae4 | // PR c++/13371
// Bug: We were failing to properly protect the lhs on the line marked
// "here" from multiple evaluation.
// { dg-do run }
extern "C" int printf (const char *, ...);
enum E { E1, E2 };
struct A
{
E e : 8;
unsigned char c;
};
A ar[2];
int c;
int f()
{
++c;
printf ("f()\n");
return 0;
}
... |
google | chromium | brace2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/brace2.C | 289 | utf_8 | 3766a6e9088c3371c5da62da2dbbfd1a | // { dg-do compile }
// [dcl.init] paragraph 13.
int x = { 2 };
const char * y = { "hello" };
int a = 2;
int b = { 2,3 }; // { dg-error "requires one element in initializer" }
int c = { { 2 } } ; // { dg-error "braces around scalar initializer" }
int d = {}; // { dg-error "initializer" }
|
google | chromium | const4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/const4.C | 120 | utf_8 | 0ac36de7c095e58a6e1031bab57934e3 | // PR c++/27804
// { dg-do compile }
bool foo()
{
const int i = X; // { dg-error "not declared" }
return i > 0;
}
|
google | chromium | brace3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/brace3.C | 50 | utf_8 | c46d05cc9ceeb4d3a8a4d25cd908ba7a | int array[2][1] = { {0} {1} }; // { dg-error "" }
|
google | chromium | ref14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref14.C | 109 | utf_8 | 79847f23b4ac275a085b4cd88db8ff58 | // PR c++/33459
union A
{
int &i; // { dg-error "may not have reference type" }
};
void foo()
{
A();
}
|
google | chromium | enum1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/enum1.C | 166 | utf_8 | d5cf79bd277e32455485602b0608bbad | enum test {
acceptable = -1,
unacceptable = 0xffffffffffffffffLL
}; // { dg-error "" }
enum test t = acceptable, u = unacceptable;
int main() {
return 0;
}
|
google | chromium | pm1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/pm1.C | 1,382 | utf_8 | 17e13ddd2f4151d2809753d82ad732b3 | // { dg-do run }
// Contributed by Jason Merrill and Alexandre Oliva
// Test zero-initialization of pointers to data members. Their NULL
// value is represented with -1, not 0.
#include <stdlib.h>
struct A
{
int i;
};
int A::* gp;
typedef int A::* iApm;
iApm gp_zero = 0;
iApm gp_dflt = iApm();
iApm gp_cast = (iApm)0... |
google | chromium | array6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array6.C | 239 | utf_8 | 12f516d0ef7088644b46185bbd83ef4d | // { dg-do compile }
char arr [][4] = { "one", "two" };
const char arr2[][4] = { "one", "two" };
signed char arr3[][4] = { "one", "two" };
const unsigned char arr4[][4] = { "one", "two" };
volatile wchar_t arr5[][4] = { L"one", L"two" };
|
google | chromium | brace1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/brace1.C | 69 | utf_8 | a9c79959ed517bc5d72a6a5d41cbf16b | // { dg-do compile }
int i[4] = { { 3 } }; // { dg-error "brace" }
|
google | chromium | array18 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array18.C | 188 | utf_8 | 2010ab8cabd116e1c5704c568327ae76 | // PR c++/20142
// { dg-do run }
int n=4;
struct A
{
A() {}
A& operator= (const A&) { --n; return *this; }
};
struct B
{
A x[2][2];
};
int main()
{
B b;
b = b;
return n;
}
|
google | chromium | placement2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/placement2.C | 418 | utf_8 | 9c2843f3878e7468a19ecfaa90c8bf5f | // Bug: We were calling f() twice, for both the placement new and placement
// delete calls.
// { dg-do run }
void* operator new (__SIZE_TYPE__ sz, void*) { return operator new (sz); }
void operator delete (void* p, void*) { operator delete (p); }
struct A { A() { throw 1; } };
int c;
void *f() { ++c; r... |
google | chromium | array10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array10.C | 124 | utf_8 | 52be26e8b242500ae671c570de13a1a7 | // { dg-do compile }
// { dg-options "" }
typedef int __attribute__((vector_size (8))) vec;
vec foo[] = { (vec) {1, 2} };
|
google | chromium | array17 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/array17.C | 115 | utf_8 | bebae7e64d01c783fefaf2f358272230 | // { dg-do compile }
class StringMap {
const char empty_str[1];
public:
StringMap() : empty_str() {}
};
|
google | chromium | brace4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/brace4.C | 117 | utf_8 | fa25c5dda11ffc85ea36955456c3fbe8 | // PR c++/16859
// { dg-do compile }
// { dg-options "-pedantic" }
int a[] = { }; // { dg-error "zero-size array" }
|
google | chromium | global1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/global1.C | 338 | utf_8 | 4c0fd932ebbc4629dbb229edf363e946 | // PR c++/18416
class errarg {
enum { EMPTY } type;
public:
errarg();
};
extern errarg empty_errarg;
extern void errprint(const char *,
const errarg &arg1 = empty_errarg,
const errarg &arg2 = empty_errarg,
const errarg &arg3 = empty_errarg);
errarg::errarg() : type(EMPTY)
{
}
erra... |
google | chromium | ctor9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ctor9.C | 124 | utf_8 | c55d67e7ef83de8fc0fa30f01b68f5f7 | // PR c++/38427
// { dg-do compile }
struct S
{
int &ref;
S() : ref() {}; // { dg-error "value-initialization of" }
};
|
google | chromium | new5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new5.C | 276 | utf_8 | 30174c9a71d3d8e0fb35b9556abdea15 | // { dg-do run }
#include <new>
void * operator new[](size_t, std::nothrow_t const &) throw()
{ return NULL; }
struct X {
struct Inner { ~Inner() {} };
X() {
Inner * ic = new (std::nothrow) Inner[1]; // SegFault here
}
};
int main() {
X table;
}
|
google | chromium | empty1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/empty1.C | 575 | utf_8 | d2ea13322f402d3ce506a9a1106ee836 | // { dg-do run }
// padding. Which clobbers whatever they overlay.
class EmptyBase0 {};
class EmptyBase1 : public EmptyBase0 {};
class Base1
{
public:
unsigned int t_;
Base1(unsigned int t) : t_(t) {}
};
class PEPE : public Base1, public EmptyBase1
{
public:
PEPE(unsigned int t)
: Base1(t), EmptyBase1(EmptyBase1()) {... |
google | chromium | new21 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new21.C | 134 | utf_8 | c9a8d831104ecec8c5233bd81e720061 | // PR c++/32251
struct A {
A();
void operator delete(void *, ...);
};
void foo () {
new A; // { dg-warning "deallocation" }
}
|
google | chromium | addr-const1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/addr-const1.C | 714 | utf_8 | 835b43db313003f4551ea74731f1362c | // { dg-do run }
// PR 9881. address-constant-expression not static initialized
struct bar {
double p;
}; // bar
bar v;
static bool error = false;
struct foo {
static double *a;
static double *b;
static double storage;
};
struct baz {
baz () {
if (foo::a != &v.p)
error = true;
if (foo::b !=... |
google | chromium | value3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/value3.C | 541 | utf_8 | f5892df2ecb52226b652c40258f42f73 | // Testcase for value-initialization in new-expressions.
// { dg-do run }
#include <stdlib.h>
#include <string.h>
// Make sure that we return memory that isn't already set to 0.
void *operator new(size_t s)
{
void *p = malloc (s);
memset (p, 42, s);
return p;
}
struct A { A() {} ~A() {} };
struct B { A a; int ... |
google | chromium | ref6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ref6.C | 106 | utf_8 | f75e860b2c4af1d147a082d96b6d7806 | struct B {
void g() { }
};
struct A {
void f() {
B &b = b;
b.g();
}
};
int main(void) { }
|
google | chromium | ptrfn1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/ptrfn1.C | 148 | utf_8 | 697d82f637fb8839d98efadd58ededf5 | // PR c++/29016
// { dg-options "-O2" }
class A;
class B
{
typedef void (*C[5]) (A *);
static C D;
static void E (A*) {}
};
B::C B::D={E};
|
google | chromium | reference1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/reference1.C | 249 | utf_8 | 14fd5d851c700287b535c91b481fe0cf | // { dg-do compile }
// This code used to be accepted but it is invalid as there is no
// value initialization of a reference type.
// PR c++/36695
int main()
{
typedef int& T;
T a = T(); // { dg-error "value-initialization of reference" }
}
|
google | chromium | new19 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/new19.C | 1,253 | utf_8 | 2e14de5f82a334a88354de9073763969 | // { dg-do compile }
// { dg-options "-O2 -fstrict-aliasing -fdump-tree-pre-details" }
// Make sure we hoist invariants out of the loop even in the presence
// of placement new. This is similar to code in tramp3d.
typedef __SIZE_TYPE__ size_t;
inline void* operator new(size_t, void* __p) throw() { return __p; }
te... |
google | chromium | enum2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/init/enum2.C | 104 | utf_8 | ca9a6dc8d27f3cf82314cfcd92133441 | #include <limits.h>
enum test {
z = 0,
c = UINT_MAX + 1LL
} x = z;
int main() {
return x != z;
}
|
google | chromium | dr127 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr127.C | 582 | utf_8 | 3592a0b845ee849a03440c75d39ae12b | // { dg-do link }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR127: Ambiguity in description of matching deallocation function
#include <cstddef>
#include <new>
struct A
{
// placement new, but can be called through normal new syntax.
void* operator new(std::size_t size, float = 0.0f)
{
... |
google | chromium | dr48 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr48.C | 227 | utf_8 | 9c539eaced56bf5f6dfcc87de03577a2 | // { dg-do link }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR48: Definitions of unused static members
struct A {
static const int size = 10;
int array[size];
};
int main() {
A a;
return 0;
}
|
google | chromium | dr108 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr108.C | 355 | utf_8 | 86960e6cb501196eef5cc23d207d7473 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR108: Are classes nested in templates dependent?
template <class T> struct S {
struct I1 {
typedef int X;
};
struct I2 : public I1 {
X x; // { dg-error "does not name a type" "name" }
// { dg-message "note" "n... |
google | chromium | dr193 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr193.C | 784 | utf_8 | 95dff81e87b633f2db332adf927b41fb | // { dg-do run }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR193: Order of destruction of local automatics of destructor
extern "C" void abort(void);
namespace N1 {
bool a_done = false;
struct A
{
~A()
{
a_done = true;
}
};
struct B
{
~B()
{
if (... |
google | chromium | dr68 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr68.C | 306 | utf_8 | 6a9b2ff3865ebd4b9b4a24ea9e5fa1e0 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR68: Grammar does not allow "friend class A<int>;"
namespace A{
class B{};
}
namespace B{
class A{};
class C{
friend class ::A::B;
};
}
template <typename> class K;
class J {
friend class K<int>;
};
|
google | chromium | dr52 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr52.C | 504 | utf_8 | be0dd419c395588111addfd87e31b3fe | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR52: Non-static members, member selection and access checking
struct A
{
void foo(void);
};
struct B
{
private:
void foo(void);
};
struct B1 : B {};
struct B2 : B {};
struct C
{ // { dg-error "C" }
void foo(void);
};
str... |
google | chromium | dr194 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr194.C | 239 | utf_8 | 11d8e489cc200e109dbdfe58fd9c1fcf | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR194: Identifying constructors
struct A
{
inline explicit A();
};
template <class>
struct B
{
inline explicit B();
};
template struct B<void>;
|
google | chromium | dr176 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr176.C | 927 | utf_8 | e179dfb3000fb9a0d490d2ace3e1f74b | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR176: Name injection and templates
namespace N1 {
template <class T> struct Base {
Base* p;
Base<T*>* p2;
::Base* p3; // { dg-error "" "" }
};
template <class T> struct Derived: public Base<T> {
Base* p; ... |
google | chromium | dr74 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr74.C | 198 | utf_8 | 99fbd5404170a32ec3b81a4c87114aa9 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR74: Enumeration value in direct-new-declarator
struct A {};
enum E1 { COUNT = 10 };
A* a = new A[COUNT];
|
google | chromium | dr142 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr142.C | 810 | utf_8 | a6d46728c39c24256b63197af59b95f1 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR142: Injection-related errors in access example
class B { // { dg-error "inaccessible" }
public:
int mi; // { dg-error "inaccessible" }
static int si; // { dg-error "inaccessible" }
};... |
google | chromium | dr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr1.C | 426 | utf_8 | f660af37e71a300b94fc53e6bc686185 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR1: What if two using-declarations refer to the same function but the
// declarations introduce different default-arguments?
namespace A {
extern "C" void f(int = 5);
}
namespace B {
extern "C" void f(int = 5);
}
using... |
google | chromium | dr94 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr94.C | 209 | utf_8 | 2b6b832186c8ccf57001b2888f9dec54 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR94: Inconsistencies in the descriptions of constant expressions
struct S {
static const int c = 5;
};
int a[S::c];
|
google | chromium | dr128 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr128.C | 325 | utf_8 | 1b0c9fccd7b07ffc338e9e9ca4dbb8c0 | // { dg-do run }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR128: Casting between enum types
extern "C" void abort(void);
enum E1 { BLACK = 0, RED = 1 };
enum E2 { WHITE = 0, YELLOW = 1};
int main(void)
{
E1 e1 = RED;
E2 e2 = static_cast<E2>(e1);
if (e2 != YELLOW)
abort();
return ... |
google | chromium | dr185 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr185.C | 489 | utf_8 | 9704d0caf0975b804de4cf5a0218a1db | // { dg-do run }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR185: "Named" temporaries and copy elision
extern "C" void abort(void);
struct A {
mutable int value;
explicit A(int i) : value(i) {}
void mutate(int i) const { value = i; }
};
int foo() {
A const& t = A(1);
A n(t); ... |
google | chromium | dr20 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr20.C | 479 | utf_8 | 0af12371ac925505bc0a0b0b9c2aa770 | // { dg-do run }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR20: Some clarifications needed for 12.8 para 15
extern "C" void printf(const char*, ...);
extern "C" void abort(void);
int count = 0;
class Thing {
public:
Thing() {
}
~Thing() {
}
Thing(const Thing&)
{
count += 1;
... |
google | chromium | dr213 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr213.C | 493 | utf_8 | d977774c3077096cafa3fa932589f6e7 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR213: Lookup in dependent base classes
// We should emit an error at *instantiation* time because g(t) can't be
// resolved to any function.
template <class T> struct A : T {
void h(T t) {
f(t);
g(t); // { dg-error ... |
google | chromium | dr164 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr164.C | 244 | utf_8 | 3e61e5bdc2b1492780331f39f942586f | // { dg-do link }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR164: Overlap between Koenig and normal lookup
void f(int);
template <class T> void g(T t) {
f(t);
}
enum E { e };
void f(E) {}
int main() {
g(e);
}
|
google | chromium | dr188 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr188.C | 271 | utf_8 | 007afeacb36d4756871511f3e7e8ea6f | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR188: Comma operator and rvalue conversion
template <bool> struct StaticAssert;
template <> struct StaticAssert<true> {};
char arr[100];
StaticAssert<(sizeof(0,arr) == 100)> check;
|
google | chromium | dr90 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr90.C | 310 | utf_8 | bf475bf32acceb9eb23c5b5b7013f7fe | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR90: Should the enclosing class be an "associated class" too?
struct A {
union U {};
friend void f(U);
};
struct B {
struct S {};
friend void f(S);
};
int main() {
A::U u;
f(u);
B::S s;
f(s);
}
|
google | chromium | dr85 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr85.C | 255 | utf_8 | c241bed1d85ccf57402c8efd46ab9b8c | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR85: Redeclaration of member class
struct Base {
struct Data {};
struct Data; // { dg-error "" "redeclaration of nested class is invalid" { xfail *-*-* } }
};
|
google | chromium | dr147 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr147.C | 869 | utf_8 | f7329311a5df0c534f2191fee7f45ea7 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR147: Naming the constructor (PR 11764)
namespace N1 {
struct A { A(); };
struct B: public A { B(); };
A::A() { }
B::B() { }
B::A ba;
A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup... |
google | chromium | dr159 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr159.C | 234 | utf_8 | 9b56ad73b780b825e0de60463c83386f | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR159: Namespace qualification in declarators
namespace N {
namespace M {
void f();
void g();
}
void M::f(){}
void N::M::g(){}
}
|
google | chromium | dr135 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr135.C | 352 | utf_8 | 0af74303a4251b24669c368429e4af91 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR135: Class type in in-class member function definitions
struct S {
S f() { return S(); } // { dg-bogus "" "incomplete class type is allowed as return type" }
void g(S) { } // { dg-bogus "" "incomplete class type is ... |
google | chromium | dr101 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr101.C | 924 | utf_8 | 5c0ee940a92afc5a19fdf637a6f77f77 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR101: Redeclaration of extern "C" names via using-declarations
namespace Test1 {
typedef unsigned int X;
extern "C" void f1();
namespace N {
typedef unsigned int X;
extern "C" void f1();
}
using N::f1; // { dg-b... |
google | chromium | dr166 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr166.C | 1,528 | utf_8 | 64c96091c33ef2b839f05e0eee8352a6 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR166: Friend declarations of template-ids
namespace N {
template <class T> void f(T);
void g();
namespace M {
class A {
friend void f<int>(int); // N::f
static int x; // { dg-error "private" }
};
... |
google | chromium | dr76 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr76.C | 252 | utf_8 | 4dd95811a9583fd5b2412c2c99d7dff9 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR76: Are const volatile variables considered "constant expressions"?
volatile const int a = 5;
template <int> struct K;
template struct K<a>; // { dg-error "" }
|
google | chromium | dr49 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr49.C | 590 | utf_8 | 2d505ce906bacb84abf98000ee1f70ad | // { dg-do compile }
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR 49: Non-constant pointers are invalid template arguments.
template<int *a> struct R { /* ... */ };
template<int b[5]> struct S { /* ... */ };
int p;
template struct R<&p>; // OK
template struct S<&p>; // OK due to parame... |
google | chromium | dr137 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr137.C | 300 | utf_8 | a6b204a1733f1ef91a83ebba5d3a48be | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR137: static_cast of cv void*
struct A;
const void* v;
void foo(void)
{
(void)static_cast<const volatile A *>(v);
(void)static_cast<A *>(v); // { dg-error "" "static_cast cannot remove cv qualifiers" }
}
|
google | chromium | dr161 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr161.C | 649 | utf_8 | 62aa8921c6705fdab59b10a7be7f39b9 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR161: Access to protected nested type
namespace N1 {
struct A
{
protected:
typedef int type;
};
struct B : public A
{
void test(void)
{
A::type t;
}
friend void ftest(void)
{
A::t... |
google | chromium | dr80 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr80.C | 717 | utf_8 | fddf6e4104e367506b1483b55a539b63 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR80: Class members with same name as class
struct A
{
int A;
};
struct A2
{
static int A2; // { dg-error "same name as" }
};
template <class>
struct A3
{
int A3;
};
template <class>
struct A4
{
static int A4; // { d... |
google | chromium | dr179 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr179.C | 291 | utf_8 | 54a7e43eb51f59e7eae694e23b7ef1f6 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR179: Function pointers and subtraction
void foo(void);
typedef void (*fp)(void);
int main()
{
fp f1 = foo;
fp f2 = foo;
(void)f2-f1; // { dg-error "" "cannot subtract pointers to function" }
}
|
google | chromium | dr152 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr152.C | 812 | utf_8 | bb48e48323c8867bb64bcf1613c4198c | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR152: explicit copy constructors
namespace N1 {
struct X {
X(); // { dg-message "candidate" }
explicit X(const X&);
};
void f(X);
int foo()
{
X x;
f(x); // { dg-error "matching" "matching" }
... |
google | chromium | dr217 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/tc1/dr217.C | 431 | utf_8 | d227f60fa4be5b52028628722cfa4992 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR217: Default arguments for non-template member functions of class
// templates
template <class T>
struct S
{
void foo (int);
};
template <class T>
void S<T>::foo (int = 0) // { dg-error "" "default arguments for parameters ... |
google | chromium | pr39447 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/graphite/pr39447.C | 930 | utf_8 | 5c6a1178f4fd620e8792644c534c29f8 | /* { dg-options "-O2 -fgraphite-identity" } */
struct Point
{
int line, col;
Point( int l = -1, int c = 0 ) throw() : line( l ), col( c ) {}
bool operator==( const Point & p ) const throw()
{ return ( line == p.line && col == p.col ); }
bool operator<( const Point & p ) const throw()
{ return ( line < p.l... |
google | chromium | scope1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/scope1.C | 125 | utf_8 | 1bd540977a3ebf0e74db36e595b11998 | // PR c++/9868
template <typename T> struct D {
void (*p)();
void clear() {
D::p();
}
};
template class D<bool>;
|
google | chromium | addr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/addr1.C | 713 | utf_8 | 31a1eb67025f875651678e52a1e2b3d1 | // { dg-do run }
// PR c++/11788 we failed to instantiate a decl, and we lost some side
// effects
static int flag = 0;
template <typename> struct A
{
A &active () { flag++;}
static void foo() {}
static void bar () {}
static void bar (int) {}
int m;
};
void (*baz ()) ()
{
A<int> a;
return &a.activ... |
google | chromium | template3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/template3.C | 351 | utf_8 | 77913297a13e3346eae87df8ebe54edd | // PR c++/33962
// { dg-do compile }
template <class T> struct A;
template <class U> void foo (const U &x, ...);
template <class T> void foo (const A<T> &x, ...);
void bar (const A<int> &x, const char *y)
{
foo (x, y);
}
/* { dg-final { scan-assembler "_Z3fooIiEvRK1AIT_Ez" } } */
/* { dg-final { scan-assembler-no... |
google | chromium | arg5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/arg5.C | 285 | utf_8 | 2462790168c7dfd3a860d6ca77ecec30 | // PR c++/34111
class QChar
{
};
struct QString
{
QString(QChar);
};
struct QPainter
{
void drawText (int x, int y, const QString &);
};
class KHEChar:public QChar
{
public:KHEChar (QChar C);
};
void
drawByte (QPainter * P, char, KHEChar B)
{
P->drawText (0, 0, B);
}
|
google | chromium | defarg1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/defarg1.C | 131 | utf_8 | ea18be6006253439171100a797457d19 | // PR c++/5247
template<typename T>
int foo (T t, int = foo(T()));
int main()
{
foo(0); // { dg-error "default argument" }
}
|
google | chromium | member1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/member1.C | 399 | utf_8 | 53b4a1648421c533b9cf26423d529dc0 | // { dg-do compile }
struct X
{
template<typename T> static void ProcessProxy ();
typedef void (*Callback) ();
void Process (Callback);
template<typename T> void Process ()
{
Process (&ProcessProxy<T>);
}
};
void foo (X *x)
{
x->Process<int> ();
} |
google | chromium | builtin3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/builtin3.C | 164 | utf_8 | 63766fb1bce3bab4ad17a59d07a272d2 | // PR c++/11409
// { dg-do compile }
namespace std {
double fabs (double);
}
using std::fabs;
double (*p) (double) = &fabs; // { dg-bogus "is ambiguous" "" }
|
google | chromium | error2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/error2.C | 308 | utf_8 | e4753bb05dc59e57b5bb60b1877f1fc1 | struct A
{
void foo(); // { dg-error "with" "" }
virtual void foo(); // { dg-error "cannot be overloaded" "" }
}; |
google | chromium | template4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/template4.C | 550 | utf_8 | 4a724efa9bb6d5005a24e826a9126745 | // PR c++/35986
// { dg-do compile }
namespace
{
template <int> void foo (...); // { dg-message "foo" }
template <int> void bar (int, ...); // { dg-message "bar" }
void baz (...); // { dg-message "baz" }
}
template <int> void foo (...); // { dg-message "candidate" }
template <int> void bar (int, ...); // { d... |
google | chromium | ambig2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/ambig2.C | 562 | utf_8 | ea3127f4b42d821f844905a93809eb92 | // Bug: g++ thought that the QChar overload was a viable but ambiguous
// candidate. It isn't viable, because there's no conversion from const
// char * to QChar.
class QChar {
public:
QChar( char c );
QChar( unsigned char c );
};
class QString
{
public:
QString( const char *str ); // dee... |
google | chromium | rvalue1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/rvalue1.C | 168 | utf_8 | 14e68b07c04d0b27c8221cd9eeab2703 | // PR c++/42655
void unused(const bool &) { }
int main() {
volatile bool x = false;
unused(!!x); // type of "!x" is bool
unused(!x); // type of "!x" is bool
}
|
google | chromium | builtin2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/builtin2.C | 128 | utf_8 | 3a79826fd499e94593a88f2c06436f3d | namespace __gnu_cxx {
void llabs(long long x);
}
namespace std {
using __gnu_cxx::llabs;
using __gnu_cxx::llabs;
}
|
google | chromium | autoptr1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/autoptr1.C | 381 | utf_8 | 1e41ec11ca00276315dd010f205f9f90 | // PR c++/35773
template< typename T >
class auto_ptr
{
struct auto_ptr_ref { };
public:
auto_ptr(auto_ptr&);
auto_ptr(auto_ptr_ref);
operator auto_ptr_ref();
};
template< typename T >
class reference_wrapper
{
public:
reference_wrapper(T& t);
operator T& () const;
};
struct X { };
void f(auto_ptr< X >... |
google | chromium | arg4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/arg4.C | 382 | utf_8 | 494fd275c1d67e2ced55a80500cbedec | // { dg-do compile }
struct A {};
struct B : A
{
B(int);
B(B&);
B(A);
};
struct C
{
operator B () const;
};
void foo(B);
void bar()
{
C c; |
google | chromium | defarg4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/overload/defarg4.C | 377 | utf_8 | 2a8cf95dfdf16960faebf74cc649807b | // Origin PR c++/39987
// { dg-do "compile" }
class foo
{
template<typename U>
static bool func(const U& x)
{}
public:
template<typename U>
unsigned int Find(const U& x, bool (*pFunc) (const U&) = func) const
{}
};
class bar {
bool Initialize();
protected:
foo b;
};
bool bar::Initialize()
{
b.Find(b);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.