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
pr34061
.C
native_client/pnacl-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/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic68.C
405
utf_8
1f16340119a2a3a4249247d0c9e1cba8
// { 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
constexpr-ctor5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor5.C
295
utf_8
e3de515d18c86ca700258f6e4cb8c3f0
// PR c++/46877 // { dg-options -std=c++0x } struct new_allocator { constexpr new_allocator (); }; struct string { constexpr string () { } new_allocator a; }; struct pair { const string first; constexpr pair () { } }; constexpr new_allocator::new_allocator () { } pair p;
google
chromium
pr50491
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr50491.C
257
utf_8
8a7d0a717134cf294247d67b49791a4f
// { dg-options "-std=c++0x" } struct GrandParent { void *get(); }; template<class OBJ> struct Parent : public GrandParent{ }; template<typename T> struct Child : public Parent<T> { using GrandParent::get; void Foo() { void* ex = get(); } };
google
chromium
cast-bug
.C
native_client/pnacl-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
initlist41
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist41.C
218
utf_8
7aac48f38a8f9c93399916f1d2060570
// PR c++/44703 // { dg-options -std=c++0x } #include <initializer_list> typedef std::initializer_list<int> type ; void f(type) {} int main() { // error: could not convert '{1, 2, 3}' to 'type' f({1,2,3}) ; }
google
chromium
enum13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum13.C
444
utf_8
0d7650e90a4d4babdb032a4fcaf2eee1
// PR c++/48780 // { dg-options "-std=c++0x -fabi-version=5 -Wabi" } typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; enum struct A : short { X }; void foo(int x, ...) { va_list vl; __builtin_va_start(vl, x); enum A t = __builtin_va_arg(vl, enum A); // { dg-warning "promote" } __...
google
chromium
sfinae16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae16.C
232
utf_8
704c882b30bab75e8492c13678b0183c
// PR c++/48531 // { dg-options -std=c++0x } template<class T, class = decltype(T()) > char f(int); template<class> double f(...); struct B2 { B2(...); }; #define SA(X) static_assert ((X), #X); SA(sizeof(f<B2[2]>(0)) != 1);
google
chromium
sfinae12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae12.C
458
utf_8
89eb497243b9b1b897df7690aac87ff8
// PR c++/48535 // { dg-options -std=c++0x } template<class T, class = decltype(T{}) > char f(int); template<class> char (&f(...))[2]; struct A { virtual ~A() = 0; }; static_assert(sizeof(f<A>(0)) != 1, "Error"); // (a) static_assert(sizeof(f<void()>(0)) != 1, "Error"); // (b) static_assert(sizeof(f<int&>(0)) != 1...
google
chromium
initlist28
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist28.C
116
utf_8
a4f3d9411294836b98d774033ad8e551
// PR c++/42060 // { dg-options "-std=c++0x" } void foo() { int a[1]; throw a = {}; // { dg-error "assign" } }
google
chromium
auto9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto9.C
3,571
utf_8
a73e9b7b064e3c8aa13e0913baaf9595
// 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
variadic111
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic111.C
302
utf_8
b12b5112aaaf12c0162ae112cb55d7f1
// PR c++/48424 // { dg-options -std=c++0x } template<typename... Args1> struct S { template<typename... Args2> void f(Args1... args1, Args2&&... args2) { } }; int main() { S<int, double> s; s.f(1,2.0,false,'a'); } // { dg-final { scan-assembler "_ZN1SIIidEE1fIIbcEEEvidDpOT_" } }
google
chromium
__func__
.C
native_client/pnacl-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/pnacl-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/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-trivial-bug.C
698
utf_8
17542374482acc3318df0077d284e8ea
// { 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;} // { dg-error "argument 1" } base2& operator=(base2&&) {++move_assign; return *this;} // { dg-error "argument 1" } }; int test2() { ...
google
chromium
error6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/error6.C
259
utf_8
8ac8f1c80f0281dc16968c6edb04d7c4
// PR c++/48284 // { dg-options -std=c++0x } template<typename C> auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" } template<typename C> auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" }
google
chromium
variadic46
.C
native_client/pnacl-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/pnacl-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
constexpr-ex2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C
489
utf_8
6de470f6053808155196f25008348551
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 // 4.5.3 constant expressions // p 4 struct A { constexpr A(int i) : val(i) { } constexpr operator int() { return val; } constexpr operator long() { return -1; } private: int val; }; template<int I> struct X { static const int i = I; }; con...
google
chromium
variadic77
.C
native_client/pnacl-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
initlist32
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist32.C
237
utf_8
65dfc518d5aaf4cf57a439126c990162
// Test that we try normal init if no list ctor is viable. // { dg-options "-std=c++0x" } #include <initializer_list> struct B {}; struct C { C(B); }; struct A { A(std::initializer_list<int>); A(B) { } }; B b; A a{b};
google
chromium
explicit7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit7.C
506
utf_8
3c4130cf732a3b9bab66e159c1224e2d
// [over.match.conv]: For direct-initialization, those explicit conversion // functions that are not hidden within S and yield type T or a type that // can be converted to type T with a qualification conversion (4.4) are // also candidate functions. // { dg-options -std=c++0x } struct A { }; struct B: A { }; struct C {...
google
chromium
diag1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/diag1.C
729
utf_8
0747f84ce4389f82cb88229d28e39c3a
// { dg-options -std=c++0x } template <int U> struct TypeA { typedef int type; }; template <int N> struct TypeB { template <int U> typename TypeA<U>::type fn(); }; struct TypeC { TypeB<10> b; // This was being printed as: // template<int N> // decltype (((TypeC*)this)-> // TypeC::b. // ...
google
chromium
scoped_enum_98
.C
native_client/pnacl-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
nullptr16
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr16.C
595
utf_8
610aab6cbfbe6fdb6a764ee44387d06c
// { dg-do compile } // { dg-options "-std=c++0x" } // Test template deduction typedef decltype(nullptr) nullptr_t; 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 t...
google
chromium
named
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/named.C
858
utf_8
6902e23e12f8e59e9e7f6c2b41c36273
// { dg-options "--std=c++0x" } // { dg-do link } template<typename _Tp> inline _Tp&& movel(_Tp& __t) { return static_cast<_Tp&&>(__t); } struct S {}; struct T { T(S && s_) : s(movel(s_)) {} S && get() { return movel(s); } operator S&&() { return movel(s); } S && s; S s2; }; void named(S const &) {} void n...
google
chromium
temp-va-arg-bug
.C
native_client/pnacl-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/pnacl-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
constexpr-complex
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C
366
utf_8
38c9acddbe193b257eee58d1f1545221
// Make sure C99 complex works with constexpr // { dg-options -std=c++0x } struct complex { typedef float value_type; typedef __complex__ float _ComplexT; constexpr complex(_ComplexT __z) : _M_value(__z) { } constexpr complex(float __r = 0.0f, float __i = 0.0f) : _M_value(__r + __i * 1.0fi) { } private: ...
google
chromium
range-for8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for8.C
283
utf_8
64bb733c28d25f4429b811becad2fa87
// Test for range-based for loop when the declarator declares // a new type // { dg-do compile } // { dg-options "-std=c++0x" } #include <initializer_list> void test() { for (struct S { } *x : { (S*)0, (S*)0 } ) ; for (struct S { } x : { S(), S() } ) ; }
google
chromium
initlist44
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist44.C
111
utf_8
a9d9b7efddf35ea8275c6db6167f04f4
// { dg-options -std=c++0x } #include <initializer_list> auto value = std::initializer_list<int>{ 1, 2, 3 };
google
chromium
rv-func3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-func3.C
161
utf_8
4632d870d35a4b6987dae1bea86eb7c0
// DR 1328 // { dg-options -std=c++0x } template <class T> struct A { operator T&(); // #1 operator T&&(); // #2 }; typedef int Fn(); A<Fn> a; Fn&& f = a;
google
chromium
pr32566
.C
native_client/pnacl-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
constexpr-ex4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ex4.C
200
utf_8
07b4ed4c960b6a993bcc9f7767092464
// { dg-options "-std=c++0x" } struct A { constexpr A(int) { } constexpr operator int() { return 1; }; }; template <class T> struct B { static constexpr A a = A(1); int ar[a]; }; B<int> b;
google
chromium
nsdmi2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi2.C
242
utf_8
6616cc2af1b383e5b3e2d4ffb858d686
// { dg-options -std=c++0x } struct A { int i; constexpr A(int i): i(i) {} }; struct B { A a1 = 1; A a2 { 2 }; A a3 = { 3 }; }; #define SA(X) static_assert(X,#X) constexpr B b; SA(b.a1.i == 1); SA(b.a2.i == 2); SA(b.a3.i == 3);
google
chromium
variadic55
.C
native_client/pnacl-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
noexcept13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept13.C
1,686
utf_8
ffb62e43eb65d1d46c8913f143adba04
// PR c++/49107 // { dg-options -std=c++0x } namespace std { template<typename _Tp> _Tp&& declval() noexcept; struct true_type { static const bool value = true; }; struct false_type { static const bool value = false; }; template<typename _Tp, typename _Arg> struct __is_direct_constructible_impl { ...
google
chromium
rv-deduce
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-deduce.C
177
utf_8
4a1d911674849aaf2afae9f3e27c4a95
// PR c++/36816, core issue 873 // { dg-options -std=c++0x } template <class T> void h (T&&) { } void (*pf)(int&) = &h; template <> void h(char&); template void h(double&);
google
chromium
decltype22
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype22.C
198
utf_8
2d3d1cd0fee7ad0b39004293b3accbd8
// PR c++/42761 // { dg-options "-std=c++0x" } template<typename _Tp> _Tp* fn(); template <class T> struct A { template <class U, class S = decltype(fn<T>())> struct B { }; }; A<int> a;
google
chromium
pr32127
.C
native_client/pnacl-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/pnacl-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/pnacl-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
decltype32
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype32.C
228
utf_8
19ef92a4b661f7b4e81200abca156eed
// PR c++/50075 // { dg-options -std=c++0x } template <typename T> auto make_array(const T& il) -> // { dg-error "not declared" } decltype(make_array(il)) { } int main() { int z = make_array(1); // { dg-error "no match" } }
google
chromium
nullptr20
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr20.C
399
utf_8
94afe1e15af80b216d3f892b6bc907d5
// { dg-do run } // { dg-options "-std=c++0x" } // Test passing to ellipisis #include <cstdio> #include <cstring> int main() { char buf1[64]; char buf2[64]; char buf3[64]; std::sprintf(buf1, "%p", (void*)0); std::sprintf(buf2, "%p", nullptr); decltype(nullptr) mynull = 0; std::sprintf(buf3, "%p", null...
google
chromium
variadic51
.C
native_client/pnacl-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
forw_enum3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum3.C
917
utf_8
d3fa38cefbf8b17930e7a217eb8cc1b1
// { dg-do compile } // { dg-options "-std=c++0x" } namespace S1 { namespace S2 { // opaque enum declarations enum class E1; enum class E2 : int; enum class E3 : short; enum E4 : int; enum E5 : short; // can be repeated enum class E1; enu...
google
chromium
union2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/union2.C
273
utf_8
0725c95a8f8cecb3c783bebe5ad0fea2
// Positive test for C++0x unrestricted unions // { dg-options -std=c++0x } struct A { A(); A(const A&); ~A(); }; union B { A a; B(); B(const B&); ~B(); }; B b; B b2(b); struct C { union { A a; }; C(); C(const C&); ~C(); }; C c;
google
chromium
initlist12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist12.C
263
utf_8
624ef6b8401c10b4e20eef0e49425332
// PR c++/38698 // { dg-options "-std=c++0x" } // { dg-prune-output "note" } struct A { int i; }; A a({1,2}); // { dg-error "no match" } union U { int i,j; }; U u({1,2}); // { dg-error "no match" } union V {}; V v({1}); // { dg-error "no match" }
google
chromium
explicit3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit3.C
787
utf_8
18d5596a3e815ee450148a01618316c8
// Test for "contextually converted to bool" // { dg-options "-std=c++0x" } struct A { explicit operator bool(); }; void f (bool); struct B { bool b; }; struct C { operator int(); }; struct D { operator int(); }; int main() { A a; C c; D d; // These contexts use an explicit bool conversion. if (a) {...
google
chromium
initlist23
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist23.C
195
utf_8
8d226b5ec13a739254991dee1a2a148e
// { dg-options "-std=c++0x" } #include <initializer_list> struct A { A& operator=(int i); A& operator=(std::initializer_list<int> l) { return *this; } }; int main() { A a; a = { }; }
google
chromium
linkage2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/linkage2.C
1,011
utf_8
48da5d871019e54cfb0707cccfef9aeb
// DR 743: A type without linkage shall not be used as the type of a // variable or function with linkage, unless // o the variable or function has extern "C" linkage (7.5 [dcl.link]), or // o the variable or function is not used (3.2 [basic.def.odr]) or is // defined in the same translation unit. // { dg-op...
google
chromium
constexpr-function2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C
1,383
utf_8
d3152403af08f251d7ad3a5bb33a6094
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 // Mess with the builtin by redeclaring. constexpr int abs(int x) { return x < 0 ? -x : x; } extern "C" { constexpr float squaref(float x) { return x * x; } } // implicitly inline, already: warn? inline constexpr double squared(double x) { retu...
google
chromium
forw_enum5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum5.C
1,591
utf_8
2680008c80659e801e133ceddd193ef4
// { dg-do compile } // { dg-options "-std=c++0x" } namespace one { struct S { enum { A = 1, B = 2 }; struct T { enum { B = 102 }; enum class E1; enum E2 : int; }; }; enum class S::T::E1 { A1 = A, B1 = B, C1 }; enum S::T::E2 : in...
google
chromium
constexpr-ctor7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C
266
utf_8
428a24772834c5b60c901fd975e8d96c
// PR c++/47199 // { dg-options "-std=c++0x -fno-elide-constructors" } template < int > struct S { constexpr S (int r):rr (r) { } S (const S &) = default; static constexpr S s () { return -1; } int rr; }; static const int d = S < 0 >::s ().rr;
google
chromium
variadic78
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic78.C
387
utf_8
2ff11a0463d3e57479047361f5d7b46f
// 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 () { static int x[] = { (M + N)... }; // { dg-error "mismatched argument pack lengths" } re...
google
chromium
constexpr-non-const-arg3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C
358
utf_8
659321d4e2df8513852b2cdb05f19c3e
// PR c++/49988 // { dg-options -std=c++0x } // { dg-do run } template<int ... I> struct X { }; struct A { char data[3]; template<int ... I> constexpr A(const char (&s)[3], X<I...> x) : data{ s[I]...} { } }; struct B { A a; B(const char (&s)[3]) : a{s,X<0,1,2>{}} { } }; int main() { B b{"12"}; if...
google
chromium
bracket2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/bracket2.C
341
utf_8
e12dc8acba2dcdb5c19d1b32c1e47b98
// { dg-do compile } // { dg-options "-std=gnu++0x" } template<int i> class X { /* ... */ }; X< 1>2 > x1; // // { dg-error "numeric constant" } X<(1>2)> x2; // Okay. template<class T> class Y { /* ... */ }; Y<X<1>> x3; // Okay, same as "Y<X<1> > x3;". Y<X<6>>1>> x4; // { dg-error "numeric constant" } Y<X<(...
google
chromium
variadic-init
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-init.C
934
utf_8
e27f5d2cf1ffacc9b03605f63974cadf
// { dg-do run } // { dg-options "-std=gnu++0x" } // PR c++/33510 #define SIZE_FROM_CTOR extern "C" void abort (); 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 () { #ifdef SIZE_FROM_CTOR static int x[] = { (M ...
google
chromium
constexpr-object1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
784
utf_8
0b1e2f83ebf2c028d0da630ca3c110b8
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 // 4.5.2 semantics // p 1 constexpr specifier // objects, static const data struct A1 { int i; }; // { dg-message "no user-provided default constructor" } constexpr int i1 = 1024; constexpr A1 a1 = A1(); // error: not a definition extern conste...
google
chromium
variadic-rref
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-rref.C
543
utf_8
c7998c4ac21872f368cab23c1418557f
// { dg-options "-std=c++0x" } // PR c++/33939 template<typename T> struct refs_only; template<typename T> struct refs_only<T &> {}; template<typename T> refs_only<T> foo( T && t) { return refs_only<T>(); } template<typename... T> struct va_refs_only; template<typename T> struct va_refs_only<T> : refs_only<T>...
google
chromium
explicit4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit4.C
318
utf_8
df3cc8872bd1f35a8bd2255b1473734c
// Negative explicit conv test. // { dg-options "-std=c++0x" } struct A { A(const A&, int = 0); // { dg-message "note" } }; struct B { explicit operator A(); }; int main() { B b; (A(b)); // OK (A(b,1)); // { dg-error "no match" } // { dg-message "candidate" "candidate note" { target *-*-* } 16 } }
google
chromium
constexpr-static8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static8.C
201
utf_8
d1b7eff55d28d145ce4ac7a122cbc7a6
// PR c++/50258 // { dg-options "-std=c++0x -fpermissive" } struct Foo { static const double d = 3.14; // { dg-warning "constexpr" } }; const double Foo::d; // { dg-warning "constexpr" }
google
chromium
vt-37737-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C
325
utf_8
8dc6cc6ecca7fceb134c773bab5a0209
// { dg-options "-std=c++0x" } template<class U, class... T> void f() // { dg-message "note" } { f<T...>(); // { dg-error "no matching" } // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } } template<> void f() { } // { dg-error "template-id" } int main() { f<char>(...
google
chromium
constexpr-sassert
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C
205
utf_8
1332b0b5b1d7639114fcedc32895dc58
// Allow static_assert in constexpr constructors, too. // { dg-options -std=c++0x } template<typename T> struct A { int i; constexpr A(int i) : i(i) { static_assert(sizeof(T) == 1, ""); } };
google
chromium
variadic56
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic56.C
448
utf_8
e40e17dbd8292e2f422b8b91bbee4dd0
// { dg-options "-std=gnu++0x" } template<typename... Elements> struct tuple { }; template<typename T, typename... Elements> struct tuple<T, Elements...> { int foo(); }; template<typename T, typename... Elements> struct tuple<T*, Elements...> { int bar(); }; template<typename T, typename... Elements> int tuple<T...
google
chromium
constexpr-expinst
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-expinst.C
271
utf_8
55faaba93cee6b33a24b974df8dff675
// { dg-options -std=c++0x } // Error: Explicit instantiation of a function template shall not use the // inline or constexpr specifiers template<class T> constexpr inline T bar(T x) { return x; } template constexpr inline float bar(float x); // { dg-error "specifier" }
google
chromium
decltype5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype5.C
733
utf_8
386eaa55c3c1d627d49e5f9e7adec123
// { 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 >::valu...
google
chromium
constexpr-array-ptr
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr.C
293
utf_8
ecdbf175b6085e5ea280bad40f670814
// { dg-options -std=c++0x } template<class T> constexpr T do_get(T* x, int n) { return x[n - 1]; } template<class T, int N> constexpr T get(T (&x)[N]) { return do_get(x, N); } constexpr int arr_i[] = {1}; constexpr auto var = get(arr_i); // #2 static_assert(var == arr_i[0], "Error");
google
chromium
variadic27
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic27.C
620
utf_8
e1c1c803b8b835b458fc646fcad89176
// { dg-options "-std=gnu++0x" } template<typename Signature> struct function_traits; template<typename R, typename... ArgTypes> struct function_traits<R(ArgTypes...)> { typedef R result_type; }; template<typename T, typename U> struct same_type { static const bool value = false; }; template<typename T> struct s...
google
chromium
pr34054
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34054.C
137
utf_8
bbcc78c712a69424c96cae056e31513a
// PR c++/34054 // { dg-do compile } // { dg-options "-std=c++0x" } template<typename... T> T foo() {} // { dg-error "not expanded|T" }
google
chromium
decltype-refbug
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C
317
utf_8
5be5466d65fc05f7bff75fd042614d66
// { dg-options "-std=c++0x" } // PR c++/33045 int && f (); 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; }; static_assert(is_same<decltype(f()), int&&>::value, "decltype of rvalue reference");
google
chromium
variadic116
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic116.C
491
utf_8
9aff68a0d0a0dd0522faa5bace766b73
// Origin: PR c++/48320 // { dg-options -std=c++0x } template<class... T> struct tuple { typedef int type; }; template<int... Indices> struct indices { }; template<unsigned i, class Tuple> struct tuple_element { typedef Tuple type; }; template<class Tuple, int... Indices, class Result = tu...
google
chromium
constexpr-ex1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
2,672
utf_8
1cfef724c81f966a6d30e39476f694ff
// { dg-do compile } // { dg-options "-std=gnu++0x" } // From N2235 // 4.1 constant-expression functions // 1 examples // 2 defined before first use // NOTE: this is only needed in contexts that require a constant-expression struct S { constexpr int twice(); constexpr int t(); // { dg-message "used but ...
google
chromium
rv-func2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-func2.C
131
utf_8
f002e057e3a639a5271e36fde842d5bb
// PR c++/49458 // { dg-options -std=c++0x } typedef void ftype(); struct A { operator ftype&(void); }; ftype &&frvref = A();
google
chromium
decltype23
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype23.C
187
utf_8
e125970dc9e513a59e830fbb9918544c
// { dg-options -std=c++0x } int x, &&y = static_cast<int &&>(x); typedef decltype((y)) myInt; // `y' is a parenthesized id-expression of type int that is an lvalue typedef int &myInt;
google
chromium
noexcept01
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept01.C
1,145
utf_8
e259f451b9d075f21a6300346385a3e3
// Test for noexcept-expression // { dg-options "-std=c++0x -O2" } #include <typeinfo> #define SA(X) static_assert(X, #X) void f(); void g() throw(); SA(noexcept(g())); SA(!noexcept(f())); SA(!noexcept(throw 1)); SA(noexcept(42)); struct A { virtual ~A(); }; struct B: public A { virtual ~B(); }; A* ap; struc...
google
chromium
constexpr-static6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C
246
utf_8
9f7bda2839793d53468e1c3517bb1c4d
// { dg-options -std=c++0x } struct B { constexpr operator int() { return 4; } }; template <int I> struct C; template<> struct C<4> { typedef int TP; }; template <class T> struct A { constexpr static B t = B(); C<t>::TP tp; }; A<B> a;
google
chromium
pr38646
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr38646.C
263
utf_8
7dec6eb3850dc7e2608ab295cbf6257a
/* PR c++/38646 */ /* { dg-do compile } */ /* { dg-options "-std=c++0x" } */ template<int...> struct A; template<int... N> struct A<N..., N...> /* { dg-error "must be at the end" } */ { template<typename> struct B; template<typename T> struct B<T*> {}; };
google
chromium
rv9p
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv9p.C
276
utf_8
b873eb6dd4e6daa5c9f634ffe8e7b919
// PR c++/36744 // { dg-options "-std=c++0x" } // { dg-do run } struct S { S(): i(2) {} S(S const&s): i(s.i) {} int i; }; void f(S x) { x.i = 0; } extern "C" void abort (void); int main() { S y; f(static_cast<S&&>(y)); if (y.i != 2) abort (); return 0; }
google
chromium
variadic48
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic48.C
173
utf_8
a57a0da544372c92597786efed9659fd
// { dg-options "-std=gnu++0x" } template<typename T, typename... Args> int& f(const T&, Args...); template<typename T> float& f(const T&); float& g() { return f(17); }
google
chromium
decltype21
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype21.C
670
utf_8
130b7d31574d292623b4319f9b4e06bc
// PR c++/6709 (DR 743) // PR c++/42603 (DR 950) // { dg-options -std=c++0x } template <class T> T make(); struct p { typedef int t; }; struct c : decltype(make<p>()) {}; decltype(make<p>())::t t; // PR c++/49823 template < typename T > auto f( const T &x ) -> typename decltype( x )::type; // ICE on here templa...
google
chromium
defaulted24
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted24.C
128
utf_8
4ae64b0b8ea5440ba30fd7fee1889b9f
// PR c++/48280 // { dg-options -std=c++0x } struct S { template < typename > S (const S &) = default; // { dg-error "" } };
google
chromium
initlist56
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist56.C
714
utf_8
80d90cd8c3982702ff2327930b146ec5
// PR c++/47453 // { dg-options "-std=c++0x -pedantic-errors" } // invalid int a({0}); // { dg-error "" } // invalid int const &b({0}); // { dg-error "" } // invalid struct A1 { int a[2]; A1(); }; A1::A1():a({1, 2}) { } // { dg-error "" } struct A { explicit A(int, int); A(int, long); }; // invalid A c({1, 2})...
google
chromium
constexpr-ref1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ref1.C
640
utf_8
de1b4b7af6ab721083fcc780f34b25b8
// PR c++/49172 // { dg-options -std=c++0x } #define SA(X) static_assert((X),#X) constexpr int g() { return 42; }; constexpr int(&rg)() = g; // #1 SA(rg() == 42); constexpr int i = 24; constexpr int const& ri = i; // #2 SA(&ri == &i); SA(ri == 24); void f() { constexpr int(&rg)() = g; // #1 SA(rg() == 42); ...
google
chromium
variadic72
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic72.C
243
utf_8
abcb3f8130d4cb79480994b5d80f646c
// { dg-options "-std=gnu++0x" } struct A {}; struct B {}; struct C {}; template<typename... Mixins> struct mixed_up : public Mixins... { }; void fA(A); void fB(B); void g() { mixed_up<A, B, C> m; fA(m); fB(m); fC(m); }
google
chromium
range-for13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for13.C
1,678
utf_8
6394cec112349bc77603279802c0bc0a
// Test for errors in range-based for loops // with member begin/end // { dg-do compile } // { dg-options "-std=c++0x" } //These should not be used template<typename T> int *begin(T &t) { T::fail; } template<typename T> int *end(T &t) { T::fail; } struct container1 { int *begin(); //no end }; struct...
google
chromium
nolinkage1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C
382
utf_8
b2aeffa807ca947f2ac1ce254e43f97a
// DR 757 allows using types without linkage in declarations with linkage. // Test that this doesn't lead to link-time collisions. // { dg-additional-sources "nolinkage1a.cc" } // { dg-do link } // { dg-options -std=c++0x } #include "nolinkage1.h" typedef struct { int i; } *AP; void f(AP) { } A<AP> a; static void...
google
chromium
constexpr-default-ctor
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-default-ctor.C
337
utf_8
f2909d70b1c632b37ce64198af5a3303
// { dg-options -std=c++0x } struct A { int i; constexpr A():i(42) { }; }; struct B: A { }; constexpr int f(B b) { return b.i; } struct C { C(); }; // { dg-message "calls non-constexpr" } struct D: C { }; // { dg-message "no constexpr constructor" } constexpr int g(D d) { return 42; } // { dg-error ...
google
chromium
decltype8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype8.C
370
utf_8
bbdff105c665351973aaa6a25eaa0940
// PR c++/34267 // { dg-do compile } struct A {}; __decltype (A); // { dg-error "must be an expression" } template<int> struct B { __decltype (A); // { dg-error "must be an expression" } __decltype (~A); // { dg-error "must be an expression" } __decltype (B); // { dg-error "must be an expression" } __decltype...
google
chromium
variadic9
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic9.C
810
utf_8
39a4617d5385099583397f9c019a4b4c
// { dg-options "-std=gnu++0x" } template<typename T1, typename T2> struct pair {}; template<typename... Args> struct tuple { static const int value = 0; }; template<> struct tuple<pair<int, float> > { static const int value = 1; }; template<typename U> struct tuple<pair<int, U> > { static const int value = 2;...
google
chromium
noexcept05
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept05.C
574
utf_8
a7777fc2421b47ed6924379162ecb7ba
// Make sure that we force an LSDA for a noexcept spec so // that the personality routine will call terminate. Also check that we // optimize away the EH cleanup for var because the personality routine // will call terminate before unwinding: there should not be an EH region // (i.e. LEHB/LEHE labels) around the call ...
google
chromium
nullptr02
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr02.C
372
utf_8
d5f395547392e9d98091aa5bb12cb267
// { dg-do compile } // { dg-options "-std=c++0x" } // Test assignment to nullptr_t typedef decltype(nullptr) nullptr_t; const nullptr_t np1 = nullptr; const nullptr_t np2 = __null; const nullptr_t np3 = 0; const nullptr_t np4 = np1; const nullptr_t np5 = np2; const nullptr_t np6 = np3; const nullptr_t np7 = np4; co...
google
chromium
variadic-ex3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C
473
utf_8
d26991138ebd9a25b8b401d2f10db7f0
// { dg-options "-std=gnu++0x" } template<class X, class Y, class... Z> X f(Y); // { dg-message "note" } void g() { int i = f<int>(5.6); int j = f(5.6); // { dg-error "no matching" } // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } f<void>(f<int, bool>); ...
google
chromium
pr31445
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31445.C
164
utf_8
addbcb87d162dffbefde94ee17a3d0e7
// { dg-options "-std=gnu++0x" } template <typename... T> struct A { void foo(T...); A(T... t) { foo(t); } // { dg-error "parameter packs|t" } }; A<int> a(0);
google
chromium
sfinae22
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae22.C
420
utf_8
635858719f77eeeff48eaa26d602edf2
// PR c++/48745 // { 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... Args> decltype(T{create<Args>()...}, char()) f(int); templ...
google
chromium
variadic8
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic8.C
451
utf_8
d0dc500406e92f2a7bf9d8ec9c78c329
// { 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<typename T> struct tuple_base<T*> { static const int value = 2; }; template<typename... Args> struct tuple_of_pointers : tu...
google
chromium
implicit-trivial1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C
504
utf_8
7928cba3b7ed61860b249cd1ade0d694
// PR c++/46807 // { dg-options -std=c++0x } // In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial, // even though doing overload resolution would mean calling the template // constructor. In C++0x, we do overload resolution to determine triviality. struct A { A() {} private: template <class...
google
chromium
variadic70
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic70.C
405
utf_8
1f25f157916c74695bfab166f4dea80e
// { dg-do run } // { dg-options "-std=gnu++0x" } template <typename T, T... Args> struct bomb; template <typename T> struct bomb<T> { static const T value = 0; }; template <typename T, T v, T... Args> struct bomb<T, v, Args...> { static const T value = v + bomb<T, Args...>::value; }; extern "C" void abort(); int...
google
chromium
overload-conv-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/overload-conv-1.C
288
utf_8
3a17cd678756b6b530cc9d447f967678
// { dg-options "--std=c++0x" } // { dg-do link } struct S {}; struct T { operator S() { return S(); } }; struct U { operator S&() { return *static_cast<S*>(0); } }; void f(const S&); void f(S&&) {} void g(const S&) {} void g(S&&); int main() { T t; f(t); U u; g(u); }
google
chromium
constexpr-typedef1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
274
utf_8
ae133db1f290b78e3c82f5736cbbedd5
// PR c++/50508 // { dg-options -std=c++0x } template <class T> struct integral_constant { typedef T value_type; constexpr operator value_type() { return true; } }; static constexpr bool value = integral_constant<bool>() && true;