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
redecl2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/redecl2.C
263
utf_8
fa56113db0f4a64e5dd4543612cc1522
// PR c++/17816 // We failed to report duplicate definitions of pure virtual ns. // { dg-do compile } struct S { virtual int foo() = 0; }; int S::foo() { return 0; } // { dg-message "defined here" } int S::foo() { return 0; } // { dg-error "redefinition" }
google
android
final2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/final2.C
901
utf_8
85c6eb809c2332857df183d42a6c4cbe
// PR c++/53186 // { dg-do compile { target c++11 } } // { dg-options "-fdump-tree-original" } struct F1 { virtual void operator()() final; virtual operator int() final; virtual int operator++() final; }; struct F2 final { virtual void operator()(); virtual operator int(); virtual int operator++(); }; v...
google
android
constref2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/constref2.C
346
utf_8
192c9dfdcc513ccf5362da483582b639
// { dg-do compile } // Make sure that we can pass a cast-expression as an argument that's // passed to a function template by const reference. template <class T> void bar (const T&) { } void foo (int x) { bar ((long) x); }
google
android
i386-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/i386-4.C
939
utf_8
a4ad4c2cb3c1448496351241a77aedb7
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O1 -msse2" } */ #include <xmmintrin.h> void ConvertFloatSSE (void *inBuff, void *outBuff, int len) { unsigned char *inByteBuffer = reinterpret_cast < unsigned char *>(inBuff); float *outFloatBuffer = reinterpret_cast < float *>(outBuff); ...
google
android
error28
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/error28.C
113
utf_8
d91ba71ee2c4033b63d3e9313ca87d20
// PR c++/35987 // { dg-do compile } void foo (char *p) { if (++p = true); // { dg-error "cannot convert" } }
google
android
pr50464
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr50464.C
4,379
utf_8
36a8c3554403443884b8a9901e71ac7e
// { dg-do compile { target i?86-*-* x86_64-*-* } } // { dg-options "-O3 -mxop" } typedef long unsigned int size_t; typedef unsigned long ulong_t; typedef signed long slong_t; template<typename _Iterator> struct iterator_traits { typedef typename _Iterator::reference reference; }; template<type...
google
android
crash-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/crash-4.C
805
utf_8
a948c138cf787909077fd994ee9ec3e1
// NOTE: This test assumes packed structure layout differs from unpacked // structure layout. This isn't true, e.g., with the default // arm-none-elf options. // { dg-options "-mstructure-size-boundary=8" { target arm*-*-* } } struct a { int m; a(const a&); }; struct b // { dg-error "cannot bind packed...
google
android
anon4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/anon4.C
162
utf_8
735bc52cab8eca56a711c2c10845c981
// PR c++/27951 // { dg-do compile } void foo() { int i; // { dg-message "previously" } union { int i; }; // { dg-error "redeclaration" } }
google
android
pr20366
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr20366.C
3,164
utf_8
f43f96bf3c378817b959c22aee3466c0
// Test fix for PR20366 // // { dg-do compile { target *-*-aix* } } // { dg-options "-D_LARGE_FILES" } // // cstdio includes stdio.h and undefs most of the functions declared // therein, unfortunately this means that #define fopen fopen64 goes // away. This tests the fix, and ensures that with -D_LARGE_FILES // fopen...
google
android
profile1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/profile1.C
1,302
utf_8
f804e6064a0c7cd94d73f58ba8f6e5e0
// PR 11767 // { dg-do run } // { dg-require-profiling "" } // { dg-options "-fnon-call-exceptions -fprofile-arcs" } #include <string> typedef unsigned long ACE_UINT32; extern "C" void abort(); static ACE_UINT32 const msc_maxCurrencyID = 9999; class ResourceBalanceType2 { public: explicit ResourceBalanceType2(...
google
android
pr28304
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr28304.C
197
utf_8
de07ec93dc9f688d2fe2f33f07228d16
// Test to make sure we do not ICE on this invalid program. struct A {}; template<typename T> void A::foo(T) {} // { dg-error "" } void bar() { A::foo(1); // { dg-error "not a member" } }
google
android
ptrmem9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/ptrmem9.C
123
utf_8
1de8f2214cf4c9be9f9f9033866976fb
// PR c++/33969 // { dg-do compile } struct A; void (*A::* fp)() const; // { dg-error "invalid in variable declaration" }
google
android
bitfield1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/bitfield1.C
87
utf_8
f4cf136163ee3fd615e4a9643520781f
// { dg-options "-w" } union u1 { char m1 : 16; } x; int main () { x.m1 = 256; }
google
android
pr49133
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/other/pr49133.C
812
utf_8
bbfdbf39dac3f32203388a2dad06f24a
/* { dg-do run { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -msse2" } */ /* { dg-require-effective-target sse2_runtime } */ #include <xmmintrin.h> extern "C" void abort (); typedef double double_a __attribute__((__may_alias__)); struct V { __m128d data; }; int main() { V a; __m128d b; b = _mm_...
google
android
const2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/const2.C
141
utf_8
cd42b5b37923de04f2f1d946dfbd433c
struct B {}; struct D : public B {}; typedef int B::*bm; typedef int D::*dm; bm bp; void f() { const_cast<dm>(bp); // { dg-error "" } }
google
android
bitfield6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield6.C
126
utf_8
3ab5d3b674f60cdf43355937cdc5e7ba
// PR c++/27471 struct A { unsigned a:8; }; extern void b(unsigned char); void breakme (A f) { b((unsigned char) f.a); }
google
android
self1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/self1.C
131
utf_8
9f33237b06a0754b17722be2e4ac5adf
// PR c++/31419 struct B { template<typename T> operator T const& () const { return 42; } }; B f() { return B(); }
google
android
bitfield5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield5.C
220
utf_8
5b834a111d6345f96efbf3c3d5bdaa5e
// PR c++/27506 enum EBorderStyle { BNATIVE, BHIDDEN }; struct BorderValue { enum EBorderStyle style:8; }; enum EBorderStyle f(const struct BorderValue *border) { return border ? border->style : BNATIVE; }
google
android
ambig2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ambig2.C
345
utf_8
65bec450f1ba3239f73319431b72958b
// PR c++/57948 struct Base { }; struct Derived : Base { struct Derived2 : Base { struct ConvertibleToBothDerivedRef { operator Derived&(); operator Derived2&(); void bind_lvalue_to_conv_lvalue_ambig(ConvertibleToBothDerivedRef both) { Base &br1 = both; // { dg-error "ambiguous" ...
google
android
op6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op6.C
358
utf_8
a8c7731865b3dd81b8ffe44b8b058d57
// Origin: PR c++/42766 // { dg-do compile } template<class T> class smart_pointer { public: operator T* () const { } operator bool () const { } operator bool () { } }; class Context { }; typedef smart_pointer<Context> ContextP; class SvnClient { ~SvnClient(); ContextP svnContext; }; SvnClient::~S...
google
android
cast1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cast1.C
361
utf_8
8fd4aac31847c0c9e16276ac87169301
// PR c++/10841 int main() { class Base { public: int i, j, k; void f(); }; class Derived : private Base { public: int m, n, p; void g(); }; Derived derived; Base &base = (Base &)derived; (int Base::*)&Derived::n; (int Derived::*)&Base::j; (void (Base::*)(void))&Derived::g;...
google
android
simd3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/simd3.C
530
utf_8
68a160a4b068da5d72e23fb674936f97
/* { dg-do compile } */ typedef int myint; float __attribute__((vector_size(16))) b; int __attribute__((vector_size(16))) d; myint __attribute__((vector_size(16))) d2; unsigned int __attribute__((vector_size(16))) e; void foo() { b + d; /* { dg-error "invalid operands to binary" } */ d += e; /* { dg-message "use -...
google
android
cast3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cast3.C
116
utf_8
85057e8349eba6c79b74fe4e51024339
// Origin: PR c++/46824 class Incomplete; struct Ptr { operator Incomplete*(); }; int main() { Ptr p; *p; }
google
android
access1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/access1.C
294
utf_8
f0aed431ce3357281e21fdd3e10a7644
// PR c++/38579 struct P { protected: P() {} P(const P&) {} }; struct B : protected P { B() {} }; struct C : public P { // C can access P's copy ctor, but can't convert b to const P&. C(const B& b) : P(b) {} // { dg-error "inaccessible base" } }; void foo() { B b; C c(b); }
google
android
cond4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cond4.C
458
utf_8
77ace45cd5e111b4a9ba8fb6c6867e95
// Origin: PR c++/45383 // { dg-do run } struct null { null() {} template<class T> operator T*() const { return 0; } template<class C, class T> operator T C::*() const { return 0; } private: null(const null&); null& operator=(const null&); void operator&() const; }; st...
google
android
ref1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ref1.C
101
utf_8
53724dc0cd699d864fc77299b7051204
// PR c++/60345 struct C {}; struct J : C {}; struct A { operator J* (); }; A p; C* const& q = p;
google
android
const1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/const1.C
97
utf_8
b0e427443037919ee45a88d886f4f4f9
// PR c++/14211 void f(char *str) { char *& m = const_cast<char *>(str); // { dg-error "" } }
google
android
bitfield9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield9.C
205
utf_8
e957e40d1b691f5227994efd43cc2472
// PR c++/35909 // { dg-do compile } struct MidiCommand { unsigned data1 : 8; }; void g(const unsigned char &); void h(const unsigned int &); void f(MidiCommand mc) { g(mc.data1); h(mc.data1); }
google
android
nullptr1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/nullptr1.C
252
utf_8
c30de2400829d5e6176f6a8e297cba06
/* Test for overflow in NULL pointer constant. */ /* { dg-do compile } */ #include <limits.h> void *p = 0; void *q = 0 * (INT_MAX + 1); // { dg-error "invalid conversion" } // { dg-warning "integer overflow in expression" "" { target *-*-* } 8 }
google
android
nullptr2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/nullptr2.C
183
utf_8
48dde4679a9c2fd89e9213a130223e9e
/* Test for enumeration as NULL pointer constant. */ /* PR c++/14644 */ /* { dg-do compile } */ enum { NULL = 0 }; void *p = 0; void *q = NULL; // { dg-error "cannot convert" }
google
android
op4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op4.C
343
utf_8
b7655bc69f060740bf04f4f2a6a0fb61
/* PR c++/26698 */ /* { dg-do compile } */ struct X { int x; X (int i = 0) : x (i) {} operator X& (void) const { return *(new X); } }; void add_one (X & ref) { /* { dg-message "in passing argument" } */ ++ ref.x; } void foo() { X const a (2); add_one(a); /* { dg-error "invalid initialization of ref...
google
android
to-virtual-base-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/to-virtual-base-1.C
306
utf_8
a3a3822acc6c0ae0b1c800209c7c3369
struct A { virtual void f(const A* a) = 0; }; struct B : virtual A { virtual void f(const A* a); }; void B::f(const A* a) { static_cast<const B&>(*a); // { dg-error "" } }
google
android
simd2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/simd2.C
330
utf_8
8e41381be792deb70891ea9cc1764f4a
/* { dg-do compile } */ /* Test generic operations on vectors. */ int __attribute__((vector_size(16))) a, b, c; int __attribute__((vector_size(8))) d; void foo() { a = b ^ c; a = b + c; a = b - c; a = b * c; a = b / c; a = -b; a = d + b; /* { dg-error "invalid operands to binary +...
google
android
reinterpret2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/reinterpret2.C
52
utf_8
da446c68ad3e26a27f1f02cfb80bb439
bool b; void f() { reinterpret_cast<void*>(b); }
google
android
reinterpret4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/reinterpret4.C
95
utf_8
75182cadb5387652dec18b1fdc77dc36
// PR c++/51379 unsigned long t1 = 1; unsigned long t2 = reinterpret_cast<unsigned long>(t1);
google
android
ptrmem3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem3.C
1,145
utf_8
1896de082df820f0dcb7e67fe47949ca
// { dg-do compile } // Assorted pointer to member function static cast tests. struct A { int f (); }; struct B : A { int f (); }; struct P : A { int f (); }; struct V { int f (); }; struct D : B, virtual V, private P { int f (); }; // Valid static casts. int (B::*p1)() = static_cast<int (B::*)()>(&D::f); int (D::*p2)(...
google
android
void2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/void2.C
122
utf_8
11a0651cbba544a16a3a99edc6dd1232
// PR c++/54165 struct A { template<typename T> operator T() { T l[]; } }; int main() { A a; (void)a; }
google
android
cond2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cond2.C
152
utf_8
e588675f14c4bd6919f2de257b165dee
// PR c++/10245 struct X {}; struct Y { Y (); operator X () const; private: Y (const Y &); }; Y y; void foo() { X x = (1 ? Y() : Y()); }
google
android
err-recover1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/err-recover1.C
147
utf_8
4323bc310ebd03f9141f337dcf986f7a
// PR c++/42219 void foo(const void); // { dg-error "incomplete|const" } void bar() { void (*pf)() = foo; // { dg-error "cannot convert" } }
google
android
bitfield4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield4.C
210
utf_8
108dbe59480526dc6ba867064aa94fd0
// PR c++/27292 enum ColorRole { WindowText, Button }; struct QPalette { ColorRole bg_role:8; bool hasBackground(); }; bool QPalette::hasBackground () { return (ColorRole (bg_role) != WindowText); }
google
android
reinterpret3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/reinterpret3.C
84
utf_8
d4e80e3dcc4416f9be4b4b9e390904bd
struct S {}; S s; void f() { reinterpret_cast<const S>(s); // { dg-error "" } }
google
android
ptrmem5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem5.C
1,115
utf_8
626164a31d44e2553076ebfa89823d12
// { dg-do compile } // Assorted pointer to member function c-style cast tests. struct X {}; struct A { int f (); }; struct B : A { int f (); }; struct P : A { int f (); }; struct V { int f (); }; struct D : B, virtual V, private P { int f (); }; // Accessible, non-virtual, non-ambiguous base clas. int (B::*p1)() = (in...
google
android
cond3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cond3.C
265
utf_8
da146cc2c8fcbbcd080e02f0e3f733df
// PR c++/9537 class String { public: String(); String( char *str ); operator char *(); }; const String operator+( String s1, String ) { return s1; } String valGlue(const String before) { String ret; return false ? ret : before + before; }
google
android
ptrmem4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem4.C
1,260
utf_8
17ad39eaf20adaa0ed0d05ef893ab3e3
// { dg-do compile } // Assorted pointer to data member c-style cast tests. struct X {}; struct A { int x; }; struct B : A { int x; }; struct P : A { int x; }; struct V { int x; }; struct D : B, virtual V, private P { int x; }; // Accessible, non-virtual, non-ambiguous base clas. int B::*p1 = (int B::*)&D::x; int D::*p...
google
android
enum1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/enum1.C
221
utf_8
2e281007b9998371bac78412c4e9f5c0
// { dg-do run } // { dg-options "-O2 -finline-functions" } enum E { V = 1 }; static const E E_MIN = V; static const E E_MAX = V; bool valid(E v) { return v >= E_MIN && v <= E_MAX; } int main() { return valid(E(2)); }
google
android
cond6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cond6.C
322
utf_8
7a1a3b98a22e73124c10abe63b9e58eb
// PR c++/11283 // Converting "a" to the type of "i" produces "int" rather than "const // int", which was causing build_conditional_expr to abort. But we don't // care about cv-quals on non-class rvalues. struct A { operator int (); }; extern A a; extern const int i; extern bool b; int f () { return b ? a : i; ...
google
android
ptrmem2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem2.C
1,433
utf_8
c26b0c2e104921cf5519ee58bb9cc752
// { dg-do compile } // Assorted pointer to data member static cast tests. struct A { int x; }; struct B : A { int x; }; struct P : A { int x; }; struct V { int x; }; struct D : B, virtual V, private P { int x; }; // Valid static casts. int B::*p1 = static_cast<int B::*>(&D::x); int D::*p2 = static_cast<int D::*>(&B::x...
google
android
simd1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/simd1.C
1,001
utf_8
5f33a6ce841493c407b8a33be8f48158
/* { dg-do compile } */ /* { dg-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */ /* Test overload resolution of vector types. From Janis Johnson and Paolo Bonzini, based on PR/16882 */ #define vector __attribute__((vector_size(16))) vector signed int vld (int a1, const vector signed int *a2) { return *a2;...
google
android
base1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/base1.C
214
utf_8
692916f43054879ce077252221b118a2
// PR c++/48749 struct Tuple3 { float x; }; struct Pos: virtual Tuple3 { }; struct TexCoords { Pos pos; }; template <class T> void eval (const TexCoords &coords) { const Pos &pos = coords.pos; pos.x; }
google
android
ptrmem8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem8.C
334
utf_8
aeedda629d126c8574002931dd6b1e15
// { dg-do run } // Test for proper conversion of null pointers to data members. struct B1 { int x; }; struct B2 { int x; }; struct D : B1, B2 { int x; }; int main () { int D::*pd = 0; int B2::*pb2 = 0; return pd != pb2; }
google
android
op3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op3.C
96
utf_8
abda548f6cf197b5d004afe0b4fa5557
// PR c++/22256 struct node { int* operator int*(); }; // { dg-error "return type specified" }
google
android
bitfield11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield11.C
203
utf_8
60e79aef553bffd7cb5b1c983d5960a8
// Make sure that digest_init converts to the declared type of the // bitfield, not just the lowered type. enum E { EA, EB }; struct A { E e: 8; }; A a = { 0 }; // { dg-error "invalid conversion" }
google
android
dr195
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/dr195.C
987
utf_8
a28da06fab215220e6800b44c5ac69b4
// DR 195 was about allowing conversions between function and object // pointers under some circumstances. The issue got resolved for C++11, // which, in 5.2.10 p8 says that: "Converting a function pointer to an // object pointer type or vice versa is conditionally-supported." // This checks we don't warn anymore with...
google
android
bitfield8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield8.C
487
utf_8
df929a9deae2fb3db69b7347b27518fa
// PR c++/35056 // { dg-do compile } // { dg-options "-O2" } enum EBorderStyle { bla = 1 }; inline bool compare_ref(const unsigned int &t, const EBorderStyle &u) { return t == u; } inline bool compare_val(const unsigned int t, const EBorderStyle u) { return t == u; } struct S { unsigned m_style : 4; }; void call_ref...
google
android
dr195-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/dr195-1.C
885
utf_8
424f02c389b9f1fb60fa25d7cda32717
// { dg-options "" } // DR 195 will allow conversions between function and object pointers // under some circumstances. It is in drafting, so we don't implement // it (yet). // this checks we are silent when not being pedantic. typedef void (*PF)(void); typedef void *PV; typedef int *PO; void foo () { PF pf; PV pv;...
google
android
bitfield3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield3.C
235
utf_8
be810813d630f0dd9802ec2a447ebbae
// PR c++/16376 // { dg-do run } int main(void){ struct bits { unsigned int ui3 : 3; } bits; int i = -1; /* is a very large positive number as unsigned */ bits.ui3 = 1u; if( bits.ui3 < i ) return 1; return 0; }
google
android
memfn2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/memfn2.C
145
utf_8
d63b302b1a2b008c04cb961af27de8c7
// PR c++/37646 struct A { void foo(); void bar(int i) { void (*p)() = i ? foo : foo; // { dg-error "invalid use of member" } } };
google
android
ptrmem7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem7.C
709
utf_8
0fe129d5222cc52f6d9f59e2a4ccd0de
// { dg-do compile } // Assorted pointer to member function implicit cast tests. struct A { int f (); }; struct B : A { int f (); }; struct P : A { int f (); }; struct V { int f (); }; struct D : B, virtual V, private P { int f (); }; // Valid. int (D::*p1)() = &B::f; // Derived class. int (B::*p2)() = &D::f; // { dg-e...
google
android
op2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op2.C
345
utf_8
3691f2fae514386b7e94bd8db99acd68
// PR c++/13907 struct A { operator int & (); operator const int & () const; }; void f(int &); void f(const int &); int main() { co...
google
android
simd4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/simd4.C
1,090
utf_8
cbf6c39df44754b216a83ab9d8de5418
// PR c++/29734 // { dg-do compile } // { dg-options "" } int t; float u; int __attribute__((vector_size (8))) v; float __attribute__((vector_size (8))) w; int b[10]; void foo () { b[t]; b[u]; // { dg-error "invalid types" } b[v]; // { dg-error "invalid types" } b[w]; // { dg-error "invalid types" } t[b]...
google
android
reinterpret1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/reinterpret1.C
81
utf_8
80936a5108fb4a54f3fd09b63432c31e
// PR c++/15076 struct Y { Y(int &); }; int v; Y y1(reinterpret_cast<int>(v));
google
android
ptrmem6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem6.C
824
utf_8
51b173d4a14b312b2489d71f89effb18
// { dg-do compile } // Assorted pointer to data member implicit cast tests. struct A { int x; }; struct B : A { int x; }; struct P : A { int x; }; struct V { int x; }; struct D : B, virtual V, private P { int x; }; // Valid. int D::*p1 = &B::x; // Derived class. int B::*p2 = &D::x; // { dg-error "" } // Virtual base c...
google
android
cast2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cast2.C
143
utf_8
03379ea793d73fca8fd7f0f0cefec062
// Origin: PR c++/42260 // { dg-do compile } struct A { template<typename T> operator T*(); }; int i = *A();// { dg-error "no match" }
google
android
bitfield10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield10.C
331
utf_8
38f6bad87ae88f3b5e8814eb2a0cb3cd
// PR c++/38007 // We need to use the conversion function to the declared type of a bitfield, // not the lowered bitfield type. // { dg-do link } struct A { operator unsigned int() { return 42; } operator unsigned char(); }; struct B { unsigned int b : 8; }; int main () { A u; unsigned int v = u; B w; ...
google
android
bitfield2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield2.C
82
utf_8
4f08e43e1ee5b1ab9782df9a7152620c
// PR c++/27292 struct A { int i : 8; }; bool foo(A a) { return int(a.i); }
google
android
op5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op5.C
292
utf_8
e931274865053d8a40492868844d5c08
// Origin: PR c++/36407 // { dg-do compile } struct A { A (const A&); }; struct B { operator A&(); }; void foo (const B& b) { const A a = b; // { dg-error "conversion from 'const B' to non-scalar type 'const A' requested" } }
google
android
op1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/op1.C
234
utf_8
2a192b5427feda4a29dae1a4f0493eaf
class C { template<typename U> operator U(); // { dg-message "note" } }; int fn (C c) { // { dg-message "candidate" "candidate note" { target *-*-* } 9 } }
google
android
const3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/const3.C
79
utf_8
8dae0b4264c4a22a22f3c8abe5fbdf3b
// PR c++/18177 void foo() { X; // { dg-error "" } const_cast<int&>(X); }
google
android
cond1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/cond1.C
165
utf_8
3a1a08be0e7ef48d24c3effabe0bc96f
// PR c++/9440 struct A { explicit A(int = 0); A(const A&); operator int() const; }; A bar(bool b, const A& a) { return (b ? A() : a); }
google
android
bitfield7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield7.C
202
utf_8
7d23de731dd222bf440177edc7086be2
// PR c++/33984 // { dg-do compile } struct S { unsigned int bar : 3; } s; int foo (unsigned int &); int foo (double); int main () { return foo (s.bar); // { dg-error "cannot bind bitfield" } }
google
android
ptrmem1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem1.C
122
utf_8
23830a13c326c99bae67e56e30ebc0b4
struct S {}; void f (int S::*const*); typedef int I; void f (I S::*const*); void g() { int S::*const* p; f(p); }
google
android
void1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/void1.C
130
utf_8
7a062897a2b4fb8f55640e4a532239dd
// PR c++/27422 // { dg-do compile } void foo(void i); // { dg-error "incomplete type|invalid use" } void bar() { foo(0); }
google
android
memfn1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/memfn1.C
242
utf_8
a0a917766bdefb909863e17a7a3e001b
// PR c++/36334 struct X { typedef int* foobar(); static void foo(foobar&); }; void X::foo(foobar&) { } struct Y : public X { static foobar bar; static void foo(); }; void Y::foo() { X::foo(bar); } int* Y::bar() { return 0; }
google
android
dynamic1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/dynamic1.C
198
utf_8
eb10fe6db1351b178c1c1068e9806fed
// PR c++/10385 // { dg-do compile } struct A { void foo(); }; A& bar(); void baz() { dynamic_cast<A&>( bar().foo ); // { dg-error "cannot dynamic_cast" } }
google
android
ambig1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ambig1.C
237
utf_8
99531db549e9b6ddaad27a9e2a55bdd6
// PR c++/19787 struct H { operator char(); // { dg-message "note" } operator short(); // { dg-message "note" } }; int const& ref = H(); // { dg-error "ambiguous" } // { dg-message "candidate" "candidate note" { target *-*-* } 8 }
google
android
ptrmem9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/ptrmem9.C
547
utf_8
af45002fe324a7bd0f0ddbc27dfe0c8c
// { dg-do compile } // Test implicit conversion of pointers to member functions appearing as // operands of the equality operators. struct B { }; struct BV { }; struct D : B, virtual BV { }; struct C { }; void f () { void (D::*pd) () = 0; void (B::*pb) () = 0; void (BV::*pbv) () = 0; void (C::*pc) () = 0; pd...
google
android
bitfield1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/conversion/bitfield1.C
234
utf_8
f1b5334044ded17fb9949549b0502764
// { dg-do run } // { dg-options "-w" } enum E { a, b = 1LL << 48 }; struct S { E e : 3; }; S s; int main () { if (sizeof (E) != sizeof (long long)) return 1; if (sizeof (s.e + 3) != sizeof (long long)) return 2; }
google
android
no-rtti-voidptr
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/no-rtti-voidptr.C
205
utf_8
11ddfffc9b05013900dc0f7fcf21274e
// { dg-do compile } // { dg-options "-fno-rtti" } // PR C++/28687 struct A { virtual ~A() { } }; struct B : A { }; A* f() { return new B(); } int main() { void* b = dynamic_cast<void*>(f()); }
google
android
repo1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C
442
utf_8
81105d090aea72a34a9f7ee1834305f9
// PR c++/22204 // { dg-options "-frepo" } // { dg-require-host-local "" } // { dg-skip-if "dkms are not final links" { vxworks_kernel } } // { dg-skip-if "-frepo not supported with --sysroot (as it is not passed to COLLECT_GCC_OPTIONS" { *-*-linux* } { "*" } { "" } } #include <typeinfo> template<int> struct function1...
google
android
predefined-rtti-macro-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/predefined-rtti-macro-1.C
163
utf_8
352a1ba9eb698ac9c7b5ff1d691318bb
// { dg-do compile } struct A { virtual ~A() { }; }; struct B : A { }; void f(B* bp) { bp = #ifdef __GXX_RTTI dynamic_cast<B*>(static_cast<A*>(0)); #endif }
google
android
typeid2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid2.C
293
utf_8
f03a5377eca516c74e77fcf76b40f948
// { dg-do run } #include <typeinfo> template <typename T> const char *print_type (const T &) { return typeid(T).name(); } /* no template */ void pp1 (int) {} template <typename X> void pp2 (X) {} int main () { if (print_type (&pp1) != print_type (&pp2<int>)) return 1; }
google
android
crash1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/crash1.C
208
utf_8
7345c9463c7d47c7d425463846af6b14
// { dg-do compile } // PR 7788. ICE class foo; extern const foo bar; class bar;
google
android
darwin-builtin-linkage
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/darwin-builtin-linkage.C
530
utf_8
a30f80781bea4012b3066258d71adff2
/* { dg-do compile { target *-*-darwin* } } */ /* { dg-final { scan-assembler-not "\\.weak_definition __ZTI" } } */ /* Verify that none of the type_info structures for the fundamental types are emitted as weak on Darwin. */ #include <cxxabi.h> namespace __cxxabiv1 { using namespace std; // This has special mea...
google
android
typeid7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid7.C
649
utf_8
b0c0786c803eaf05e6755f729c87257e
// PR c++/32260 // { dg-do compile } // { dg-options "-O2 -W -Wall" } #include <typeinfo> const std::type_info & f1 (int i) { return typeid (i + 1); } const std::type_info & f2 () { return typeid (int); } struct A { A (); virtual ~A (); void foo (); }; const std::type_info & f3 () { return typeid (A); ...
google
android
fn-quals
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/fn-quals.C
294
utf_8
df8a805281a95c255d57e5562a0c9c03
// PR c++/48665 #include <typeinfo> extern "C" void abort(); template<class A,class B> void f() { if (typeid(A)==typeid(B)) abort(); // { dg-error "qualified function" } if (typeid(A*)==typeid(B*)) abort(); // { dg-error "qualified function" } } int main() { f<void()const,void()>(); }
google
android
dyncast4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/dyncast4.C
355
utf_8
84b81c1f12b7f888ee1b6e2e05445b09
// Test to make sure that we keep searching if we don't find the type we // want at the expected address. // { dg-do run } struct A { virtual void f() {}; }; struct B: A { }; struct C: A { }; struct D: B, C { }; int main() { D d; A* ap = static_cast<B*>(&d); C* cp = dynamic_cast<C*>(ap); if (cp == 0) ...
google
android
template1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/template1.C
359
utf_8
bce635f684a724553abba95d702b1cb8
// PR c++/49387 #include <typeinfo> struct ResourceMonitorClient { }; template <typename T> struct ResourcePool : public ResourceMonitorClient { virtual ~ResourcePool() { } }; template <typename T> struct BaseWriter { BaseWriter() { typeid(ResourcePool<int>*); } virtual void run() { ResourcePool<i...
google
android
dyncast6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/dyncast6.C
1,930
utf_8
43307fa2a03c0c8c5b549d19a0394048
// PR c++/57599 class A { }; class B : public A { }; void p() { B* b; A* a1; a1 = dynamic_cast<A*>(b); a1 = dynamic_cast<const A*>(b); // { dg-error "invalid" } a1 = dynamic_cast<volatile A*>(b); // { dg-error "invalid" } a1 = dynamic_cast<const volatile A*>(b); // { dg-error "invalid" } ...
google
android
typeid4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid4.C
430
utf_8
f45226306cb853d7f47a657db3e4f853
// { dg-do run } // { dg-options "-O2" } #include <typeinfo> #include <iostream> struct A { virtual ~A () {} }; struct APtr { APtr (A* p) : p_ (p) { } A& operator* () const { return *p_; } A* p_; }; int main () { APtr ap (new A); std::type_info const* const exp = &typeid (*ap); for (bool cont = true;...
google
android
predefined-rtti-macro-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/predefined-rtti-macro-2.C
140
utf_8
d53958b1de4c01a672e8ec50c3bfa248
// { dg-do compile } // { dg-options "-fno-rtti" } struct B { }; void f(B* bp) { bp = #ifndef __GXX_RTTI static_cast<B*>(0); #endif }
google
android
crash4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/crash4.C
398
utf_8
d2801b8f989dad0612c1e7483b39be9d
/* { dg-do compile } */ /* { dg-options "-O" } */ class ios_base { public: virtual ~ios_base(); }; template<typename _CharT> class basic_ostream : virtual public ios_base { public: virtual ~basic_ostream() { } }; extern template class basic_ostream<char>; template <typename _CharT> class basic_ostringstream ...
google
android
dyncast2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/dyncast2.C
321
utf_8
c13886fc7e0e1c4f2f10e10b0cf68ec5
// PR c++/34364 // { dg-do run } struct A { virtual ~A () {} }; struct B : public A { template <typename T> struct C { static void f (A &a) { dynamic_cast <B &>(a).g (); } }; B () : c (6) {} void g () { c++; } int c; }; B b; int main (void) { B::C<int>::f (b); return b.c != 7; }...
google
android
incomplete1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/incomplete1.C
141
utf_8
b5e04568d275d9d8237df66b459409ef
// PR c++/28109 // { dg-do compile } #include <typeinfo> struct A; void foo() { A a; // { dg-error "incomplete type" } typeid (a); }
google
android
dyncast3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/dyncast3.C
1,446
utf_8
2ac14f900e107af4423a784213db1cc3
// This testcase used to crash while looking in A for my_module. I'm still // not sure it's well-formed, but it works now because of the optimization // to look at the expected address first. // { dg-do run } extern "C" int puts (const char *); extern "C" void abort (); struct my_object { my_object() { puts ("in ...
google
android
typeid6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid6.C
219
utf_8
22af06883116fde7a979131b734afd60
// PR c++/33463 namespace std { class type_info {}; } template<int> void foo() { !typeid(void); // { dg-error "!typeid\\(void\\)|candidate is" } // { dg-message "" "match candidate text" { target *-*-* } 10 } }
google
android
cv1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/cv1.C
222
utf_8
7c2277ddbea5545cda84aae94fdb88ad
// { dg-do run } #include <typeinfo> #include <string.h> struct S {}; typedef S volatile T[4]; T t[3]; const std::type_info& ti = typeid (t); int main () { if (strcmp (ti.name (), "A3_A4_1S") != 0) return 1; }
google
android
no-rtti
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/no-rtti.C
199
utf_8
8f46e7645aa4679909b2df4d299e9558
// { dg-do compile } // { dg-options "-fno-rtti" } // PR C++/10891 struct A { virtual ~A() { } }; struct B : A { }; A* f(); int main() { B* b = dynamic_cast<B*>(f()); // { dg-error "" } }
google
android
typeid10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid10.C
659
utf_8
4f9657fbf15f19dc450265533a091434
// PR c++/25466 // { dg-do run } #include <typeinfo> const std::type_info *a; template <class T> bool is_polymorphic() { bool result(false); const std::type_info &a1 = typeid( (result=true), *(T*)0); a = &a1; return result; } struct non_polymorphic {}; struct polymorphic { virtual ~polymorphic() {} }; ...
google
android
typeid8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/typeid8.C
607
utf_8
3bf0c0d4697ad1ada3cda87b9bc2dc61
// PR c++/36405 // { dg-do compile } #include <typeinfo> struct A { void foo () { typeid (foo).name (); // { dg-error "invalid use of member" } typeid (A::foo).name (); // { dg-error "invalid use of member" } } void bar () { typeid (foo).name (); // { dg-error "invalid use of member" } typei...
google
android
crash2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/rtti/crash2.C
303
utf_8
34c4c8f1721c4f70c2261dcc1b0a7630
struct facet { virtual ~facet(); }; struct ctype_base {}; struct ctype : facet, ctype_base {};