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
rv7n
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv7n.C
3,640
utf_8
0bc334b397cbbf5347af9857eaac15ad
// 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
rv6n
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv6n.C
14,003
utf_8
a7d62d491de1a94b990933b8b0e2a20d
// 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
rvo
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rvo.C
367
utf_8
fef41d72ede570a92ec084913c948b3c
// { dg-do run } // { dg-options "-std=c++0x" } // Contributed by Sylvain Pion static int rvalue_constructions = 0; struct A { A () { } A (const A&) { } A (A&&) { ++rvalue_constructions; } ~A () { } }; A f() { return A(); } extern "C" { void abort(void); } int main() { A c = f(); ...
google
chromium
fntmpdefarg2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
374
utf_8
7252622510976aa92f8dad7c1691be9e
// PR c++/46831 // { dg-options -std=c++0x } struct B { }; struct D : B { }; struct A { template<typename T = void> operator D&(); // { dg-message "template conversion" } operator long(); }; void f(long); void f(B&); struct A2 { template<typename T = void> operator B&(); }; void f2(const B&); int main() { ...
google
chromium
decltype30
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype30.C
286
utf_8
e537c669a0adc873746f19f96ff97585
// PR c++/49369 // { dg-options -std=c++0x } template <class,class> struct assert_same; template <class T> struct assert_same<T,T> {}; struct B { int member; }; struct C: B { void method() const; }; void C::method() const { assert_same<decltype((B::member)), const int&> a; }
google
chromium
not_special
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/not_special.C
1,158
utf_8
9ccfbb5d88034a9b937880f38b8aeb41
// I, Howard Hinnant, hereby place this code in the public domain. // Test that move constructor and move assignement are special. // That is, their presence should inhibit compiler generated // copy ctor or assignment. // { dg-options "-std=c++0x" } #include <assert.h> template <bool> struct sa; template <> st...
google
chromium
constexpr-ref2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ref2.C
375
utf_8
221a000512ef7f4de6b2e973ce64fdc5
// Negative reference variable tests. // { dg-options -std=c++0x } extern int *p; constexpr int& ri = *p; // { dg-error "p" } extern constexpr int &er; // { dg-error "not a definition" } constexpr int& ri2 = er; // { dg-error "er" } void f(int j) { constexpr int i = 42; constexpr int const& ri = i; // { dg-erro...
google
chromium
variadic-unify
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-unify.C
329
utf_8
a21cb07dbbd1fe7391733da7d9eb343e
// { dg-options "-std=c++0x" } template<typename...> struct tuple { }; template<typename... Args1, typename... Args2> void foo(tuple<Args1..., Args2...>, tuple<Args1...>, tuple<Args2...>); struct X{ }; void bar() { tuple<int, float> tif; tuple<double, X> tdx; tuple<int, float, double, X> tall; foo(tall, tif,...
google
chromium
vt-34399
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34399.C
174
utf_8
593458eca2d4ea8972c29ebe23b518fc
// { dg-options "-std=c++0x" } template<int...> struct A { void foo(); }; struct B { template<int N> friend void A<N>::A::foo(); // { dg-error "declared as friend" } };
google
chromium
constexpr-data1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C
611
utf_8
35133bd86f408491ff07b91c763118d5
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 // 1 struct A2 { static const int eights = 888; static constexpr int nines = 999; }; A2 a; // 2 struct pixel { int x, y; }; constexpr pixel ur = { 1294, 1024 }; // OK // p4 struct Length { explicit constexpr Length(int i = 0) : val(i) { }...
google
chromium
implicit3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit3.C
795
utf_8
3c8a110f0d4f7cc9ca0afa1baa054604
// Basic runtime test for implicit move constructor // { dg-do run } // { dg-options -std=c++0x } int m; struct A { A() = default; A(A&&) { ++m; } A& operator=(A&&) { ++m; return *this; } }; struct B { B() = default; B(const B&); B(B&&) { ++m; } B& operator=(const B&); B& operator=(B&&) { ++m; return...
google
chromium
variadic-unify-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-unify-2.C
340
utf_8
5af2be8abccd9a7c272adfe9c77b9278
// Origin: PR c++/40155 // { dg-options "-std=c++0x" } // { dg-do compile } template <typename T> struct identity { typedef T type; }; template <typename RT, typename... A> int forward_call(RT (*) (A...), typename identity<A>::type...); int g (double); int i = forward_call(&g, 0);
google
chromium
initlist-opt
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist-opt.C
413
utf_8
29031937edb9fe42899c654f3187743d
// PR c++/41997 // { dg-options "-std=c++0x -O2 -fdump-tree-optimized" } // { dg-final { scan-tree-dump-not "_0" "optimized" } } // { dg-final { cleanup-tree-dump "optimized" } } #include <initializer_list> inline int max_val(std::initializer_list<int> il) { int i = *(il.begin()); int j = *(il.begin()...
google
chromium
auto2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto2.C
1,101
utf_8
90322be779600bd8fc9d131b0465b7a3
// Positive test for auto // { dg-do run } // { dg-options "-std=c++0x" } #include <typeinfo> extern "C" void abort(); int f() {} struct A { int i; int f() {} A operator+(A a) { return a; } }; template <class T> void g(T t) { auto x = t+t; if (typeid(x) != typeid(t+t)) abort(); auto p = new auto(&t...
google
chromium
defaulted9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted9.C
284
utf_8
48330e103022acc7a08050ed88e86cac
// PR c++/39153 // { dg-options "-std=c++0x -fno-inline" } struct _Impl_base { _Impl_base() = default; virtual ~_Impl_base(); }; inline _Impl_base::~_Impl_base() = default; template<typename _Tp> class _Impl : public _Impl_base { }; int main() { _Impl<int> i; return 0; }
google
chromium
variadic75
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic75.C
681
utf_8
36eb0d6498ae2f0ee3a250a14538e878
// { dg-options "-std=gnu++0x" } template<typename...> struct tuple { }; template<template<typename T> class Meta, typename... Values> struct apply_all { typedef tuple<typename Meta<Values>::type...> type; }; template<typename T, typename U> struct is_same { static const bool value = false; }; template<typename...
google
chromium
rv-cast
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-cast.C
85
utf_8
edfc9b308544c77eeecbc033e166eae9
// { dg-options "-std=c++0x" } void f(int i) { int&& r = static_cast<int&&>(i); }
google
chromium
overload2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/overload2.C
812
utf_8
b363b0bc1857b003bf19628c11920fe5
// Core 1321 // { dg-options -std=c++0x } // Two dependent names are equivalent even if the overload sets found by // phase 1 lookup are different. Merging them keeps the earlier set. int g1(int); template <class T> decltype(g1(T())) f1(); int g1(); template <class T> decltype(g1(T())) f1() { return g1(T()); } int i1...
google
chromium
auto18
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto18.C
121
utf_8
3bc58c1f499638618d60094d4a32fb3d
// { dg-options "-std=c++0x" } void f() { auto val = val; // { dg-error "auto. type used in its own initializer" } }
google
chromium
defaulted15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted15.C
796
utf_8
39ed62ba265b36b26d9a4357df441f9d
// PR c++/38796 // { dg-options -std=c++0x } #define SA(X) static_assert ((X), #X) struct A { A (int); A (const A& = 1) = default; // { dg-error "default argument" } void operator= (const A&) = default; // { dg-error "defaulted|match" } }; struct B { private: B() = default; }; SA(__has_trivial_constructor(B)); ...
google
chromium
sfinae23
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae23.C
573
utf_8
ea9c2005dd40591ea4ecb2ac11ee80e8
// PR c++/48647 // { dg-options -std=c++0x } template< class T > T&& declval(); template< class T, class U > decltype( true ? declval<T>() : declval<U>() ) test( int ); template< class T, class U > void test( ... ); template< class T, class U > struct is_same { static const bool value = false; }; template< clas...
google
chromium
vt-35147
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-35147.C
344
utf_8
cd58c3ddeecc8d080ac7506050b9cd9b
// { dg-options "-std=c++0x" } template<typename _Tp> _Tp&& forward(_Tp&& __t) { return __t; } // { dg-message "note" } void f(...); template<typename... Args> void g(Args&&... args) { f(forward<Args...>(args...)); // { dg-error "no matching" } // { dg-message "candidate" "candidate note" { target *-*-* } 11 }...
google
chromium
vt-40092
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
445
utf_8
3ad2661187e925da0285de4a629b28b3
// { dg-do compile } // { dg-options "-std=c++0x" } template <typename... Types> struct package {}; template <int ArgGen> struct wrapper_gen {}; template <int ArgNest> struct wrapper_nest { typedef wrapper_gen<ArgNest> type_nest; }; template <int... ArgPack> struct wrapper_pack { typedef package<wrapper_gen <Ar...
google
chromium
auto20
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto20.C
379
utf_8
161f853635da1dd8e138968a8ed21842
// Test for proper non-deduced context handling of the initializer // for an auto declaration/new. // { dg-options -std=c++0x } struct with_apply { template <unsigned> void apply(const double&){} }; auto p = &with_apply::apply<0>; auto pp = new auto(&with_apply::apply<0>); template <class T> void f() { auto p ...
google
chromium
forw_enum7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum7.C
496
utf_8
474c812c135bc22b4cc01f34e41feaf3
// { dg-do compile } // { dg-options "-std=c++0x" } template<typename T> struct S1 { enum E1 : int; enum E1 : T; enum class E2 : int; enum class E2 : T; }; template<typename T> enum S1<T>::E1 : int { e1 }; template<typename T> enum class S1<T>::E2 : T { e2 }; S1<int>::E1 x1 = S1<int>::e1; S1<int>::E1...
google
chromium
constexpr-noexcept5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept5.C
253
utf_8
85c136c1459e60d8aa08488b1613e91e
// { dg-options -std=c++0x } struct booleable { bool data; constexpr explicit operator bool() { return data; } }; constexpr booleable truthy_func() { return {true}; } void funky() noexcept(truthy_func()) {} int main() { funky(); return 0; }
google
chromium
auto17
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto17.C
147
utf_8
3c7f05513a5c82cb29137f43a968683a
// PR c++/42567 // { dg-options "-std=c++0x" } template<typename B> struct A { template<typename C> void fn(C c) { auto& key = *c; } };
google
chromium
union5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/union5.C
286
utf_8
731ac62008a46a7da0b9753273cc531c
// PR c++/49803 // { dg-options -std=c++0x } struct X { X() = delete; }; union Y { // N3291=11-0061 12.6.2/8 says no initialization of // of other variant members (i.e. m_x) should // be performed. Y() : m_char1{ } { } struct { char m_char1; }; X m_x; };
google
chromium
variadic103
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic103.C
217
utf_8
59cfd7f1110f240151216357c43f9bc3
// { dg-options "-std=c++0x" } template<class T> T&& create(); template<class T, class... Args> void test() { T t(create<Args>()...); // { dg-error "unknown bound" } (void) t; } int main() { test<int[]>(); }
google
chromium
sfinae3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae3.C
1,412
utf_8
5b073fbc7cc7d5c21cdee17698b24fff
// { dg-options -std=c++0x } namespace std { template <class T> T&& declval(); } template<typename _Tp, typename... _Args> class is_constructible_mini { typedef char __one; typedef struct { char __arr[2]; } __two; template<typename _Tp1, typename... _Args1> static decltype(::new _Tp1(std::declv...
google
chromium
auto21
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto21.C
217
utf_8
7fdc144545cae7d41112fc22cb1b49d2
// Origin PR c++/47208 // { dg-options "-std=c++0x" } constexpr auto list = { }; // { dg-error "deducing from brace-enclosed initializer list requires #include <initializer_list>" } static const int l = list.size();
google
chromium
initlist18
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist18.C
257
utf_8
c3eb0f3f2e3ddb5cea52a3aba9ff584b
// PR c++/40308, 40311 // { dg-do run } // { dg-options "-std=c++0x" } template< typename T > struct test { test() : data{} {} T data; }; int main() { test<int> x; test<int*> y; int * a = new int{}; int * b = new int{5}; return 0; }
google
chromium
variadic98
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic98.C
21,084
utf_8
ddd8ff871ff42e3b6e6a2371d1bac35e
// PR c++/42358 // { dg-do assemble } // { dg-options -std=c++0x } typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __SIZE_TYPE__ size_t; namespace std __attribute__ ((__visibility__ ("default"))) { using ::size_t; } namespace std __attribute__ ((__visibility__ ("default"))) { struct __sfinae_types { typedef cha...
google
chromium
range-for10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for10.C
198
utf_8
a704049cf608b9b47381e29ee9dbb3fc
// PR c++/47388 // { dg-do compile } // { dg-options "-fno-for-scope -std=c++0x" } template <int> void foo () { int a[] = { 1, 2, 3, 4 }; for (int i : a) ; } void bar () { foo <0> (); }
google
chromium
vt-33964
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-33964.C
400
utf_8
af7c2d788ab7151c61d2f6a6acabf230
// { dg-options "-std=c++0x" } template<typename ... Args> struct foo { static bool const value = true; }; template<typename ... Args> struct foo< typename Args::is_applied... > // { dg-error "not used|Args" } { static bool const value = false; }; struct not_applied { typedef void is_applied; }; struct applie...
google
chromium
initlist19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist19.C
170
utf_8
937c084dc01cddb67879b019dcbfc227
// { dg-options "-std=c++0x" } // Allow other errors, too // { dg-prune-output "error" } void f(double); int main() { f({{1}}); // { dg-error "too many braces" } }
google
chromium
rv1p
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv1p.C
3,365
utf_8
28c449f969ffc0d963241cf8fc2fa2c2
// 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 {long x[1];}; struct two {long x[2];}; struct three {long x[3];}; struct ...
google
chromium
variadic-ex13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C
1,323
utf_8
c3adbc21cc5770871b779c2477b817fe
// { 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; }; template<typename...> struct Tuple {}; template<typename T1, typename T2> struct Pair {}; template<typename... Arg...
google
chromium
constexpr-empty
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-empty.C
120
utf_8
1ba17ee1d35ff6e410029a330bf04b32
// { dg-options -std=c++0x } struct Empty {}; constexpr bool f(Empty) { return true; } constexpr bool x(f(Empty{}));
google
chromium
sfinae19
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae19.C
269
utf_8
24fa5612415f2e5c06579d475a205eb8
// PR c++/48737 // { dg-options "-std=c++0x" } template<class T> T&& create(); template<class T, class... Args> decltype(T{create<Args>()...}, char()) f(int); template<class, class...> char (&f(...))[2]; static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
google
chromium
defaulted27
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted27.C
323
utf_8
8ee26db1b0453ae9e4e7678c660e534e
// PR c++/47544 // { dg-options -std=c++0x } // { dg-final { scan-assembler "_ZN1sIiEC2Ev" } } // { dg-final { scan-assembler-not "_ZN1sIiED2Ev" } } template <typename T> struct s { s(); ~s() = default; }; extern template struct s<int>; template <typename T> s<T>::s() = default; template struct s<int>; s<int> ...
google
chromium
override1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/override1.C
1,212
utf_8
b00930907ec500279d187f45f44d7d0d
// { dg-do compile } // { dg-options "--std=c++0x" } struct B { virtual void f() final {} virtual void g() {} virtual void x() const {} }; struct B2 { virtual void h() {} }; struct D : B { virtual void g() override final {} // { dg-error "overriding" } }; template <class T> struct D2 : T { void h() overr...
google
chromium
variadic86
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic86.C
440
utf_8
d373d69f887ce9eba19f932c6fa2a6a7
// PR c++/33943 // { dg-do compile } // { dg-options "-std=c++0x" } template<typename... A> struct foo {}; template<typename A0, typename... A1> struct bar {}; template<typename U> struct baz; template<template<typename...> class T, typename... U> struct baz< T<U...> > {}; template<template<typename, typename...> ...
google
chromium
sfinae4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae4.C
646
utf_8
3c422496b0a488c2517154da36aa1d22
// { dg-options -std=c++0x } namespace std { template <class T> T&& declval(); } template<typename _Tp, typename... _Args> class is_constructible_mini { typedef char __one; typedef struct { char __arr[2]; } __two; template<typename _Tp1, typename... _Args1> static decltype(::new _Tp1(std::declv...
google
chromium
rv-lvalue-req
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-lvalue-req.C
337
utf_8
fd4a5ef48ec4db67859b598993b7ad6d
// { dg-options -std=c++0x } template <class T> T&& declval(); int main() { &declval<int>(); // { dg-error "xvalue" } declval<int>() = declval<int>(); // { dg-error "xvalue" } declval<int>()++; // { dg-error "xvalue" } --declval<int>(); // { dg-error "xvalue" } declval<int>() += 1; // { dg-er...
google
chromium
constexpr-compound
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-compound.C
143
utf_8
96295aa6316cc8c0b1e08ff9b6ed47cd
// { dg-options "-std=c++0x -pedantic-errors" } constexpr int f() { { // { dg-error "" } return 1; } { } // { dg-error "" } }
google
chromium
vt-34961
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34961.C
180
utf_8
3c03ffe609645612c916414af4f58122
// { dg-options "-std=c++0x" } template<typename... T> struct A { static const int i __attribute__((aligned(__alignof(T)))) = 0; // { dg-error "not expanded|T" } }; A<int> a;
google
chromium
decltype6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype6.C
765
utf_8
5e830daa5bfe8780960733c15cef7f74
// { 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; }; template<typename T> const T& foo(); int i; template<typename T> struct A { double ...
google
chromium
noexcept12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept12.C
233
utf_8
6b58e3944ae7934cafd1aa206700650d
// Test that we handle merging with deferred noexcept. // { dg-options -std=c++0x } template <class U> struct O { template <class T> void f() noexcept(noexcept(T())); }; template<> template<> void O<int>::f<int>() noexcept { }
google
chromium
sfinae14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae14.C
428
utf_8
00b3494c9e934e2e060e4350f239f34c
// PR c++/48557 // { dg-options -std=c++0x } template<class T> struct add_rval_ref { typedef T&& type; }; template<> struct add_rval_ref<void> { typedef void type; }; template<class T> typename add_rval_ref<T>::type create(); template<class T, class U, class = decltype(create<T>() + create<U>()) > char f(int)...
google
chromium
initlist30
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist30.C
204
utf_8
bb7e5663de436a930ddc4f465d72c9b3
// Testcase for variadic init list deduction. // { dg-options "-std=c++0x" } #include <initializer_list> template <class... Ts> void f (std::initializer_list<Ts>... ls); int main() { f({1},{2.0}); }
google
chromium
variadic82
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic82.C
254
utf_8
e007db2c033ef0a193081e993983b116
// PR c++/33461 // { dg-options "-std=gnu++0x" } template<typename> struct A; template<typename... T> struct A<T*...> // { dg-bogus "cannot expand" "" { xfail *-*-* } } { struct B; }; A<void*> a; // { dg-bogus "incomplete type" "" { xfail *-*-* } }
google
chromium
nullptr04
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr04.C
704
utf_8
5532699ccdc5e986ec54e1cb65ba2488
// { dg-do compile } // { dg-options "-std=c++0x" } // Test cast to int __extension__ typedef __INTPTR_TYPE__ intptr_t; const int n4 = static_cast<const int>(nullptr); // { dg-error "invalid static_cast " } const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "loses precision" } const intptr_t n6...
google
chromium
constexpr-function1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C
227
utf_8
750b9c030c44dbe865d321389d254f0a
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 constexpr int veryabs(int x) { return x < 0 ? -x : x; } constexpr long long_max() { return 2147483647; } constexpr int verysquare(int x) { return x * x; }
google
chromium
variadic105
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic105.C
790
utf_8
842b50b39b9b85242238c0136d6e231c
// PR c++/47289 // { dg-options -std=c++0x } // { dg-prune-output "note" } template <template <typename... __ARGS> class _F, typename... _ARGS> auto reverse (_ARGS... args) -> decltype(_F<_ARGS...>::call_function(args...)) { return _F<_ARGS...>::call_function(args...); } template <typename _T> _T sum(_T x) { return...
google
chromium
variadic112
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic112.C
335
utf_8
cda83e57f664784f25d340df585f9ead
// PR c++/49420 // { dg-options -std=c++0x } struct A { }; template <class T> struct B { typedef typename T::type type ; // { dg-error "no type" } }; template <typename Array, typename... Args> typename B<Array>::type get(const Array& a, Args... args); int main() { A a; int x = get(a, 1, 2, 3); // { dg-error ...
google
chromium
constexpr-object2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C
483
utf_8
cff4afb9a9976ef5efce7e0739cd7e36
// { dg-do compile } // { dg-options "-std=gnu++0x" } constexpr int verysquare(int x) { return x * x; } const double mass = 9.8; constexpr double energy = mass * verysquare(56.6); // { dg-error "mass" "" { xfail *-*-* } } int arr[(int)mass]; // { dg-error "mass" "" { xfail *-*-* } } float array[verysquare(9)]; ...
google
chromium
rv7p
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv7p.C
8,341
utf_8
fbdae215ac2f05e30217ae8a7c16fbc1
// 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 {long x[1];}; struct two {long x[2];}; struct three {long x[3];}; struct ...
google
chromium
auto16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto16.C
195
utf_8
6e0e63c1fb979760fac52b1ec3bcc210
// PR c++/40619 // { dg-options "-std=c++0x" } template<typename U> struct X {}; template<typename T> auto f(T t) -> X<decltype(t+1)> {} template<typename T> auto g(T t) -> X<decltype(t+1)> {}
google
chromium
pr32114
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32114.C
140
utf_8
7f1aaaa89f82247ea2fb1910175c7142
// { dg-options "-std=c++0x" } template<typename ...T> struct A { typedef typename T::X Y; // { dg-error "not expanded|T" } }; A<int> a;
google
chromium
rv-return
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-return.C
451
utf_8
0651d3ea6799e21b9e7c928636c58c51
// PR c++/41815 // { dg-options -std=c++0x } template<typename T, typename U> struct same_type; template<typename T> struct same_type<T, T> {}; int const f() { return 0; } int &&r = f(); // binding "int&&" to "int" should succeed same_type<decltype(f()), int> s1; same_type<decltype(0,f()), int> s2; template <class ...
google
chromium
constexpr-cleanup
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-cleanup.C
117
utf_8
5467c101e09b0b9ec5cde72640f09dcb
// { dg-options -std=c++0x } struct A { int i; ~A(); }; constexpr int i = A().i; // { dg-error "non-literal" }
google
chromium
initlist16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist16.C
156
utf_8
43443b363fe198a344770e0821a7e356
// { dg-options "-std=c++0x" } // { dg-do run } extern "C" void abort(); void f(int i) { if (i != 42) abort(); } int main() { f({42}); return {0}; }
google
chromium
constexpr-missing
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-missing.C
704
utf_8
d1cabbaaafd13cb36a1d99e56fb30ddc
// PR c++/48911 // { dg-do compile } // { dg-options "-std=c++0x" } #define SA(X) static_assert((X),#X) struct A { constexpr A () : a (6) {} int a; }; int main () { constexpr int a[2] = { 42 }; constexpr int i = a[1]; SA(i==0); constexpr int b[1] = { }; constexpr int j = b[0]; SA(j==0); constexpr c...
google
chromium
constexpr-value
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-value.C
373
utf_8
a80be7ed60483526cbc73b734a6567d3
// { dg-options -std=c++0x } struct HopefullyLiteral { HopefullyLiteral() = default; // Should be a constexpr c'tor as of 12.1/6 and 8.4.2/4 }; constexpr HopefullyLiteral var1{}; // OK constexpr HopefullyLiteral var2 = HopefullyLiteral{}; // #1 constexpr HopefullyLiteral var3 = HopefullyLiteral(); // #2 constexpr H...
google
chromium
defaulted5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted5.C
242
utf_8
a542994a8950397c6e282c0db4479373
// PR c++/37234 // { dg-do link } // { dg-options "-std=c++0x" } template <typename T> class foo { public: foo() =default; ~foo(); }; template <typename T> foo<T>::~foo() =default; int main() { foo<int> fi; return 0; }
google
chromium
variadic-function
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-function.C
1,968
utf_8
151f0547e4f12da833be0a3095748198
// { dg-do run } // { dg-options "-std=gnu++0x" } // A basic implementation of TR1's function using variadic teplates #include <cassert> template<typename Signature> class function; template<typename R, typename... Args> class invoker_base { public: virtual ~invoker_base() { } virtual R invoke(Args...) = 0; virt...
google
chromium
nullptr14
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr14.C
536
utf_8
132175fa2dc32fe44294793026080441
// { dg-do compile } // { dg-options "-std=c++0x" } // Test overload preference char*/int template <typename T, typename U> struct tType_equal; template <typename T> struct tType_equal<T, T> { typedef void type; }; template <typename T, typename U> inline typename tType_equal<T, U>::type type_equal(U) { } char* f( ...
google
chromium
rv4p
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv4p.C
49,460
utf_8
1efd5f29121bf3b536aa5d5d2768225f
// 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 {long x[1];}; struct two {long x[2];}; struct three {long x[3];}; struct ...
google
chromium
variadic-default
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-default.C
201
utf_8
d5d710e7e46ee53d6f615f6145ed70e3
// PR c++/49205 // { dg-options -std=c++0x } #include <initializer_list> struct A { template<typename ...T> A(T...); A(std::initializer_list<short>); A(std::initializer_list<long>); }; A a{};
google
chromium
enum5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum5.C
299
utf_8
8d128943842c7e12ad8c1ea017f3fb14
// PR c++/40639 // { dg-options "-std=c++0x" } template< typename T > struct wrap { enum E : T { val }; }; template< typename T > struct dependant { enum E : typename T::type { val }; }; template<typename T> struct identity { typedef T type; }; wrap<int> x; dependant<identity<int>> y;
google
chromium
implicit-copy
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit-copy.C
229
utf_8
a181174de0c768cdb827c20113f60cad
// { dg-options "--std=c++0x" } struct S { S(); private: S(S const &&); // { dg-error "" } S & operator=(S const &&); // { dg-error "" } }; void f() { S a; S b(a); // { dg-error "" } a = b; // { dg-error "" } }
google
chromium
variadic57
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic57.C
275
utf_8
3df1cd01278372ac99c35513e3c8b99b
// { dg-options "-std=gnu++0x" } template<typename T, int... Dims> struct array { int foo(); }; template<typename T> struct array<T, 0> { int bar(); }; template<typename T, int... Dims> int array<T, Dims...>::foo() { } template<typename T> int array<T, 0>::bar() { }
google
chromium
nsdmi3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C
291
utf_8
bad9666c3278a3d42accfd63a0e93060
// { dg-options -std=c++0x } struct A { int i; explicit constexpr A(int i): i(i) {} }; struct B { A a1 = 1; // { dg-error "" } A a2 { 2 }; A a3 = { 3 }; // { dg-error "" } }; constexpr B b; // { dg-error "B::B" } // { dg-message "a1. is invalid" "" { target *-*-* } 11 }
google
chromium
pr32252
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32252.C
144
utf_8
cfacb3fc6991199f6bdc5857d143f048
// { dg-options "-std=c++0x" } int x[5]; template<int M, int N, int (&... p)[N]> struct A; template<int M> struct A<M,5,x> {}; A<0,5,x> a;
google
chromium
constexpr-array-ptr6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr6.C
493
utf_8
e4542432269cbece8ffb9364ece496f1
// { dg-options "-std=c++0x" } typedef decltype(sizeof(char)) size_type; template<class T, size_type N> constexpr size_type size(T (&)[N]) { return N; } double array_double[] = { 1.0, 2.0, 3.0 }; constexpr auto sz_d = size(array_double); static_assert(sz_d == 3, "Array size failure"); void f(bool (&param)[2]) { ...
google
chromium
variadic-ex1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex1.C
157
utf_8
45b7b1eb9a3895f8bc497747a7af0afc
// { dg-options "-std=gnu++0x" } template<typename ... Elements> class Tuple; Tuple<>* t; // OK: Elements is empty Tuple* u; // { dg-error "template-name" }
google
chromium
constexpr-array-ptr4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr4.C
438
utf_8
a0596cb9b205bf852ca157b855109ce7
// { dg-options -std=c++0x } constexpr const int do_last(const int* x, int n) { return x[n - 1]; } struct IsNegative { constexpr bool operator()(const int& x) { return x < 0; } }; template<int N, class Pred> constexpr bool has_neg(const int (&x)[N], Pred p) { return p(do_last(x, N)); // Line 13 } constex...
google
chromium
pr31443
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31443.C
229
utf_8
67359603203bcca897778b2597f66e80
// { dg-options "-std=gnu++0x" } template<int, typename... T> struct A { template<int N> void foo(A<N,T>); // { dg-error "parameter packs|T" } }; void bar() { A<0,int>().foo(A<0,int>()); // { dg-error "no member named" } }
google
chromium
std-layout1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/std-layout1.C
2,168
utf_8
024127b05a89710621edb486968b4e3c
// { dg-options "-std=c++0x" } // [basic.types]/10: // Scalar types, standard-layout class types (Clause 9), arrays of such // types and cv-qualified versions of these types (3.9.3) are collectively // called standard-layout types. // [class]/7: // A standard-layout class is a class that: // * has no non-static data me...
google
chromium
pr34060
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34060.C
237
utf_8
e4082204afdcaeccf1c498832e48bf59
// PR c++/34060 // { dg-do compile } // { dg-options "-std=c++0x" } template <int> struct A { template <typename... > struct B {}; template <typename... T> struct B <int, T *> {}; // { dg-error "not expanded|T" } }; A<0>::B<int>b;
google
chromium
constexpr-ctor6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C
108
utf_8
723db8063ed205915af97221d726842b
// PR c++/47041 // { dg-options "-std=c++0x -fno-elide-constructors" } struct S { int i; }; S s = S ();
google
chromium
enum1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum1.C
151
utf_8
70fd9fe2b4dfef9ca8221ad6de78a13d
// PR c++/38021 // { dg-do compile } // { dg-options "-std=gnu++0x" } enum : { }; // { dg-error "expected" } enum : 3 { }; // { dg-error "expected" }
google
chromium
variadic95
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic95.C
260
utf_8
e9c1d06fba854d7c75a89def41ba0896
// PR c++/39863 // { dg-options -std=c++0x } template <typename... T> struct A {}; template <typename T, typename U> struct S {}; template <typename... T, typename... U> A< S<T, U>... > f(U... u) { return A< S<T, U>... >(); } int main() { f<int>(0.0); }
google
chromium
constexpr-ref3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ref3.C
155
utf_8
53b6baee1f68ced654a5572129b21aaf
// PR c++/50298 // { dg-options -std=c++0x } int global_variable; template <class T> struct X { static constexpr T r = global_variable; }; X<int&> x;
google
chromium
sfinae21
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae21.C
223
utf_8
fb9b82ecea424e37c01f3289146b6820
// PR c++/48735 // { dg-options "-std=c++0x" } template<class T, class = decltype(T{}) > char f(int); template<class> char (&f(...))[2]; struct ND { ND() = delete; }; static_assert(sizeof(f<ND[1]>(0)) != 1, "Error");
google
chromium
initlist38
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist38.C
285
utf_8
33bbee0bd33bd0f9654116c93d5eaa42
// DR 990 // { dg-options "-std=c++0x" } #include <initializer_list> struct A { A(std::initializer_list<int>); // #1 }; struct B { A a; }; void f (B); int main() { B{}; f({}); B b0 = { }; B b1 { }; // OK, uses #1 B b2 { 1 }; // { dg-error "could not convert" } }
google
chromium
nullptr09
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr09.C
173
utf_8
a5f5ae721628c2d68869ef5dd44dbf68
// { dg-do compile } // { dg-options "-std=c++0x" } // Test compare to literal 0 void fun() { if( nullptr == 0 ); decltype(nullptr) mynull = 0; if( mynull == 0 ); }
google
chromium
vt-34751
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34751.C
592
utf_8
076a6a340c6519840d4022863689e6aa
// { dg-options "-std=c++0x" } // PR c++/34751 struct A {}; template<typename... Args = int> // { dg-error "cannot have a default" } void f(Args... args = 0); // { dg-error "cannot have a default argument" } template<typename... Args> void g(Args... = 0); // { dg-error "cannot have a default argument" } template<...
google
chromium
trailing3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/trailing3.C
1,505
utf_8
f98e26ccc799118e5c38e6b008728fdf
// More auto/decltype mangling tests. // { dg-options "-std=c++0x" } template <class T> struct B { static int i; }; int&& x(); template <class T> struct A { static int i; static int &ir; static int &&irr; template <class U> auto f(U u) -> decltype (u + i); template <class U> auto fr(U u) -> decltype ...
google
chromium
nullptr15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr15.C
893
utf_8
552d5ad28d4d331211894127d4573ff6
// { dg-do compile } // { dg-options "-std=c++0x" } // Test template deduction template <typename T, typename U> struct tType_equal; template <typename T> struct tType_equal<T, T> { typedef void type; }; template <typename T, typename U> inline typename tType_equal<T, U>::type type_equal(U) { } template<typename T>...
google
chromium
forw_enum9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum9.C
468
utf_8
1a13304069c6d86b3f39d3875728ad4c
// { dg-do compile } // { dg-options "-std=c++0x" } template<typename T> struct S1 { enum E1 : int; enum class E2 : int; }; template<typename T> enum S1<T>::E1 : int { e1 }; template<typename T> enum class S1<T>::E2 : T { e2 }; template<> enum S1<int>::E1 : int { i1 }; template<> enum class S1<int>::E2 : int...
google
chromium
collapse
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/collapse.C
954
utf_8
e6e5db803fed31ae5912983c195924e3
// { dg-options "--std=c++0x" } template<typename T, typename U> struct same_type; template<typename T> struct same_type<T, T> {}; typedef int & lref; typedef int const & clref; typedef int && rref; typedef int const && crref; template<typename T> struct S { typedef T & lref; typedef T const & clref; typedef T ...
google
chromium
variadic-ex12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex12.C
226
utf_8
337a319c03c6c55b482f98159615b9b4
// { dg-options "-std=gnu++0x" } template<typename... Types> void f(Types... rest); template<typename... Types> void g(Types... rest) { f(&rest...); // ``&rest...'' is a pack expansion, ``&rest'' is its pattern }
google
chromium
variadic108
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic108.C
177
utf_8
ea20ac20ee3b671a4e27a21651ff43a6
// PR c++/48736 // { dg-options -std=c++0x } template<class T> T&& create(); template<class T, class... Args, class = decltype(T{create<Args>()...}) // Line X > char f(int);
google
chromium
iop
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/iop.C
1,002
utf_8
71298831ed8b873656233fc648a273d3
// I, Howard Hinnant, hereby place this code in the public domain. // Test that the implicit object parameter is *not* an rvalue reference, but is instead // identical to that specified in C++03. That is, the implicit object parameter is // an lvalue reference that can bind to an rvalue. :-\ // See http://www.o...
google
chromium
variadic-ex11
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex11.C
262
utf_8
97b96a2f18f11713716e649fc5925b5f
// { dg-options "-std=gnu++0x" } template<typename... Types> void f(Types... args); void g() { f(); // okay: args contains no arguments f(1); // okay: args contains one int argument (2, 1.0); // okay: args contains two arguments, an int and a double }
google
chromium
decltype31
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype31.C
227
utf_8
5ca28bd7d6d408a3a3af8f74d1a2e6ba
// PR c++/49921 // { dg-options -std=c++0x } struct Local { void f(); }; Local *l; void (Local::*ptr)(); decltype((l->*ptr)) i; // { dg-error "member function" } // { dg-prune-output "invalid type in declaration" }
google
chromium
initlist50
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist50.C
249
utf_8
a72daca3fb481b5a0e784f85e66c0668
// PR c++/45418 // { dg-options -std=c++0x } struct A1 { }; struct A2 { A2(); }; template <class T> struct B { T ar[1]; B(T t):ar{t} {} }; int main(){ B<int> bi{1}; A1 a1; B<A1> ba1{a1}; A2 a2; A2 a2r[1]{{a2}}; B<A2> ba2{a2}; }
google
chromium
constexpr-nonlit
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit.C
289
utf_8
ee9f2baf7ed1b0bc88f7218f75e75afd
// FIXME this is currently invalid, but seems like it should be OK // { dg-options -std=c++0x } struct A { A() { } }; template<class T> constexpr bool ignore(T&&) { return true; } static_assert(ignore(10), "Error"); // OK A s; static_assert(ignore(s), "Error"); // Currently an error