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
extern_template-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/extern_template-1.C
105
utf_8
df498e0efc0a2951008f5bfc084b5d8f
// { dg-options "-std=c++0x -pedantic" } template <typename> void f() {} extern template void f<int>();
google
chromium
long_long
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/long_long.C
77
utf_8
4a0e724ac30f59cb40f4cf66c5eb935c
// { dg-options "-std=c++0x -pedantic" } void foo() { long long x = 17; }
google
chromium
defaulted6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted6.C
197
utf_8
d55216a62be51ae4ddecbd573454b5cd
// PR c++/37906 // { dg-options "-std=c++0x" } struct b { b() = default; b(const b&) = delete; }; void test01() { static_assert(__has_trivial_constructor(b), "default ctor not trivial"); }
google
chromium
defaulted3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
302
utf_8
d2ebff8fdd5f889b2f4ed9041465fe49
// PR c++/37006 // { dg-options "-std=c++0x" } template<class T> struct A { template<class U> bool operator==(const A<U>&) = delete; // { dg-error "deleted function" } operator bool () { return true; } }; int main() { A<int> a1; A<void> a2; if(a1 == a2) {} // { dg-error "used here" } }
google
chromium
variadic76
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic76.C
213
utf_8
874a81eb8f65d81680cca4518ed1c245
// PR c++/33496 // { dg-do compile } // { dg-options "-std=gnu++0x" } template<int... N> int foo () { return sizeof... N (); // { dg-error "cannot be used as a function" } } int bar () { return foo<0> (); }
google
chromium
pr32115
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32115.C
157
utf_8
c1b7f079bd668b594f6eb1d2ba1c6854
// { dg-options "-std=c++0x" } template<typename ...T, int = 0> struct A {}; // { dg-error "end of" } A<int> a; // { dg-error "mismatch|expected|invalid" }
google
chromium
decltype15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype15.C
207
utf_8
c3ec86cf924ef203f6d25765332c13ec
// PR c++/38640 // { dg-do compile } // { dg-options "-std=c++0x" } template<int N> void foo (decltype (N)); template<long int N> void foo (decltype (N)); void bar (void) { foo<5> (6); foo<5L> (6L); }
google
chromium
rv6p
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv6p.C
22,783
utf_8
3dda037dd9cb215ac9bf203f6665ca1d
// 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
variadic54
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic54.C
227
utf_8
301bf335a25b68e8f266634c4f36eec0
// { dg-options "-std=gnu++0x" } template<typename F, typename... BoundArgs> class bound_functor { public: bound_functor(); }; template<typename F, typename... BoundArgs> bound_functor<F, BoundArgs...>::bound_functor() { }
google
chromium
cast
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/cast.C
512
utf_8
62a7f347a0ca8319ed02c912432716b2
// I, Howard Hinnant, hereby place this code in the public domain. // Test cast from lvalue to rvalue // { 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(const A&) {return one();} ...
google
chromium
variadic25
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic25.C
342
utf_8
b06cea5f9c66b27dc3d3d19a6217154c
// { dg-options "-std=gnu++0x" } template<int... Values> struct sum; template<> struct sum<> { static const int value = 0; }; template<int Value, int... Values> struct sum<Value, Values...> { static const int value = Value + sum<Values...>::value; }; int a0[sum<>::value == 0? 1 : -1]; int a1[sum<1, 2, 3, 4, 5>::...
google
chromium
variadic84
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic84.C
908
utf_8
221e9719b7a3015ccd3f7255a480ae29
// PR c++/32565 // { dg-do compile } // { dg-options "-std=c++0x" } template<typename...> struct A1; template<template<int...> class T> struct A1<T<0> > {}; template<typename...> struct A2; template<template<int...> class T> struct A2<T<0, 1> > {}; template<typename...> struct A3; template<template<int, int...> class ...
google
chromium
elision
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/elision.C
1,032
utf_8
614bd2c770efa2ba339de0abcc46f4cb
// I, Howard Hinnant, hereby place this code in the public domain. // Test: Implicit cast to rvalue when eliding copy // { 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];}; class move_only { move_only(...
google
chromium
variadic1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic1.C
171
utf_8
bb6afbbf296083db4650ea62c40e7f80
// { dg-options "-std=gnu++0x" } template<typename...> class tuple; template<typename... Args> class tuple { }; template<typename T1, class... Args> class tuple1p { };
google
chromium
pr33839
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr33839.C
195
utf_8
33ff45fe18bdee32a83ed1fdfad581b7
// { dg-options -std=c++0x } template<int> struct A; void foo() { __decltype A<0>; // { dg-error "invalid declarator|expected" } __decltype (A<0>); // { dg-error "must be an expression" } }
google
chromium
variadic-new
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-new.C
271
utf_8
a5bef9fdebecb19720d8595d1210c21f
// { dg-do "run" } // { dg-options "-std=c++0x" } // Contributed by Peter Dimov // PR c++/32597 #include <assert.h> #include <new> int k = 5; template< class... Args > void f( Args... args ) { new( &k ) int( args... ); } int main() { f(); assert( k == 0 ); }
google
chromium
pr31432
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31432.C
256
utf_8
8d4acf95e9330d762724340eec4d20a0
// { dg-options "-std=gnu++0x" } template<typename..., typename> struct A // { dg-error "parameter pack" } { static int i; }; A<int, int> a; // { dg-error "mismatch|expected|invalid type" } A<char,int> b; // { dg-error "mismatch|expected|invalid type" }
google
chromium
initlist27
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist27.C
143
utf_8
d6492e6206eb4be3215f8b76de11bea1
// PR c++/42061 // { dg-do compile } // { dg-options "-std=c++0x" } int& i = { j }; // { dg-error "invalid initialization|was not declared" }
google
chromium
variadic52
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic52.C
180
utf_8
6b2e3d5143374b8c95565d681a482621
// { dg-options "-std=gnu++0x" } template<typename T, T... Values> struct vector_c { }; vector_c<int, 1, 2, 3> v1; vector_c<char, 'a', 'b', 'c'> v2; vector_c<long, 1u, 2, 3l> v3;
google
chromium
initlist2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist2.C
555
utf_8
b07e5a8dc17e52f03c788220d501f892
// Test that conversion to std::initializer_list takes priority over other // user-defined conversions. // { dg-do link } // { dg-options "-std=c++0x" } #include <initializer_list> struct string { string (const char *) {} template <class Iter> string (Iter, Iter); }; template <class T, class U> struct pair { ...
google
chromium
pr34057
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34057.C
190
utf_8
6ffd247ca2be2be780441467eb7dce45
// PR c++/34057 // { dg-do compile } // { dg-options "-std=c++0x" } template <typename... T> struct A { typedef T X __attribute__ ((vector_size (8))); // { dg-error "not expanded|T" } };
google
chromium
auto14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto14.C
409
utf_8
22834457eced7ff0d65e97187ae5a79b
// PR c++/40306, c++/40307 // { dg-options "-std=c++0x" } // { dg-do run } template< typename T > struct test { test run() { auto tmp = *this; return tmp; } test run_pass() { test tmp( *this ); return tmp; } test run_fail() { auto tmp( *this ); return tmp; } }; i...
google
chromium
elision_weak
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/elision_weak.C
118
utf_8
af521f07a34d29e505189640746f3ea0
// { dg-do compile } struct S { S() {} S(S&) {} }; S f() { S s; return s; } void g() { S s; throw s; }
google
chromium
initlist9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist9.C
454
utf_8
b047a90d8ab317f72f56eb04c872d3e7
// PR c++/37860 // { dg-options "-std=c++0x" } struct b { bool t; b() = default; ~b() = default; b& operator=(const b&) = delete; b(const b&) = delete; // { dg-error "deleted" } b(bool _t): t (_t) { } }; int main() { // copy list initialization b tst1 = { false }; // copy initialization. b tst...
google
chromium
decltype2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype2.C
1,257
utf_8
8e4636150244fc51b5ba40f24e50437c
// { 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
enum7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum7.C
292
utf_8
ec6b0bf4b17fabec5ae1aaf79db31e6f
// PR c++/37816 // { dg-options "-std=c++0x" } class A { enum class Color { Red, Orange, Yellow, Green, Blue, Violet }; enum class Alert { Green, Yellow, Red }; static const Color x = Red; // { dg-error "" } static const Color y = Color::Red; static const Alert z = Alert::Red; };
google
chromium
variadic81
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic81.C
221
utf_8
c50ca86b3c5889ab02daaecbb96d59b9
// PR c++/33461 // { dg-options "-std=gnu++0x" } template<typename> struct A; template<typename... T> struct A<T*> // { dg-error "not expanded|T|not used|T" } { struct B; }; A<void*> a; // { dg-error "incomplete" }
google
chromium
auto3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto3.C
573
utf_8
1e03d148c052b37bfdfafeb5db47dee0
// Negative test for auto // { dg-options "-std=c++0x" } #include <initializer_list> auto x; // { dg-error "auto" } // If the type deduced for the template parameter U is not the same in each // deduction, the program is ill-formed. auto i = 42, j = 42.0; // { dg-error "" "" { xfail *-*-* } } // New CWG issue a...
google
chromium
variadic18
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic18.C
1,011
utf_8
a235bb78ea18efc7b76823629a43177f
// { dg-options "-std=gnu++0x" } template<typename...> class tuple { }; template<typename T, template<typename T> class... Metafunctions> struct apply_all { typedef tuple<typename Metafunctions<T>::type...> type; }; template<typename T, typename U> struct is_same { static const bool value = false; }; template<ty...
google
chromium
pr34058
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34058.C
166
utf_8
6a5b31135f37628be4892ec76215d2a6
// PR c++/34058 // { dg-do compile } // { dg-options "-std=c++0x" } template <typename...T> struct A { typedef T X; // { dg-error "not expanded|T" } }; A<int> a;
google
chromium
initlist5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist5.C
740
utf_8
40bb48134a829e97a58bfec1928ca395
// Test for narrowing diagnostics // { dg-options "-std=c++0x" } #include <initializer_list> struct A { int i; int j; }; A a2 { 1.2 }; // { dg-error "narrowing" } A a1 { 1, 2 }; // aggregate initialization struct B { B(std::initializer_list<int>); }; B b1 { 1, 2 }; // creates initializer_list<int> and calls constr...
google
chromium
vt-37737-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C
159
utf_8
21083e5ee0d1039e33bda11cf5e195f3
// { dg-options "-std=c++0x" } void f() { } template<class U, class... T> void f(){ f<T...>(); } // { dg-error "no matching" } int main() { f<char>(); }
google
chromium
rv3p
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv3p.C
32,759
utf_8
e3984a55baa52a01cb63dfc0e8dd87f3
// 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
deduce
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/deduce.C
720
utf_8
60e95eb04b9d3bc3c37ed4c51d444e78
// { dg-options "--std=c++0x" } template<typename T, typename U> struct same_type; template<typename T> struct same_type<T, T> {}; int lval_int; int rval_int(); int const lval_const_int=0; int const rval_const_int(); template <typename T> void deduce_lval_int(T && t) { same_type<T, int &>(); } template <typename T...
google
chromium
defaulted2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
1,079
utf_8
b7f682e20b358418fc847777d5cfd70d
// Negative test for defaulted/deleted fns. // { dg-options "-std=c++0x" } void f(); // { dg-error "previous" } void f() = delete; // { dg-error "deleted" } struct A { A() { } // { dg-error "previous" } void f() = default; // { dg-error "default" } }; A::A() = default; // { dg-error "redefinition" } void...
google
chromium
variadic-ttp
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ttp.C
221
utf_8
0584fcdc603bce015231b5ea40e5ecba
// { dg-options -std=c++0x } // PR c++/34101 template<typename> struct A {}; template<template<typename> class...> struct B {}; template<template<typename> class T> void foo(const B<T>&); void bar() { foo(B<A>()); }
google
chromium
static_assert1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert1.C
399
utf_8
cc518678d11c27d38238be4776df21d5
// { dg-options "-std=c++0x" } void foo() { static_assert(1, "okay"); static_assert (0 == 1, "zero is never equal to one"); // { dg-error "never equal" } } class X { static_assert(1, "okay"); static_assert (0 == 1, "zero is never equal to one"); // { dg-error "never equal" } }; static_assert(1, "okay"); stati...
google
chromium
variadic39
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic39.C
303
utf_8
951b21c26ba104b2ab7d8d762bd2bec0
// { dg-options "-std=gnu++0x" } template<typename... Args> struct tuple {}; template<typename T, typename... Args> struct tuple<Args..., T> { }; // { dg-error "end" } template<int... Values> struct int_vec { }; template<int I, int... Values> struct int_vec<Values..., I> { }; // { dg-error "end" }
google
chromium
temp_default4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/temp_default4.C
355
utf_8
73c23f2dae4a3332cdef87694d9b06d5
// { dg-options "-std=c++0x" } class X { template<typename T = int> friend void f(X) { } template<typename T> friend void g(X); // { dg-error "previously declared here" } template<typename T = int> friend void h(X); // { dg-error "function template friend" } }; template<typename T = int> void g(X) // { dg-error...
google
chromium
variadic62
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic62.C
127
utf_8
71d58bebb24f823b96a6f96fcdba12d7
// { dg-options "-std=gnu++98 -pedantic-errors" } template<typename... Args> class tuple; // { dg-error "variadic templates" }
google
chromium
warn_cxx0x
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C
146
utf_8
faba28ff035a24c2911b9172d30c3e12
// { dg-options "-std=gnu++98 -Wc++0x-compat" } int static_assert; // { dg-warning "will become a keyword" } void foo() { static_assert = 5; }
google
chromium
variadic87
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic87.C
400
utf_8
3887c900d50685fb2ba16555185c042d
// PR c++/33965 // { dg-options -std=c++0x } template<typename T> struct foo { static bool const value = false; }; template<template<typename...> class T, typename... Args> struct foo<T<Args...> > { static bool const value = true; }; template<int I> struct int_ {}; int main() { static_assert(foo<int_<0> >:...
google
chromium
pr38795
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr38795.C
223
utf_8
e21108436dc5ce57312ddc9a096ec2db
// PR c++/38795 // { dg-do compile } // { dg-options "-std=gnu++0x" } template<typename... T> int foo(int i) { return *reinterpret_cast<T*>(i); // { dg-error "not expanded with|T" } } void bar(int i) { foo<int>(i); }
google
chromium
variadic7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic7.C
758
utf_8
5b504e24aee13a1f1be99a4c933d7706
// { dg-options "-std=gnu++0x" } template<typename... Args> struct tuple_base { static const int value = 0; }; template<> struct tuple_base<int> { static const int value = 1; }; template<> struct tuple_base<int, float> { static const int value = 2; }; template<> struct tuple_base<float, int> { static const i...
google
chromium
initlist13
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist13.C
144
utf_8
63773513594757c4c4161676c5af7468
// PR c++/39056 // { dg-do compile } // { dg-options "-std=gnu++0x" } #include <complex> __complex__ int i ({0}); std::complex<int> i2 ({0});
google
chromium
auto4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto4.C
530
utf_8
8754523bb1846890e4b8d81b2740ba1e
// Testcase for deduction of std::initializer_list for auto. // { dg-do run } // { dg-options "-std=c++0x" } #include <typeinfo> #include <initializer_list> extern "C" void abort(); template <class T> void f (T t) { auto ilt = { &t, &t }; if (typeid(ilt) != typeid(std::initializer_list<T*>)) abort(); auto ...
google
chromium
variadic14
.C
native_client/nacl-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
variadic6
.C
native_client/nacl-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/nacl-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
variadic34
.C
native_client/nacl-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
overload
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/overload.C
11,255
utf_8
024dbba780b4ddae1997baffae78e4c7
// { dg-options "--std=c++0x" } // { dg-do link } // Generated by overload.py struct S{}; S l; // lvalue (l) S const cl = l; // const lvalue (cl) S r() { return l; } // rvalue (r) S const cr() { return l; } // const rvalue (cr) S & nl = l; ...
google
chromium
pr31993
.C
native_client/nacl-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/nacl-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
initlist15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist15.C
291
utf_8
3864f9848076d8d646afb07c367c806b
// { dg-options "-std=c++0x" } #include <vector> #include <typeinfo> using namespace std; template< typename ... ArgTypes > void test( ArgTypes ... args ) { vector<type_info*> x = { &typeid(ArgTypes)... }; // { dg-error "" } } int main() { test( 1, 3.14f, 2.78 ); return 0; }
google
chromium
variadic19
.C
native_client/nacl-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
variadic-lambda
.C
native_client/nacl-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
reference_collapsing
.C
native_client/nacl-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
variadic-ex5
.C
native_client/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist22.C
796
utf_8
4bdc8b28203fe557b8c5257e826d9e95
// Core issue 934 // { dg-options "-std=c++0x" } int i; int& r1{ i }; // OK, direct binding int&& r2{ i }; // OK, direct binding int& r3{ }; // { dg-error "" } reference to temporary int&& r4{ }; // OK, reference to temporary struct A { int i; } a; A& r5 { i }; // { dg-error "" } reference to temporary A...
google
chromium
variadic41
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic41.C
121
utf_8
f644441efd07d9c78d08c0c4d120b7f7
// { dg-options "-std=gnu++0x" } template<typename... Args> void f(const Args&... args, int oops); // { dg-error "end" }
google
chromium
auto5
.C
native_client/nacl-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
variadic-tuple
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C
7,393
utf_8
f931cf5d1654ae4d7fb0f5c475bb7f6b
// { dg-options "-std=gnu++0x" } // { dg-do "run" } // 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 *p...
google
chromium
rv3n
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv3n.C
19,626
utf_8
25844518c6a118cce05cbe065baca9e4
// 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
initlist6
.C
native_client/nacl-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
pr34056
.C
native_client/nacl-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
variadic15
.C
native_client/nacl-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
variadic13
.C
native_client/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype3.C
1,585
utf_8
8fc62db200adb5d7fb2b1d4ec897fbe4
// { 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
pr31439
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31439.C
237
utf_8
8d3383cdc1fb385e8fa753a53991fb1a
// { dg-options "-std=c++0x" } template<typename...> struct A; template<char> struct A<> {}; // { dg-error "not used in partial specialization|anonymous" } template<typename T, typename... U> struct A<T, U...> : A<U...> {}; A<int> a;
google
chromium
decltype14
.C
native_client/nacl-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
variadic-ex9
.C
native_client/nacl-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
variadic-throw
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
387
utf_8
99415d5105880b51d9a3574c4223224f
// { dg-options -std=c++0x } // 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|no matching" } { return 1; } }; int bar () { return S<0, 1, 2>::foo<0...
google
chromium
variadic-ex8
.C
native_client/nacl-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/nacl-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
variadic26
.C
native_client/nacl-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/nacl-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
variadic63
.C
native_client/nacl-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
decltype-33838
.C
native_client/nacl-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
initlist-deduce
.C
native_client/nacl-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
pr34061
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34061.C
157
utf_8
fa9fefbf49d938e0bb7bc95e80a16b94
// PR c++/34061 // { dg-do compile } // { dg-options "-std=c++0x" } template<template<int> class ...T> struct A : T<0> {}; // { dg-error "not expanded|T" }
google
chromium
variadic68
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic68.C
407
utf_8
1bb219987b62433ec1ed551722126eda
// { dg-do "run" } // { dg-options "-std=gnu++0x" } extern "C" void abort(); template<typename T, T... Values> void f(T* expected_values, int n) { if (sizeof...(Values) != n) abort (); T values[] = { Values... }; for (int i = 0; i < n; ++i) if (values[i] != expected_values[i]) abort(); } int main...
google
chromium
cast-bug
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/cast-bug.C
131
utf_8
7a47c96ccc25ad3c9076e60422fc834f
// { dg-options "--std=c++0x" } struct S { S(); S(S &&); private: S(S &); }; S f() { S s; return static_cast<S&&>(s); }
google
chromium
auto9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto9.C
3,469
utf_8
91d863ef4cf14690b1a45a8323f2f8f0
// PR c++/37962 // Negative test for auto // { dg-do compile } // { dg-options "-std=c++0x" } #include <typeinfo> #include <stdarg.h> #include <stddef.h> int i = *(auto *) 0; // { dg-error "auto" } struct A *p = (auto *) 0; // { dg-error "auto" } int *q = static_cast <auto *>(0); // { dg-error "auto" } const int ...
google
chromium
__func__
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/__func__.C
83
utf_8
fd509d418a54163fd3341bc1594e68f8
// { dg-options "-std=c++0x -pedantic" } const char* foo() { return __func__; }
google
chromium
pr31442
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31442.C
270
utf_8
5fe41c6f9f1b7c523ca74ef42239a6dd
// { dg-options "-std=gnu++0x" } template<typename... T, T = 0> struct A {}; // { dg-error "parameter packs|T|the end|parameter packs|anonymous" } struct B { template <template <typename...> class C> B(C<int>); }; B b = A<int>(); // { dg-error "mismatch|expected" }
google
chromium
rv-trivial-bug
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-trivial-bug.C
566
utf_8
502f5ac10c2ab96a80d6c603bdf2cfd2
// { dg-do "run" } // { dg-options "-std=c++0x" } // PR c++/33235 #include <cassert> int move_construct = 0; int move_assign = 0; struct base2 { base2() {} base2(base2&&) {++move_construct;} base2& operator=(base2&&) {++move_assign; return *this;} }; int test2() { base2 b; base2 b2(b); assert...
google
chromium
variadic46
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic46.C
178
utf_8
1d4336e9606ac11d13c11822d5c1aa1d
// { dg-options "-std=gnu++0x" } template<typename... Args> int& f(Args&...); template<typename... Args> float& f(const Args&...); int& g(int x, float y) { return f(x, y); }
google
chromium
overload-conv-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/overload-conv-2.C
161
utf_8
a280ecf17238784796b3effb1fd26248
// { dg-options "--std=c++0x" } // { dg-do link } struct T {}; struct S { S(T const &) {} }; void f(const S&); void f(S&&) {} int main() { T t; f(t); }
google
chromium
variadic77
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic77.C
369
utf_8
da25de7dbe6004c16da766f4081b6da7
// PR c++/33496 // { dg-do compile } // { dg-options "-std=gnu++0x" } 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 () { return sizeof... (pair<M, N>); // { dg-error "mismatched argument pack lengths" } } }; i...
google
chromium
scoped_enum_98
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/scoped_enum_98.C
164
utf_8
fd6131462c6e3edcb0e1d2d7c01ff384
// { dg-do compile } // { dg-options "-std=c++98" } enum class E1 { e1 }; // { dg-warning "scoped enums" } enum E2 : char { e2 }; // { dg-warning "scoped enums" }
google
chromium
named
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/named.C
671
utf_8
d6c971d57aa73f0e85d3dc1d3ecf603f
// { dg-options "--std=c++0x" } // { dg-do link } struct S {}; struct T { T(S && s_) : s(s_) {} S && get() { return s; } operator S&&() { return s; } S && s; }; void named(S const &) {} void named(S&&); void unnamed(S const &); void unnamed(S&&) {} void f(S && p) { S && s(p); T t(s); named(s); ...
google
chromium
temp-va-arg-bug
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/temp-va-arg-bug.C
195
utf_8
7712df2d9e36aa563428755742fff74c
// { dg-options "--std=c++0x" } // { dg-options "-Wno-abi --std=c++0x" { target arm_eabi } } #include <stdarg.h> struct S { }; void f(S const &); void g(va_list args) { f(va_arg(args, S)); }
google
chromium
initlist29
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist29.C
172
utf_8
2dfea3afb901b42654dc87a5c89c66f0
// PR c++/42331 // { dg-options "-std=c++0x" } class Mesh { public: Mesh(const char*) { typele={0}; } // { dg-error "" } private: int typele[7][2]; }; Mesh m(0);
google
chromium
pr32566
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32566.C
149
utf_8
04413fdf6bfed8674a0e127cb7d47fd5
// { dg-options "-std=c++0x" } template<int...> struct A; template<template<int> class... T> struct A<T...> {}; // { dg-error "mismatch|expected" }
google
chromium
variadic55
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic55.C
276
utf_8
148188bbd7fdf8cb6e329fdcf2074726
// { dg-options "-std=gnu++0x" } template<typename F, typename... BoundArgs> class bound_functor { public: bound_functor(const BoundArgs&... bound_args); }; template<typename F, typename... BoundArgs> bound_functor<F, BoundArgs...>::bound_functor(const BoundArgs&...) { }
google
chromium
pr32127
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32127.C
169
utf_8
40e7a635680d6d648eb6005a7755c36f
// { dg-options "-std=c++0x" } template<typename...T> struct A { static T i; // { dg-error "parameter packs|T" } }; int j = A<int>::i; // { dg-error "not a member" }
google
chromium
variadic38
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic38.C
184
utf_8
dee0de0dca97dfb06bf59cb3474c28bd
// { dg-options "-std=gnu++0x" } template<int... Values> struct int_vec {}; template<int... Values> struct int_vec<0, (Values+1)...> {}; // { dg-error "involves template parameter" }
google
chromium
variadic93
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic93.C
157
utf_8
761ecd4bd3764522d66074c7008f1879
// PR c++/35297 // { dg-options "-std=c++0x" } template <class T=int, class... ARGS> struct test2 {}; int main() { test2<> a; return 0; }
google
chromium
variadic51
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic51.C
174
utf_8
67318b70279649a692937f82fc969fad
// { dg-options "-std=gnu++0x" } template<typename T1, typename T2> float& f(T1, T2); template<typename... Args> int& f(Args...); float& g() { return f(17, 3.14159); }
google
chromium
initlist12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist12.C
272
utf_8
88ca216d97a186e8c3400a3591c5b88d
// PR c++/38698 // { dg-options "-std=c++0x" } struct A { int i; }; A a({1,2}); // { dg-error "too many initializers" } union U { int i,j; }; U u({1,2}); // { dg-error "too many initializers" } union V {}; V v({1}); // { dg-error "too many initializers" }