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
variadic14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic14.C
642
utf_8
1e1fa2f2e9cc63d798ef3b07852ef7e5
// { dg-options "-std=gnu++0x" } template<typename R, typename... ArgTypes> struct make_function_type { typedef R type(ArgTypes...); }; 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 a0[is_...
google
chromium
constexpr-explicit-inst
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-explicit-inst.C
290
utf_8
0399c0b56f9518198683380dfd3f2dd9
// { dg-options -std=c++0x } template<class T> constexpr inline T bar(T x) { return x; } template short bar(short x); // #EI constexpr auto yz = bar(0); // OK constexpr auto ab = bar(short()); // #1 Error, but should be OK constexpr auto mn = bar(short{}); // #2 Error, but should be OK
google
chromium
variadic6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic6.C
214
utf_8
eaf0e0608619f023add0529c66304933
// { dg-options "-std=gnu++0x" } template<typename ... Args> struct tuple_base {}; template<typename ... Args> struct tuple : public tuple_base<Args...> { }; tuple<> zero; tuple<int> one; tuple<float, int> two;
google
chromium
enum6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum6.C
229
utf_8
5a96d9ee2ceb86e0a460ce4cb00b069b
// PR c++/37946 // { dg-options "-std=c++0x" } enum class E : char { e1, e2 }; inline E operator| (E a1, E a2) { char ret = static_cast<char> (a1) | static_cast<char> (a2); return static_cast<E>(ret); }
google
chromium
initlist48
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist48.C
181
utf_8
3cabc9eea3b0869b547347b8b8123b80
// PR c++/48726 // { dg-options -std=c++0x } #include <memory> struct Foo{ int i; }; typedef std::unique_ptr<Foo> up; std::initializer_list<up> il{up{new Foo}, up{new Foo}};
google
chromium
decltype19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype19.C
570
utf_8
e86f2566a0428c2818b33bdb0b6a0984
// PR c++/42013 template<typename _Tp> _Tp __attribute ((const)) declval(); template<typename _Tp, typename _Up> struct common_type { typedef __decltype(true ? declval<_Tp>() : declval<_Up>()) typet; typedef __decltype(false ? declval<_Tp>() : declval<_Up>()) typef; }; template<typename, typename> s...
google
chromium
variadic34
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic34.C
257
utf_8
a5a7ff3f76db794e3fb5e07d6c505021
// { dg-options "-std=gnu++0x" } template<int I, typename... Args> void get_ith(const Args&... args); void f() { get_ith<1>(1, 2, 3); get_ith<1, int>(1, 2.0, 'x'); get_ith<1, int, double>(1, 2.0, 'x'); get_ith<1, int, double, char>(1, 2.0, 'x'); }
google
chromium
nsdmi4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi4.C
218
utf_8
ab3558f498cc8da803a2fe1413ec03aa
// { dg-do run } // { dg-options -std=c++0x } int c; struct A { A() { } A(const A&) { } }; A f() { ++c; return A(); } struct B { A a = f(); }; int main() { B b1, b2; if (c != 2) __builtin_abort(); }
google
chromium
overload
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/overload.C
11,405
utf_8
784231660cd68e2cce90f217f07f893f
// { dg-options "--std=c++0x" } // { dg-do link } // Generated by overload.py template<typename _Tp> inline _Tp&& movel(_Tp& __t) { return static_cast<_Tp&&>(__t); } struct S{}; S l; // lvalue (l) S const cl = l; // const lvalue (cl) S r() { return l; } // rv...
google
chromium
nsdmi-template1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
288
utf_8
a991f089eb46483c38cc2db17004d0a7
// { dg-do run } // { dg-options -std=c++0x } struct base { int calc_avg() { return 42; } }; template <class T> struct nsdmi : T { nsdmi() {} int avg() { return avg_; } int avg_ = this->calc_avg(); }; int main() { nsdmi<base> x; if (x.avg() != 42) __builtin_abort(); }
google
chromium
enum10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum10.C
122
utf_8
535003083f8fc0b0820a57f7f2f3a589
// PR c++/48534 // { dg-options -std=c++0x } enum class OpSE : bool; int main() { return static_cast<bool>(OpSE()); }
google
chromium
pr31993
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31993.C
162
utf_8
768b8078f11c2cd0df3f94ec3bf1b895
// { dg-options "-std=c++0x" } template<typename...> struct A; template<template<int> class... T> struct A<T<0>...> { template<int> struct B {}; B<0> b; };
google
chromium
variadic83
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic83.C
239
utf_8
c97406e379935ecd6f83c7d4d33ae631
// PR c++/31441 // { dg-options "-std=gnu++0x" } template<typename> struct A; template<typename... T> struct A<T...> { }; // { dg-bogus "cannot expand" "" { xfail *-*-* } } A<int> a; // { dg-bogus "incomplete type" "" { xfail *-*-* } }
google
chromium
constexpr-non-const-arg2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C
350
utf_8
d5ee15d9b806558619308df68d9342ba
// PR c++/47200 // { dg-options "-std=c++0x -w" } template < int > struct duration { constexpr int count (); static constexpr duration min (); }; constexpr int f (duration < 0 > d, duration < 0 > ) { return d.count (); } static_assert (f (duration < 0 >::min (), duration < 0 > ()), ""); // { dg-error "non-cons...
google
chromium
error2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/error2.C
188
utf_8
ec1091145e02c8aa85de065481f9afda
// PR c++/38656 // { dg-options "-std=c++0x" } template<int> int foo(); template<typename F> void bar(F f) { f((foo<0>()=0)...); // { dg-error "pattern '\\(foo\\<0\\>\\)\\(\\)=0'" } }
google
chromium
noexcept07
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept07.C
343
utf_8
ba7bf39b764001a846db6c71b21c6a10
// Test that checking of a nothrow specification uses the one on the // definition. // { dg-options "-std=c++0x" } // { dg-do run } #include <exception> #include <cstdlib> void my_unexpected () { std::exit (0); } void f() noexcept; void f() throw() { throw 1; } int main() { std::set_unexpected (my_unexpected)...
google
chromium
sfinae7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae7.C
264
utf_8
479a282e75f311937c971ca5d619fc08
// { dg-options -std=c++0x } struct A { void f(); void f(int); typedef int g; }; template <class T> decltype (T::f) f(); template <class T> void f(); template <class T> decltype (T::g) g(); template <class T> void g(); int main() { f<A>(); g<A>(); }
google
chromium
initlist15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist15.C
373
utf_8
7a91ce06a7f3ce6920ffa410c3f2a157
// { dg-options "-std=c++0x" } // Just discard errors pointing at header files // { dg-prune-output "include" } #include <vector> #include <typeinfo> using namespace std; template< typename ... ArgTypes > void test( ArgTypes ... args ) { vector<type_info*> x = { &typeid(ArgTypes)... }; // { dg-error "" } } int ...
google
chromium
variadic19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic19.C
613
utf_8
889187171d4926a249fbd74039393097
// { dg-options "-std=gnu++0x" } template<typename... Args> struct tuple { static const int value = 0; }; template<typename T, template<class T> class... Metafunctions> struct tuple<Metafunctions<T>...> { static const int value = 1; }; template<typename T> struct add_pointer; template<typename T> struct add_refer...
google
chromium
sfinae25
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae25.C
208
utf_8
d00845b3e53d8808eed50b8636efd0a8
// PR c++/49105 // { dg-options -std=c++0x } template<class T, class = decltype(T{})> char f(int); template<class T> auto f(...) -> char(&)[2]; static_assert(sizeof(f<const int&&>(0)) == 1, "Error"); // #
google
chromium
variadic-lambda
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-lambda.C
1,830
utf_8
d27ab0ca2e970e8b526763be97fd98e7
// { dg-options "-std=c++0x" } struct int_placeholder; template<typename T> struct do_replace { typedef T type; }; template<> struct do_replace<int_placeholder> { typedef int type; }; template<typename T> struct lambdalike { typedef T type; }; template<template<typename...> class TT, typename... Args> struct...
google
chromium
constexpr-generated1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C
320
utf_8
b1f9e1efd6fbdbaccdf3302753a4c3f8
// { dg-options -std=c++0x } template <class T> struct A { constexpr T f (); }; int g(); // We should complain about this. template<> constexpr int A<int>::f() { return g(); } // { dg-error "non-constexpr" } // But not about this. struct B { int i; constexpr B(int i = g()):i(i) { } }; struct C: B { }; C c;
google
chromium
error4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/error4.C
410
utf_8
d6bdc88765d625f734a50ea12624fe82
// PR c++/49156 // { dg-options -std=c++0x } template<typename T> T declval(); template<typename T> struct S { template<typename U> static U get(const volatile T&); template<typename U> static decltype(*declval<U>()) get(...); // { dg-error "operator*" } typedef decltype(get<T>(declval<T>())) type; /...
google
chromium
reference_collapsing
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/reference_collapsing.C
7,329
utf_8
2dd310aa31b211b87c38209f2ae84388
// I, Howard Hinnant, hereby place this code in the public domain. // Test the reference collapsing rules. Note that there are recent differences // for how cv-qualifications are applied to reference types. 7.1.3, 14.3.1 // { dg-do compile } // { dg-options "-std=c++0x" } template <bool> struct sa; template <> s...
google
chromium
constexpr-neg1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C
1,896
utf_8
de4ad340d6c0d71c6c438cd3832d7e2b
// Negative examples from N3092 (FCD) // { dg-options -std=c++0x } // OK: declaration constexpr int square(int x); // { dg-message "never defined" } // error: pixel is a type constexpr struct pixel { int x; int y; // OK: declaration constexpr pixel(int); }; // { dg-error "constexpr" } constexpr pixel::pixe...
google
chromium
constexpr-noexcept2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept2.C
289
utf_8
a64472887f7aeb404a81d91f186d4048
// { dg-options -std=c++0x } template<class T> constexpr T value(T t) { return t; } template<class T> struct is_funny { static constexpr bool value = false; }; template<class T> void eval() noexcept(value(is_funny<T>::value)) {} constexpr bool ok = noexcept(eval<int>()); // line 12
google
chromium
constexpr-pedantic
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-pedantic.C
391
utf_8
5a0b38f7e72b94264445af220a4a9571
// The FCD doesn't allow typedefs and static_assert in constexpr functions, // but it should. // { dg-options "-std=c++0x -pedantic" } template <class T> constexpr T f(T t) { typedef T T2; // { dg-warning "constexpr" "" { xfail *-*-* } } static_assert (T2(0) == T(0), ""); // { dg-warning "constexpr" "" { xf...
google
chromium
enum11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum11.C
446
utf_8
ec5b2b5ac85874e8d62de22c93395d27
// PR c++/48969 // { dg-options "-std=c++0x -ftemplate-depth=10" } template<unsigned int N> struct Pair { }; struct Foo { enum { Mask = 1 }; } foo; template<typename A, typename B> class Pair<A::Mask | B::Mask> operator|(const A &, const B &) // { dg-message "substitution" } { } Pair<Foo::Mask> f = foo|foo; // { dg-m...
google
chromium
constexpr-incomplete2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
385
utf_8
aa48bc39f29172915e3d568bfbebee63
// A constructor that might or might not be constexpr still makes // its class literal. // { dg-options -std=c++0x } template <class T> struct B { constexpr B(T) { } constexpr B() {} }; struct A { B<A> b; }; constexpr A a {}; template <class T> struct C { constexpr C(T) { } C() {} }; struct D { C<D> c;...
google
chromium
variadic-ex5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex5.C
182
utf_8
815176396f7bae2155254aba877dc22c
// { dg-options "-std=gnu++0x" } template<typename... Types> void f(Types... values); void g() { f<int*, float*>(0, 0, 0); // Types is deduced to the sequence int*, float*, int }
google
chromium
initlist22
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist22.C
814
utf_8
8d49602ac78e8cda969acb321aa9965f
// Core issue 934 // { dg-options "-std=c++0x" } int i; int& r1{ i }; // OK, direct binding int&& r2{ i }; // { dg-error "" } binding && to lvalue int& r3{ }; // { dg-error "" } reference to temporary int&& r4{ }; // OK, reference to temporary struct A { int i; } a; A& r5 { i }; // { dg-error "" } refere...
google
chromium
constexpr-template1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-template1.C
463
utf_8
8b3ed3d6cf4068c9d3fdfece45008782
// PR c++/50248, DR 1358 // { dg-options -std=c++0x } template<class Elt, unsigned max> struct earray { Elt elts[max]; earray() = default; template<typename... Elt2> constexpr earray(Elt2&& ... e): elts(0) { } }; struct SessionData { SessionData(SessionData&) = delete; SessionData() = default;...
google
chromium
constexpr-synth1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C
136
utf_8
095edbfb3aae0b0d5b50bf95f67e083e
// PR c++/46472 // { dg-options -std=c++0x } template<class T> struct A { T t; constexpr A(){} }; struct B { A<int> a; }; B b;
google
chromium
sfinae28
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae28.C
315
utf_8
c33e979a5064f24252ec45a3567cd940
// PR c++/50324 // { dg-options -std=c++0x } struct complete { }; struct incomplete; template<class T> auto f(T *) -> decltype(T{}) *; template<class T> char f(T); int main() { complete *p = 0; static_assert(sizeof(f(p)) == sizeof(void*), ""); incomplete *q = 0; static_assert(sizeof(f(q)) == 1u, ""); }
google
chromium
constexpr-ctor9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor9.C
184
utf_8
713b038c201f25113cbd026d7ed42054
// PR c++/47774 // { dg-options -std=c++0x } struct A { A() {} }; template <typename T> struct array { constexpr array() : mem() {} T mem[7]; }; int main() { array<A> ar; }
google
chromium
constexpr-initlist3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist3.C
222
utf_8
a96736112de707d2aac1b4ff7be2b8fe
// { dg-options -std=c++0x } #include <initializer_list> #define SA(X) static_assert(X,#X) constexpr int f(std::initializer_list<int> l) { return l.begin()[0]; } int main() { constexpr int i = f({42}); SA(i==42); }
google
chromium
variadic41
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic41.C
282
utf_8
b7f360c027c5a8417a4485b18b70bda1
// A function parameter pack is only deduced if it's at the end // { dg-options "-std=gnu++0x" } template<typename... Args> void f(const Args&... args, int oops); int main() { f<>(1); f(1); f<int>(1,2); f(1,2); // { dg-error "no match" } } // { dg-prune-output "note" }
google
chromium
auto5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto5.C
259
utf_8
fd8b8fe7fe5a5692d13a285ecdb8f37d
// Testcase for non-dependent auto in templates // { dg-options "-std=c++0x" } struct A { template<class> void f(); } a; template <class T> void g() { auto aa = a; aa.f<int>(); auto p = new auto (a); p->f<int>(); } int main() { g<double>(); }
google
chromium
dependent1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/dependent1.C
591
utf_8
26ffaaea937dea1cd3e6293db9b589e0
// PR c++/48319 // { dg-options -std=c++0x } // We were failing to recognize declval<_Args1> as dependent. template<typename Tp> Tp declval() noexcept; template<typename _Tp> class __is_constructible_helper { typedef char __one; typedef struct { char __arr[2]; } __two; template<typename _Tp1, typename... _Args...
google
chromium
nullptr03
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr03.C
235
utf_8
3855c82744e3ead00bbf18a01719a246
// { dg-do compile } // { dg-options "-std=c++0x" } // Test assignment to int const int n1 = nullptr; // { dg-error "cannot convert " } decltype(nullptr) mynull = 0; const int n2 = mynull; // { dg-error "cannot convert " }
google
chromium
variadic-tuple
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C
7,391
utf_8
4368dd7da70ec6c76395bdc7ebbdd72e
// { dg-do run } // { dg-options "-std=gnu++0x" } // An implementation of TR1's <tuple> using variadic teplates #include <string> #include <cassert> #include <cstring> // Trivial reference_wrapper template<typename T> struct reference_wrapper { reference_wrapper(T& x) : ptr(&x) { } operator T&() const { return *ptr...
google
chromium
constexpr-wstring1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-wstring1.C
1,026
utf_8
51fdd051ce3db4219c5d1b41106cb6ed
// PR c++/48570 // { dg-do run } // { dg-options "-std=c++0x" } extern "C" void abort (); constexpr wchar_t foo (int i) { return L"0123"[i]; } constexpr char16_t bar (int i) { return u"0123"[i]; } constexpr char32_t baz (int i) { return U"0123"[i]; } const wchar_t foo0 = foo (0); const wchar_t foo1 = foo (1); const wc...
google
chromium
rv3n
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv3n.C
37,958
utf_8
1e4d2043226e358ae196efea5ce612a1
// I, Howard Hinnant, hereby place this code in the public domain. // Test overload resolution among reference 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 ...
google
chromium
initlist46
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist46.C
294
utf_8
2851931791242fa30b4f8f04f59373d5
// PR c++/48281 // { dg-options "-std=c++0x -O2" } // { dg-do run } #include <initializer_list> typedef std::initializer_list<int> int1; typedef std::initializer_list<int1> int2; static int2 ib = {{42,2,3,4,5},{2,3,4,5,1},{3,4,5,2,1}}; int main() { return *(ib.begin()->begin()) != 42; }
google
chromium
constexpr-diag2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C
155
utf_8
2b468e61a5e6baff99495cc15f0821c8
// PR c++/47207 // { dg-options -std=c++0x } constexpr int X (X); // { dg-error "not usable" } // { dg-message "own initializer" "" { target *-*-* } 4 }
google
chromium
constexpr-potential1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-potential1.C
206
utf_8
65c9a70abfe89a3b9a5ea58a236ab27a
// { dg-options -std=c++0x } // We decided in Rapperswil that it's OK if any value of decide can produce // a constant expression. constexpr int may_throw(bool decide) { return decide ? 42 : throw -1; }
google
chromium
defaulted11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted11.C
213
utf_8
d643a886132e6e38e0317b9432fb3745
// Core issue 901 // { dg-options "-std=c++0x" } struct A { A(); ~A(); void operator delete (void *) = delete; void operator delete[] (void *) = delete; }; int main() { A* ap = new A; ap = new A[2]; }
google
chromium
initlist6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist6.C
394
utf_8
b19685379b0985bb49fa641f27aa5b00
// Test for initlist lifetime // { dg-options "-std=c++0x" } // { dg-do run } #include <initializer_list> int c; struct A { A(int,int) { ++c; } ~A() { --c; } }; void f (std::initializer_list<A> l) { } int main() { f({ {1,2}, {3,4} }); if (c != 0) return 1; { std::initializer_list<A> l { {1,2}, {...
google
chromium
constexpr-array2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array2.C
232
utf_8
76c111cf1afe25862b167e8116e6ae47
// PR c++/46348 // { dg-options -std=c++0x } template<__SIZE_TYPE__ _Nw> struct _Base { typedef unsigned long _WordT; _WordT _M_w[_Nw]; constexpr _Base() : _M_w() { } }; int main() { _Base<256> bs; }
google
chromium
decltype33
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype33.C
429
utf_8
094dc72e2a075ad9d664b5e96b144ee7
// PR c++/50084 // { dg-options "-std=c++0x -fno-inline" } template<typename> struct remove_reference; template<typename T> struct remove_reference<T&> { typedef T type; }; template <class T> void f(T) { } void g() { struct { } * v = 0; typedef remove_reference<decltype(*v)>::type at; // The typedef should...
google
chromium
pr34056
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34056.C
266
utf_8
cd35023d6996f43d62bf64762abdc8f5
// PR c++/34056 // { dg-do compile } // { dg-options "-std=c++0x" } template<typename... T> struct A { void foo (T *) { ++p; } // { dg-error "not expanded|T" } void bar (T **) { } // { dg-error "not expanded|T" } T *p; // { dg-error "not expanded|T" } };
google
chromium
defaulted19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted19.C
302
utf_8
c7938c50352f8e5e741e041dfe5cc5a2
// We allocate a cookie to help us run the destructor even if it's deleted. // { dg-options -std=c++0x } // { dg-do run } struct A { ~A() = delete; }; void *p = 0; void *operator new[](__SIZE_TYPE__ t) { p = ::operator new (t); return p; } int main() { A* ap = new A[5]; return ap == p; }
google
chromium
constexpr-nonstatic
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-nonstatic.C
83
utf_8
11c671f15530ca0c9a28d26f141931ad
// { dg-options -std=c++0x } struct A { constexpr int i; // { dg-error "" } };
google
chromium
inline-ns2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C
657
utf_8
6ef63a264edb758081f0872b0a6091be
// { dg-options -std=c++0x } namespace Q { inline namespace V1 { extern int i; // { dg-error "" } extern int j; // { dg-error "" } void f(); // { dg-error "" } void g(); // { dg-error "" } } inline namespace V2 { extern int j; // { dg-error "" } void g(); // { dg-error "" } } ...
google
chromium
constexpr-defarg
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-defarg.C
138
utf_8
c4b5100289e4cbebb6e5db056674cca3
// PR c++/46335 // { dg-options -std=c++0x } struct T { }; struct A { A(const T &tr =T()) {} }; struct B { A k; }; B kk_; A fk_;
google
chromium
explicit5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit5.C
307
utf_8
81c47e5910cc3b64565a2df4059cfede
// test for extension of DR 899 to handle template ctors // { dg-options "-std=c++0x" } // { dg-do run } int r = 1; struct C { C() { } template <class T = int> C(C&, T = 0) { r = 0; } }; C c; struct A { explicit operator C&() const { return c; } }; int main() { A a; C c2 (a); return r; }
google
chromium
sfinae27
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae27.C
382
utf_8
39b8aa1a44586445c4873e9268bae018
// PR c++/50157 // { dg-options -std=c++0x } template<class T> T val(); template<class T, class Arg, class = decltype(::new T(val<Arg>())) > auto test(int) -> char; template<class, class> auto test(...) -> char (&)[2]; struct P { explicit operator bool(); // (#13) }; typedef decltype(test<bool, P>(0)) type; //...
google
chromium
union4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/union4.C
220
utf_8
6c75a78f9842e0de7db86f3c9797819d
// PR c++/48537 // { dg-options -std=c++0x } struct SFoo { SFoo() =delete; // { dg-error "declared" } }; union UFoo // { dg-error "deleted" } { SFoo foo; }; int main() { UFoo(); // { dg-error "deleted" } }
google
chromium
constexpr-using
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-using.C
488
utf_8
8bd37865f97f756b026a6f1d677f07df
// Core issue 898 // { dg-options -std=c++0x } namespace N { const int i = 42; } namespace M { const int j = 42; } constexpr int g() { using namespace N; using M::j; static_assert (i == 42, "i == 42"); return i + j; } template <class T> constexpr int h() { using namespace N; using M::j; static_assert (...
google
chromium
pr45908
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr45908.C
353
utf_8
42332a58dc7949c563a9cb80f9276005
// PR c++/45908 // { dg-do compile } // { dg-options "-std=c++0x" } struct vector { struct iterator { }; struct const_iterator { }; iterator begin(); const_iterator begin() const; }; class block { vector v; auto end() const -> decltype(v.begin()) { return v.begin(); } };
google
chromium
variadic15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic15.C
677
utf_8
6ed2e036536de09852464be3cd9a350a
// { dg-options "-std=gnu++0x" } template<typename R, typename... ArgTypes> struct make_function_type { typedef R type(const ArgTypes&...); }; 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...
google
chromium
sfinae13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae13.C
298
utf_8
02df03121955ee9d4dfb832249d983cf
// PR c++/48581 // { dg-options -std=c++0x } template<class T> T&& create(); template<class T, class = decltype(foo(create<T>())) > auto f(int) -> char; template<class> auto f(...) -> char (&)[2]; struct S {}; void foo(S); static_assert(sizeof(f<S>(0)) == 1, "Error"); // (#) int main() {}
google
chromium
decltype28
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype28.C
445
utf_8
f45d4ed9b1042df6b3803072a050c6c2
// PR c++/44175 // { dg-options -std=c++0x } template <bool, class T> struct enable_if { }; template <class T> struct enable_if <true, T> { typedef T type; }; template <class F, int N> void ft (F f, typename enable_if<N!=0, int>::type) {} template< class F, int N > decltype(ft<F, N-1> (F(), 0)) ft (F f, typename ena...
google
chromium
initlist39
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist39.C
174
utf_8
19f075707b95286a27988dd3515abe3e
// { dg-options -std=c++0x } struct A { int i; }; void f (const A &); void f (A &&); void g (A, int); void g (A, double); int main() { f ( { 1 } ); g ( { 1 }, 1 ); }
google
chromium
range-for4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for4.C
2,044
utf_8
c8383e1b578f4ab5ed11fd681786cd14
// Test for range-based for loop with templates // { dg-do run } // { dg-options "-std=c++0x" } /* Preliminary declarations */ namespace pre { struct iterator { int x; iterator (int v) :x(v) {} iterator &operator ++() { ++x; return *this; } int operator *() { return x; } bool operator != (const ...
google
chromium
variadic-104
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-104.C
295
utf_8
86774786c5606ac1f419faaf0943a12d
// PR c++/45236 // { dg-options -std=c++0x } template <class T, class S> class foo; template<template<int...> class C, int... II, class S> struct foo<C<II...>,S> { template <class U> struct bar { typedef int type; }; }; template <int... I> struct A {}; foo<A<3>, float>::bar<int> x;
google
chromium
variadic13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic13.C
719
utf_8
783f5b8f3855933722495d6a6f85bf18
// { dg-options "-std=gnu++0x" } template<typename... Args> struct tuple1 { }; template<typename... Args> struct tuple2 { }; template<typename T, typename U> struct same_tuple_args { static const bool value = false; }; template<typename... Args> struct same_tuple_args<tuple1<Args...>, tuple2<Args...> > { static c...
google
chromium
decltype3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype3.C
1,583
utf_8
75bedaba5388b7321e77b97d8abc1697
// { dg-do compile } // { dg-options "-std=gnu++0x" } 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; }; #define CHECK_DECLTYPE(DECLTYPE,RESULT) \ static_assert(is_same< DECLTYPE , RESULT >::value, ...
google
chromium
constexpr-base
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-base.C
348
utf_8
e3446639fc7bf5fd777e976dc13fa679
// Test base/member class and static_assert with constexpr // { dg-options -std=c++0x } struct A { int i; constexpr A(int _i): i(_i) { } }; struct B: A { A a; int j; constexpr B(int _ib, int _ia, int _j): A(_ib), a(_ia), j(_j) { } }; constexpr B b (12, 24, 36); #define SA(X) static_assert (X, #X) SA(b.i==1...
google
chromium
pr31439
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31439.C
301
utf_8
68f62316f1b2ff1e8fe55d5a940adfdd
// { dg-options "-std=c++0x" } template<typename...> struct A; // { dg-error "declaration" } template<char> struct A<> {}; // { dg-error "not used in partial specialization|anonymous" } template<typename T, typename... U> struct A<T, U...> : A<U...> {}; // { dg-error "incomplete type" } A<int> a;
google
chromium
decltype14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype14.C
148
utf_8
4ec2723baddfc9d905467688b0a93e32
// PR c++/37540 struct A { int g() {return 0;} }; template <typename T_> void f(A a) { __decltype(a.g()) i; } int main() { f<int>(A()); }
google
chromium
initlist31
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist31.C
259
utf_8
c0e87daba12a60cc40ee522c73e8ef87
// PR c++/43028 // { dg-options "-std=c++0x" } #include <initializer_list> struct string { string(std::initializer_list<char>) { } }; void f() { auto y = { string(Equation()) // { dg-error "not declared" } }; // { dg-error "unable to deduce" } }
google
chromium
variadic-ex9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex9.C
428
utf_8
6669599e2ab36b110102b547028387b6
// { dg-options "-std=gnu++0x" } template<typename... Args> char& f(Args... args); // #1 template<typename T1, typename... Args> short& f(T1 a1, Args... args); // #2 template<typename T1, typename T2> int& f(T1 a2, T2 a3); // #3 void g() { char& x = f(); // cal...
google
chromium
elision2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/elision2.C
173
utf_8
4cbd59cdf066f98bcb7de247cd792cd6
// Core 1148: should be able to move from value parameter on return // { dg-options -std=c++0x } struct A { A(const A&) = delete; A(A&&); }; A f (A a) { return a; }
google
chromium
variadic-throw
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
435
utf_8
895d8c8b56e3d2f9e7ab5be925034d3a
// { dg-options -std=c++0x } // { dg-prune-output "note" } // PR c++/33509 template<int M, int N> struct pair { int i, j; pair() : i(M), j(N) {} }; template<int... M> struct S { template<int... N> static int foo() throw (pair <M, N>...) // { dg-error "mismatched" } { return 1; } }; int bar () { return...
google
chromium
constexpr-union
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-union.C
396
utf_8
65f17c3ddfb6594c3c324123756fb680
// Test that we don't have to deal with type punning // DR 1188 says this is ill-formed // { dg-options -std=c++0x } union U { float f; unsigned char ca[sizeof(float)]; }; constexpr U u = { 1.0 }; constexpr float f = u.f; constexpr unsigned char c = u.ca[0]; // { dg-error "U::ca" } constexpr double d = 1.0; cons...
google
chromium
variadic-ex8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex8.C
823
utf_8
69a34444b58e83f3dc18d0e759baf595
// { dg-options "-std=gnu++0x" } template<class> struct X { static const bool primary = true; }; template<class R, class... ArgTypes> struct X<R(int, ArgTypes...)> { static const bool primary = false; }; template<class... Types> struct Y { static const bool primary = true; }; template<class T, class... Types> struct...
google
chromium
enum_base_warn
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum_base_warn.C
424
utf_8
bf868bae8ff5bad206ff223cb32f9072
// { dg-do run } // { dg-options "-O2 -Wtype-limits -std=c++0x" } extern void link_error (void); enum Alpha : unsigned char { ZERO = 0, ONE, TWO, THREE }; Alpha a2; int m1 = -1; int GetM1() { return m1; } int main() { a2 = static_cast<Alpha>(GetM1()); if (a2 == -1) { // { dg-warning "always false due" } lin...
google
chromium
error3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/error3.C
260
utf_8
511de3e8dd63b9606140f8d3d6e5d938
// PR c++/47336 // { dg-options -std=c++0x } template <typename T> void g(T t) { t+1; // { dg-error "no match" } } template <typename S> class C { struct D {} d; public: decltype(g(d)) h() { return g(d); } }; int main() { C<int>().h(); }
google
chromium
constexpr-46420
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-46420.C
237
utf_8
3b3f7cd3323c5af47ac07622a97488b7
// PR c++/46420 // { dg-options -std=c++0x } template<typename> class vector { }; struct A{}; template <class T1> void complete_test(vector<T1> data1){ A drop=A(); } int main(){ vector<double> vect1; complete_test(vect1); }
google
chromium
initlist-value
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist-value.C
612
utf_8
3379e3a179c2e4027dde434bb897ead0
// Test for value-initialization via {} // { dg-options -std=c++0x } // { dg-do run } void * operator new (__SIZE_TYPE__, void *p) { return p; } void * operator new[] (__SIZE_TYPE__, void *p) { return p; } // Empty base so A isn't an aggregate struct B {}; struct A: B { int i; }; struct C: A { C(): A{} {} }; in...
google
chromium
inline-ns4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/inline-ns4.C
102
utf_8
b0c5ed66fb6bc8597e3d516e4ce3f396
// { dg-options "-std=gnu++98 -pedantic" } inline namespace { } // { dg-warning "inline namespaces" }
google
chromium
constexpr-base3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-base3.C
308
utf_8
5555727c3e181ca9f184bca68bf441f8
// PR c++/46526 // { dg-do run } // { dg-options "-std=c++0x" } struct Base { virtual int getid () = 0; }; struct A : public Base { virtual int getid () { return 1; } }; struct B : public Base { virtual int getid () { throw "here"; } }; int main () { A a; B b; Base& ar = a; ar.getid (); }
google
chromium
initlist42
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist42.C
335
utf_8
fc560a0d4c94e9f95f4bf56e7430efa6
// { dg-options -std=c++0x } enum Unscoped { }; enum class Scoped { }; Unscoped bar(Unscoped x) { return x; } Scoped bar(Scoped x) { return x; } auto var1u = bar(Unscoped()); // OK auto var1s = bar(Scoped()); // OK auto var2u = bar(Unscoped{}); // #1 Error, but should work auto var2s = bar(Scoped{}); // #2 Error, b...
google
chromium
variadic113
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic113.C
373
utf_8
d37c9bd007b6c9d0b8d21756e2a65f65
// PR c++/49251 // { dg-options "-std=c++0x -Wunused-parameter" } struct A {}; template <int> int f(A); template< int... Indices > struct indices {}; template< class... Args > void sink( Args&&... ) {} template< class T, int... Indices > void unpack_test( T && t, indices<Indices...> ) { sink( f<Indices>(t)... ); ...
google
chromium
variadic26
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic26.C
655
utf_8
15323c0aa074c2cef89f77370fbea950
// { dg-options "-std=gnu++0x" } template<template<int, int> class Meta, int Initial, int... Values> struct accumulate { static const int value = Initial; }; template<template<int, int> class Meta, int Initial, int Value, int... Rest> struct accumulate<Meta, Initial, Value, Rest...> { static const int value = ...
google
chromium
temp_default3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/temp_default3.C
206
utf_8
84de15e07b6c82c85cd264f1e2e41bb1
// { dg-options "-std=c++0x" } template<typename T, typename U = typename T::value_type> void f(T); void f(...); struct X { typedef int value_type; }; void g() { f(X()); // okay f(17); // okay? }
google
chromium
constexpr-value2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-value2.C
510
utf_8
213357e480e4e1b2ced92b711e3ca2c8
// { dg-options -std=c++0x } template<class T> constexpr T value_init() { return T(); } template<class T> constexpr inline T bar(T x) { return x; } union EmptyUnion {}; union Union1 { int i; }; union Union3 { double d; int i; char* c; }; constexpr auto u1 = value_init<EmptyUnion>(); constexpr auto u2 = value_init<U...
google
chromium
range-for7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for7.C
2,177
utf_8
8e1354d3b02aa73b399e6d8367bf2c69
// PR c++/46056 // Check that range-based for loop calls destructors // when required // { dg-options "-std=c++0x" } // { dg-do run } extern "C" void abort(); int value_counter = 0, it_counter = 0, seq_counter = 0; struct Int { int x; Int(int v) :x(v) { ++value_counter; } Int(cons...
google
chromium
variadic63
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic63.C
83
utf_8
4fd21efb8e7dbf2adf626840e85c2242
// { dg-options "-std=gnu++0x -pedantic" } template<typename... Args> class tuple;
google
chromium
nsdmi-eh1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
249
utf_8
5450428be0477f7efc57fb8540f98154
// Core issue 1351 // { dg-do run { xfail *-*-* } } // { dg-options -std=c++0x } bool fail; struct A { int i = fail ? throw "noooooooo" : 42; }; int main() { A a1; if (a1.i != 42) return 1; fail = true; try { A a2; } catch (...) { } }
google
chromium
rv-restrict
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-restrict.C
175
utf_8
c537d32c684d6722fb0ca5ba48b54254
// PR c++/45401 // { dg-options -std=c++0x } typedef int &__restrict restrictLvref; typedef restrictLvref &&rvrefToRestrictLvref; typedef restrictLvref rvrefToRestrictLvref;
google
chromium
constexpr-ice2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ice2.C
59
utf_8
c1316ae04689c6816db58f167429dac8
// { dg-options -std=c++0x } int x; constexpr int& rx = x;
google
chromium
constexpr-initlist
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist.C
1,347
utf_8
ea3c6576bcd620ade48ff17e16e78733
// { dg-options -std=c++0x } // { dg-do run } namespace xstd { typedef decltype(sizeof(char)) size_t; template<class E> class initializer_list { private: size_t sz; const E* start; public: typedef E value_type; typedef const E& reference; typedef const E& const_reference; typedef size_t size_type; typede...
google
chromium
decltype-33838
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype-33838.C
152
utf_8
6c7df891cd8dd4306ac98d8d406ffd5f
// { dg-options -std=c++0x } // PR c++/33838 template<typename T> struct A { __decltype (T* foo()); // { dg-error "expected|no arguments|accept" } };
google
chromium
sfinae17
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae17.C
437
utf_8
988567dcd370241af1ba666d230d1eab
// PR c++/48530 // { dg-options -std=c++0x } template<class T, class = decltype(T{}) > char f(int); template<class> char (&f(...))[2]; struct DelDtor { ~DelDtor() = delete; }; static_assert(sizeof(f<DelDtor[2]>(0)) != 1, "Error"); struct A { static DelDtor *p; }; template<class T, class = decltype(delete ...
google
chromium
forw_enum4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum4.C
1,044
utf_8
701a19ffd15758403e282ca3dae58451
// { dg-do compile } // { dg-options "-std=c++0x" } template<typename T> struct S1 { struct S2 { // opaque enum declarations enum class E1; enum class E2 : T; enum class E3 : short; enum E4 : T; enum E5 : short; // can be repeated enum class E1; ...
google
chromium
constexpr-variadic
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-variadic.C
225
utf_8
443012f7b572f9e31cec22b76face1b0
// { dg-options -std=c++0x } template<class... T> constexpr bool variadics(T&&...) { return true; } struct IsLiteral {}; constexpr bool variadic_var = variadics(0, true, 1.2, IsLiteral{}); // Error, so below int main() {}
google
chromium
initlist-deduce
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist-deduce.C
520
utf_8
81d19e9429c014cc6fc39082d98b479d
// Test for deduction of T as std::initializer_list. This isn't currently // supported by the working draft, but is necessary for perfect forwarding // of initializer-lists to things that can take a std::initializer_list. // { dg-options -std=c++0x } // { dg-do run } #include <initializer_list> struct A { A(std::...
google
chromium
constexpr-incomplete3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete3.C
164
utf_8
546cce9e1deee10e3248691396626e44
// PR c++/49015 // { dg-options -std=c++0x } class A; class B { friend constexpr B f(A); // Line 5 }; class A {}; constexpr B f(A) { return B(); } // Line 10