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
variadic69
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic69.C
674
utf_8
665d96dfa136ff270f42ff15c4021491
// { dg-options "-std=gnu++0x" } template<typename T> struct stored_value { explicit stored_value() : value() { } explicit stored_value(const T& value) : value(value) { } stored_value(int, const T& value) : value(value) { } T value; }; template<typename... Values> struct myclass : public stored_value<Values...
google
chromium
variadic24
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic24.C
158
utf_8
7ee5e10d775f659b178e9e2605776202
// { dg-options "-std=gnu++0x" } template<typename T, T... Values> struct vector_c { }; vector_c<int, 17, 42> intvec; vector_c<char, 'a', 'b', 'c'> charvec;
google
chromium
variadic35
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic35.C
240
utf_8
667bf0290b01ee52046a37c46987246c
// { dg-options "-std=gnu++0x" } template<int I, typename... Args> void get_ith(const Args&... args); void f() { get_ith<1, float>(1, 2.0, 'x'); get_ith<1, int, double, char, int>(1, 2.0, 'x'); // { dg-error "no matching function" } }
google
chromium
decltype-33837
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C
182
utf_8
9a0ace8a7ebbf5d7255b172011b808ca
// { dg-options -std=c++0x } // PR c++/33837 void foo() { __decltype (A::foo()); // { dg-error "was not declared|expected" } __decltype (B); // { dg-error "was not declared" } }
google
chromium
variadic3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic3.C
142
utf_8
a0fc4b5dd9895b5fe6a68628d4db6380
// { dg-options "-std=gnu++0x" } template<typename... Args> class tuple {}; void f() { tuple<> x; tuple<int> y; tuple<int, float> z; }
google
chromium
initlist25
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist25.C
248
utf_8
5673b623874e372b643d0dac08b0caa4
// PR c++/41754 // { dg-options -std=c++0x } // { dg-do run } #include <map> #include <string> #include <iostream> using namespace std; int main() { map<string, string> m; m.insert({{"t", "t"}, {"y", "y"}}); return 0; }
google
chromium
variadic67
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic67.C
516
utf_8
73d538726d20c793ad5bb11ff74edfb9
// { dg-options "-std=gnu++0x" } template<typename... Elements> struct tuple {}; template<typename... Args> struct nested { typedef tuple<tuple<Args, Args...>...> type; }; template<typename T, typename U> struct is_same { static const bool value = false; }; template<typename T> struct is_same<T, T> { static co...
google
chromium
variadic50
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic50.C
150
utf_8
b2b9d3b9454eacd2fabfc51ba4493191
// { dg-options "-std=gnu++0x" } int& f(int, double, ...); template<typename... Args> float& f(Args...); float& g() { return f(17, 3.14159, 3); }
google
chromium
rv5n
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv5n.C
19,333
utf_8
e0ce83c49b788d80830771302f42cc3d
// I, Howard Hinnant, hereby place this code in the public domain. // Test overlaod resolution among referece types // { dg-do compile } // { dg-options "-std=c++0x" } template <bool> struct sa; template <> struct sa<true> {}; struct one {char x[1];}; struct two {char x[2];}; struct three {char x[3];}; struct f...
google
chromium
variadic11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic11.C
494
utf_8
fd232fd0f9ee4ead299f8f5377eacce2
// { dg-options "-std=gnu++0x" } template<typename...> struct count; template<> struct count<> { static const int value = 0; }; template<typename T, typename... Args> struct count<T, Args...> { static const int value = 1 + count<Args...>::value; }; int a0[count<>::value == 0? 1 : -1]; int a1[count<char>::value =...
google
chromium
pr31444
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31444.C
216
utf_8
ccea62e27b41f0e0b3068f61e335c3dd
// { dg-options "-std=gnu++0x" } template<typename... T> struct A { template<int> void foo(A<T>); // { dg-error "not expanded|T" } }; void bar() { A<int>().foo<0>(A<int>()); // { dg-error "no member named" } };
google
chromium
variadic22
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic22.C
653
utf_8
3154647a4e099200d85e6844bce83814
// { dg-options "-std=gnu++0x" } template<typename R, typename... ArgTypes> struct make_function_type { typedef R type(ArgTypes... args); }; template<typename T, typename U> struct is_same { static const bool value = false; }; template<typename T> struct is_same<T, T> { static const bool value = true; }; int a...
google
chromium
static_assert3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert3.C
158
utf_8
edacfa979d970ca2fd7315f06f7c5572
// { dg-options "-std=c++0x" } static_assert(7 / 0, "X"); // { dg-error "non-constant condition" } // { dg-warning "division by zero" "" { target *-*-* } 2 }
google
chromium
variadic16
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic16.C
682
utf_8
5e1e29412f063305c242c74862e86181
// { dg-options "-std=gnu++0x" } template<typename R, typename... ArgTypes> struct make_function_type { typedef R type(const ArgTypes&... args); }; template<typename T, typename U> struct is_same { static const bool value = false; }; template<typename T> struct is_same<T, T> { static const bool value = true; };...
google
chromium
template_deduction
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/template_deduction.C
1,856
utf_8
5dc8f6956bf6c99f9f94a90d119d3dc0
// I, Howard Hinnant, hereby place this code in the public domain. // Test the "Augmented" template argument deduction when binding an lvalue to an rvalue reference. // { dg-do compile } // { dg-options "-std=c++0x" } template <bool> struct sa; template <> struct sa<true> {}; template <class T, T v> struct integral...
google
chromium
variadic59
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic59.C
194
utf_8
0cb58621c4a73b547de0ab5d24561cf5
// { dg-options "-std=gnu++0x" } template<class T, typename... VarArgs> void print(T t, VarArgs args); // { dg-error "packs not expanded" } // { dg-message "VarArgs" "note" { target *-*-* } 3 }
google
chromium
pr32253
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32253.C
146
utf_8
631cf47a14c5117c15a4729a3a035270
// { dg-options "-std=c++0x" } template<void (*... fp)()> struct A { A() { fp(); } // { dg-error "not expanded|fp" } }; void foo(); A<foo> a;
google
chromium
vt-34052
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34052.C
310
utf_8
f4757749a592f130d579f6b7e524b3ac
// { dg-options "-std=c++0x" } template<typename... T, typename = T> struct A {}; // { dg-error "must be at the end" } template<template<typename... T, typename = T> class U> struct B // { dg-error "must be at the end" } { template<int> U<int> foo(); // { dg-error "mismatch|constant|invalid|invalid" } };
google
chromium
variadic29
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic29.C
1,042
utf_8
c7c53f1a850486e6679090c2406b30b6
// { dg-options "-std=gnu++0x" } template<typename Signature> struct function_traits; template<typename R, typename... ArgTypes> struct function_traits<R(ArgTypes...)> { typedef R result_type; }; template<typename R, typename Class, typename... ArgTypes> struct function_traits<R (Class::*)(ArgTypes...)> { typedef...
google
chromium
variadic31
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic31.C
159
utf_8
9692082ef4357394bc9aa5c71dead7e3
// { dg-options "-std=gnu++0x" } template<typename... T> void eat(T...) { } void f() { eat(); eat(1); eat(1, 2); eat(17, 3.14159, "Hello, World!"); }
google
chromium
vt-34919
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34919.C
171
utf_8
183cc4d67f7796c4c307c41f08be2743
// { dg-options "-std=c++0x" } template<int... N> struct A { static void foo() { int i = N; // { dg-error "not expanded|N" } } }; void bar() { A<0>::foo(); }
google
chromium
defaulted10
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted10.C
272
utf_8
a01a2c278868a00c8a6181355290f624
// PR c++/40381 // { dg-options "-std=gnu++0x" } struct A { template<typename T> void foo(T) = delete; // { dg-error "previously|deleted" } }; template<typename T> void A::foo(T) {} // { dg-error "redefinition" } void bar() { A().foo(0); // { dg-error "used" } }
google
chromium
unnamed_refs
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/unnamed_refs.C
521
utf_8
a460b87cdd4f4e41763d048e0fd1c15b
// I, Howard Hinnant, hereby place this code in the public domain. // Test: Unamed rvalue references are treated as lvalues. // { dg-do compile } // { dg-options "-std=c++0x" } template <bool> struct sa; template <> struct sa<true> {}; struct one {char x[1];}; struct two {char x[2];}; struct A {}; one foo(con...
google
chromium
variadic94
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic94.C
411
utf_8
102cfb8090ee7187ab5a236addf1729f
// PR c++/40595 // { dg-options "-std=c++0x" } template<int N> struct S { typedef int type; }; template<typename T> struct Get { static T get(); }; template<typename F> struct B { template<typename ... Args> typename S<sizeof( Get<F>::get() (Get<Args>::get() ...) )>::type f(Args&& ... a);...
google
chromium
decltype18
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype18.C
103
utf_8
5619cfac0fb1689f9ed6c8d79af2b5ef
// PR c++/37875 // { dg-options "-std=c++0x" } template <typename> struct X {}; X<decltype(1 > 2)> x;
google
chromium
auto1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto1.C
201
utf_8
41dfdfa19c5e84ceb06e83606870ff86
// { dg-options "-std=c++98 -Wc++0x-compat" } // Test warning for use of auto in C++98 mode with C++0x // compatibility warnings void f() { auto int x = 5; // { dg-warning "will change meaning" } }
google
chromium
enum2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum2.C
142
utf_8
a8073df4790689eb8b20d4a6f09abde1
// PR c++/38637 // { dg-do compile } // { dg-options "-std=c++0x" } template<int> enum E : int { e }; // { dg-error "declaration|expected" }
google
chromium
initlist17
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist17.C
152
utf_8
d1ed66853d8a6eaa9eb8d3d0438f5752
// { dg-options "-std=c++0x" } void f(int i); int main() { f({42.0}); // { dg-error "narrowing" } return {1.0}; // { dg-error "narrowing" } }
google
chromium
pr32126
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32126.C
233
utf_8
17104ea84b98016b8357de7549d60372
// { dg-options "-std=c++0x" } template<typename...> struct A; template<typename...T> struct A<T> // { dg-error "not expanded|T|" } { static int i; }; A<char> a; // { dg-error "incomplete" } A<int> b; // { dg-error "incomplete" }
google
chromium
gcov-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-3.C
348
utf_8
0e241a16c3faf2f0c387bd2978d2b824
/* Check that gcov doesn't abort when a static object is defined within a header file. */ /* { dg-options "-fprofile-arcs -ftest-coverage" } */ /* { dg-do run { target native } } */ #include "gcov-3.h" extern int foo(); int main () { return foo(); /* count(1) */ } /* { dg-final...
google
chromium
gcov-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-1.C
6,705
utf_8
ed8a6c94f1bc2e70a324d73a77190040
/* Check that execution counts and branch probabilities for various C constructs are reported correctly by gcov. */ /* { dg-options "-fprofile-arcs -ftest-coverage" } */ /* { dg-do run { target native } } */ extern "C" void abort (void); int do_something (int i) { return i; } /* Check static inline functions. ...
google
chromium
gcov-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-6.C
309
utf_8
0db2a2956de58970834889c74f43082d
// PR gcov-profile/34609 // { dg-do compile } // { dg-options "-O -ftest-coverage" } struct A { int i; int &get () { return i; } }; inline A foo () { A a; a.get (); return a; } inline A bar () { return foo (); } void baz () { A a; a = bar (); } // { dg-final { cleanup-coverage-files } }
google
chromium
gcov-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-4.C
785
utf_8
a7c093e32d8e0cc08e02c3253748979c
/* Check that execution counts and branch probabilities for various C constructs are reported correctly by gcov. */ #include <stdio.h> /* { dg-options "-fprofile-arcs -ftest-coverage -fno-exceptions" } */ /* { dg-do run { target native } } */ class foo { public: foo() { printf("foo()\n"); }; ~foo() { printf("...
google
chromium
gcov-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-2.C
465
utf_8
afab866e59f46409fb68aa64174f3acf
/* Verify line coverage counts for simple member functions. */ /* { dg-options "-fprofile-arcs -ftest-coverage" } */ /* { dg-do run { target native } } */ class C { public: C() { i = 0; /* count(1) */ } ~C() {} void seti (int j) { i = j; /* count(1) */ } private: int i; }; void foo() { ...
google
chromium
gcov-5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/gcov/gcov-5.C
928
utf_8
8ade32db1de614a89b3775d4d1d03415
/* Check that execution counts for template functions are reported correctly by gcov. */ #include <stdio.h> #include <stdlib.h> /* { dg-options "-fprofile-arcs -ftest-coverage -fno-inline" } */ /* { dg-do run { target native } } */ class A { int count; public: A(int c) { count = c; } void func(void) { prin...
google
chromium
cond6
.C
native_client/nacl-gcc/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
chromium
bitfield10
.C
native_client/nacl-gcc/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
chromium
ptrmem2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/ptrmem2.C
1,431
utf_8
3690e02d434485ce8753b6e24f99aea9
// { 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
chromium
bitfield9
.C
native_client/nacl-gcc/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
chromium
const2
.C
native_client/nacl-gcc/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
chromium
self1
.C
native_client/nacl-gcc/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
chromium
bitfield11
.C
native_client/nacl-gcc/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
chromium
dynamic1
.C
native_client/nacl-gcc/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
chromium
op3
.C
native_client/nacl-gcc/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
chromium
ptrmem3
.C
native_client/nacl-gcc/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
chromium
ptrmem5
.C
native_client/nacl-gcc/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
chromium
ptrmem7
.C
native_client/nacl-gcc/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
chromium
op4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/op4.C
343
utf_8
7fc0616b77be1d282a71cb29e276be55
/* 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-error "in passing argument" } */ ++ ref.x; } void foo() { X const a (2); add_one(a); /* { dg-error "invalid initialization of ref...
google
chromium
op1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/op1.C
133
utf_8
6c0d033c15abd71959655beebc0c3522
class C { template<typename U> operator U(); }; int fn (C c) { }
google
chromium
dr195-1
.C
native_client/nacl-gcc/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
chromium
const3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/const3.C
79
utf_8
8dae0b4264c4a22a22f3c8abe5fbdf3b
// PR c++/18177 void foo() { X; // { dg-error "" } const_cast<int&>(X); }
google
chromium
access1
.C
native_client/nacl-gcc/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
chromium
bitfield5
.C
native_client/nacl-gcc/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
chromium
bitfield8
.C
native_client/nacl-gcc/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
chromium
simd2
.C
native_client/nacl-gcc/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
chromium
ptrmem4
.C
native_client/nacl-gcc/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
chromium
op5
.C
native_client/nacl-gcc/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
chromium
bitfield3
.C
native_client/nacl-gcc/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
chromium
const1
.C
native_client/nacl-gcc/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
chromium
simd1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/simd1.C
827
utf_8
3970220dda674d50ae07f085d355bff3
/* { dg-do compile } */ /* 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; } /* { dg-message "vld" } */ vector signed short vld (int a1, co...
google
chromium
simd3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/simd3.C
528
utf_8
8c47863d6710260a7e45023122628b67
/* { 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
chromium
dr195
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/dr195.C
1,008
utf_8
ef561373a484d0cfc492aef62fb42418
// 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 warn when being pedantic. typedef void (*PF)(void); typedef void *PV; typedef int *PO; void foo () { PF pf; PV pv; PO po; /* the following tw...
google
chromium
bitfield4
.C
native_client/nacl-gcc/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
chromium
void1
.C
native_client/nacl-gcc/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
chromium
ambig1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/ambig1.C
171
utf_8
cae83e7bca15183b3b346f9a00467f2c
// PR c++/19787 struct H { operator char(); // { dg-message "note" } operator short(); // { dg-message "note" } }; int const& ref = H(); // { dg-error "ambiguous" }
google
chromium
cond1
.C
native_client/nacl-gcc/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
chromium
cond2
.C
native_client/nacl-gcc/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
chromium
reinterpret2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/reinterpret2.C
52
utf_8
da446c68ad3e26a27f1f02cfb80bb439
bool b; void f() { reinterpret_cast<void*>(b); }
google
chromium
to-virtual-base-1
.C
native_client/nacl-gcc/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
chromium
ptrmem8
.C
native_client/nacl-gcc/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
chromium
bitfield1
.C
native_client/nacl-gcc/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
chromium
nullptr2
.C
native_client/nacl-gcc/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
chromium
cast1
.C
native_client/nacl-gcc/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
chromium
cond3
.C
native_client/nacl-gcc/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
chromium
reinterpret1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/reinterpret1.C
101
utf_8
6e5e81ebfb94f64d88135e578c526065
// PR c++/15076 struct Y { Y(int &); }; int v; Y y1(reinterpret_cast<int>(v)); // { dg-error "" }
google
chromium
bitfield7
.C
native_client/nacl-gcc/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
chromium
reinterpret3
.C
native_client/nacl-gcc/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
chromium
ptrmem1
.C
native_client/nacl-gcc/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
chromium
ptrmem6
.C
native_client/nacl-gcc/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
chromium
memfn1
.C
native_client/nacl-gcc/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
chromium
bitfield6
.C
native_client/nacl-gcc/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
chromium
nullptr1
.C
native_client/nacl-gcc/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
chromium
bitfield2
.C
native_client/nacl-gcc/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
chromium
op2
.C
native_client/nacl-gcc/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
chromium
ptrmem9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/conversion/ptrmem9.C
496
utf_8
50b8165a65270e03397cfb7a9f9f5433
// { 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
chromium
enum1
.C
native_client/nacl-gcc/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
chromium
simd4
.C
native_client/nacl-gcc/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
chromium
memfn2
.C
native_client/nacl-gcc/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
chromium
sizeof8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/sizeof8.C
191
utf_8
84c8e28b3b15370829046813c1fbb7b3
// { dg-do compile } // PR c++/11406: ICE template <int> struct S{}; template <int N> S<sizeof(new double[N])> f() {} template S<sizeof(void*)> f<2>();
google
chromium
typename10
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typename10.C
456
utf_8
13cebd5e928102ca67a8d6b4960714fb
// { dg-do compile } // PR 27787. Too eager to resolve a typename template<typename X> struct x { template<typename Y> struct y { typedef Y type; }; }; template<typename A> struct a : x<A> { template<typename B> typename a::template y<B>::type f(B); };
google
chromium
enum4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/enum4.C
118
utf_8
118d8ffd607a579db3ddbc9662179566
// PR c++/18020 template <typename> struct bar { enum { e1 = 1, e2 = ~e1 }; }; template struct bar<int>;
google
chromium
crash35
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash35.C
194
utf_8
8df742184e3299064aab4742d5bbf80b
// PR c++/20463 // { dg-do compile } template <typename T> struct C; // { dg-error "declaration" } template <typename T> void C<T>::f() // { dg-error "invalid|template" } { const foo bar; }
google
chromium
friend11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend11.C
341
utf_8
c1eab5b806b63596b0fa26a471273823
/* PR c++/53 */ /* { dg-do compile } */ template <class T> struct A { template <class U> class B; // Did not compile with gcc-2.95.2 (linux i686) :-( template <class S> template <class U> friend class A<S>::B; }; template <class S> template <class U> class A<S>::B { }; int main(){ A<double>::B<double>...
google
chromium
access6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/access6.C
421
utf_8
3f2e5ae210f767c1589637afbcf45353
// { dg-do compile } // PR c++/8389 // Access control ICE for typename during instantiation and name mangling template <class> class Base { protected: typedef int Type; }; template <class T> struct Derived : public Base<T> { typedef typename Base<T>::Type Type; template <class Arg> void f(Type = Type()) ...
google
chromium
using5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/using5.C
379
utf_8
730dbbdbfc73d70df6d68467f8af3c39
// { dg-do compile } // PR 9447. further test cases for dependent using decl template <typename T> struct Base; template <typename T> struct Derived : public Base<T> { using Base<T>::i; Derived() { i; } int get_i() { return i.f(); } };
google
chromium
ptrmem14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ptrmem14.C
126
utf_8
372af7481dbb814fd59792b6160a671e
// PR c++/15875 struct A { void foo(); }; template<int> void bar() { typedef void (A::*fptr)(); fptr ptr = &A::foo; }
google
chromium
koenig8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/koenig8.C
224
utf_8
331e9bd8d23757608f4687c51ab1c460
// PR c++/40740 template<class T> T addsome(T v) { return v+1; } int addsome(int v) { return v+2; } int main() { int i = 0; if (addsome(i) != 2) return 1; if (addsome<>(i) != 1) return 2; return 0; }
google
chromium
crash54
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash54.C
129
utf_8
dc113f6f407f869c16ea1bfd3923f2c0
//PR c++/28269 template<int> struct A; struct __attribute__((unused)) A<0<; // { dg-error "template argument|unqualified-id" }
google
chromium
explicit-instantiation2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/explicit-instantiation2.C
214
utf_8
6335a6cb9fd88717c1c31d2bc8b80c3e
// Bug 10968: implicit instantiation overrides explicit instantiation // { dg-final { scan-assembler "_Z1fIiET_S0_" } } template <class T> T f (T t) { return t; } inline void g () { f (4); } template int f (int);
google
chromium
debug1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/debug1.C
305
utf_8
884d79169a3e45dac3ed1c397aba8ac9
// PR c++/40274 // { dg-options "-g" } template <class T> struct valuelist_types { struct null { }; template <T V, class next=null> struct list { }; }; template <unsigned D> void foo() { typename valuelist_types<unsigned>::template list<D> v; } void bar() { valuelist_types<unsigned>::list<2> v; }