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
android
vt-35026
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-35026.C
134
utf_8
02ddddadefdae7d66159f7b0d18b85eb
// { dg-do compile { target c++11 } } template<typename... T> struct A { T* x[1]; // { dg-error "parameter packs|T" } }; A<int> a;
google
android
bracket3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/bracket3.C
322
utf_8
8a88bfdea24a54c70053b5d53016d6f9
// { dg-do compile { target c++11 } } // { dg-options "-std=c++98 -Wc++11-compat" } template<int N> struct X {}; X<1 >> 2> x; // { dg-warning "is treated as|suggest parentheses" } // From cp/parser.c typedef int Y; template <int V> struct Foo {}; Foo<Y () >> 5> r; // { dg-warning "is treated as|suggest parentheses" ...
google
android
variadic160
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C
1,402
utf_8
5348f57a43bc1324c15c9e5945ba3ebe
// PR c++/61539 // { dg-do compile { target c++11 } } template <typename _CharT> class A; template <typename> class B; template <class charT> class C; template <> class C<char> { virtual void xparse (int &, const B<A<char> > &) const; }; template <class T, class charT = char> class G : C<charT> { public: G (void *...
google
android
decltype20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype20.C
136
utf_8
43e47f0ebf801f67ae006309a96c6d50
// PR c++/42277 // { dg-do compile { target c++11 } } struct S { int s; }; template <int N> void foo () { S s; decltype (s.s) i; }
google
android
constexpr-array-ptr2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr2.C
475
utf_8
8fd033f4e6b69599a1e293c45d0814cb
// { dg-do compile { target c++11 } } template<class T> struct IsNegative { int dummy; // Workaround for empty class problem constexpr IsNegative() : dummy(0) {} constexpr bool operator()(const T& x) { return x < T(0); } }; template<class T, int N, class Pred> constexpr bool has_neg(T (&x)[N], Pred p) { ...
google
android
variadic140
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic140.C
512
utf_8
3588193f67880fd7b7b73747e553c75a
// Origin: PR c++/53609 // { dg-do compile { target c++11 } } template<class...I> struct List{ static const bool is_ok = false;}; template<int T> struct Z { static const int value = T; static const int value_square = T * T; }; template<template<int> class U> struct List<U<2>, U<3>, U<4>, U<9>> { static const bool...
google
android
unnamed_refs
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/unnamed_refs.C
618
utf_8
6d6ff5e1107f65ae6fdc850aaada06ea
// I, Howard Hinnant, hereby place this code in the public domain. // Test: Unamed rvalue references are treated as lvalues. // { dg-do compile { target c++11 } } template <bool> struct sa; template <> struct sa<true> {}; struct one {long x[1];}; struct two {long x[2];}; struct A {}; one foo(const A&) {return...
google
android
enum13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum13.C
471
utf_8
dfcd433cad05f21651e2837ac2a726af
// PR c++/48780 // { dg-do compile { target c++11 } } // { dg-options "-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); // { d...
google
android
inh-ctor5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C
517
utf_8
fda4f7d4f4b57c79d7734d634ae9041f
// { dg-do compile { target c++11 } } struct B1 { B1(int) { } }; struct B2 { B2(double) { } }; struct D1 : B1 { // { dg-error "no match" } using B1::B1; // implicitly declares D1(int) int x; }; void test() { D1 d(6); // OK: d.x is not initialized D1 e; // { dg-error "deleted" } D1 has no de...
google
android
variadic79
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic79.C
231
utf_8
d95dcd2a87468fdc922e945ceddff2c3
// PR c++/33213 // { dg-do compile { target c++11 } } template<template<typename> class...> struct A; template<template<typename...> class... B> struct A<B...> {}; // { dg-error "mismatch|'template<class ...> class ... B ...'" }
google
android
constexpr-empty3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty3.C
176
utf_8
f2be36db1d24de846eca69288f8e004a
// { dg-do compile { target c++11 } } struct IsLiteral {}; constexpr auto ab = IsLiteral(); constexpr IsLiteral bar(IsLiteral x) { return x; } constexpr auto xy = bar(ab);
google
android
variadic15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic15.C
682
utf_8
f40e859555345f38b32393eb2e365035
// { dg-do compile { target c++11 } } 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; };...
google
android
constexpr-incomplete3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete3.C
173
utf_8
5f8ea4d699883534fc470b2a2d74c3aa
// PR c++/49015 // { dg-do compile { target c++11 } } class A; class B { friend constexpr B f(A); // Line 5 }; class A {}; constexpr B f(A) { return B(); } // Line 10
google
android
constexpr-memfn1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C
327
utf_8
f6a2053c56fbea1b283c4494a5d9c1c9
// PR c++/48296 // { dg-do compile { target c++11 } } struct X { constexpr X() { } constexpr X f(X x) { return x; } constexpr X g(X x); }; constexpr X X::g(X x) { return x; } struct Y { Y() { } constexpr Y f(Y y); // { dg-error "not a literal type" } static constexpr Y g(Y y) {} // { dg-error "constexpr...
google
android
noexcept12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept12.C
242
utf_8
5842144298bb82cc4e1b5479f289fa56
// Test that we handle merging with deferred noexcept. // { dg-do compile { target c++11 } } template <class U> struct O { template <class T> void f() noexcept(noexcept(T())); }; template<> template<> void O<int>::f<int>() noexcept { }
google
android
constexpr-cache1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-cache1.C
254
utf_8
a3e1dfa48f53c341c8fd1fed39d39593
// PR c++/51433 // { dg-do compile { target c++11 } } constexpr int f(); constexpr int g() { return f(); } extern const int n = g(); // dynamic initialization constexpr int f() { return 42; } extern const int m = g(); static_assert(m == 42, "m == 42");
google
android
constexpr-ctor2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor2.C
127
utf_8
b53901b01ead6799c051d88913ebc375
// { dg-do compile { target c++11 } } struct A { A(); }; struct B : A { constexpr B(): A() { } // { dg-error "A::A" } };
google
android
initlist63
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist63.C
205
utf_8
5367079ed93e597120e1ef329b147f75
// Origin PR c++/51475 // { dg-do compile { target c++11 } } #include <initializer_list> struct A { A(int*); }; struct B { const std::initializer_list<A>& x; }; B b = {{1}}; // { dg-error "" }
google
android
constexpr-mutable1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-mutable1.C
225
utf_8
bf6f271556a8b151987d288c88c9b77d
// { dg-do compile { target c++11 } } struct A { int i; mutable int j; }; constexpr A a = { 0, 1 }; constexpr A b = a; // { dg-error "mutable" } constexpr int i = a.i; constexpr int j = a.j; // { dg-error "mutable" }
google
android
enum1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum1.C
135
utf_8
f9db6c19fc344b45754b8ddbe2566345
// PR c++/38021 // { dg-do compile { target c++11 } } enum : { }; // { dg-error "expected" } enum : 3 { }; // { dg-error "expected" }
google
android
defaulted24
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted24.C
137
utf_8
9b830e70f4bd9e8040d06907198842e0
// PR c++/48280 // { dg-do compile { target c++11 } } struct S { template < typename > S (const S &) = default; // { dg-error "" } };
google
android
variadic45
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic45.C
179
utf_8
de2d2302afa2c04b484c7754e4c5492e
// { dg-do compile { target c++11 } } template<typename... Args> int& f(Args...); template<typename T1, typename T2> float& f(T1, T2); float& g() { return f(17, 3.14159); }
google
android
error2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error2.C
195
utf_8
64639657f60c12134229fb047d181d85
// PR c++/38656 // { dg-do compile { target c++11 } } template<int> int foo(); template<typename F> void bar(F f) { f((foo<0>()=0)...); // { dg-error "pattern '\\(foo\\<0\\>\\)\\(\\)=0'" } }
google
android
rv-dotstar
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-dotstar.C
252
utf_8
589e28fb5e0fffb1d369fc47ca52bcfd
// PR c++/49389 // { dg-do compile { target c++11 } } template<class T> T&& val(); struct A {}; typedef decltype(val<A>().*val<int A::*>()) type; template<class> struct assert_type; template<> struct assert_type<int&&> {}; assert_type<type> test;
google
android
decltype40
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype40.C
3,165
utf_8
6ecda3200d1e3dc5bcc9f1d705d4288d
// PR c++/51222 // { dg-do compile { target c++11 } } template<class T> struct add_rref { typedef T&& type; }; template<> struct add_rref<void> { typedef void type; }; template<class T> typename add_rref<T>::type declval(); template<class T, class U, class = decltype(::delete ::new T(declval<U>())) > auto f(i...
google
android
rvo
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rvo.C
353
utf_8
9328b0378950a77e4d83178cdca07ca6
// { dg-do run { target c++11 } } // 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(); if (rvalue_co...
google
android
implicit8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit8.C
661
utf_8
b709e75cca2c833f498e25a0c3ba2957
// The hack for PR c++/44909 breaks this testcase. We need feedback // from the C++ committee to know how to proceed. // { dg-do compile { target c++11 } } struct A { A(); A(A&); }; struct B; struct BP { BP(const B&); }; struct B { B(); B(B&&); B(const BP&); };
google
android
enum12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum12.C
368
utf_8
94effbb2a76778ab55a7d31e5660b288
// PR c++/48780 // { dg-do compile { target c++11 } } // { dg-options "-fabi-version=0" } 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); __builtin...
google
android
enum25
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum25.C
239
utf_8
d69ddb30d1feb9e35bc7751f26929957
// PR c++/56793 // { dg-require-effective-target c++11 } struct A { enum struct B {X, Y} b; } a; enum struct D {X,Y}; struct C { } c; int main () { if (a.b == a.B::Y) a.b = A::B::X; c.D::Y; // { dg-error "not a member" } }
google
android
decltype1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype1.C
679
utf_8
346bf8f6597611bdb1098a12ad2eb4c7
// { dg-do compile { target c++11 } } 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; }; const int& foo(); int i; struct A { double x; }; const A* a = new A(); static_assert(is_same<decltype(fo...
google
android
diag1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/diag1.C
738
utf_8
e111c1f4739203185f9d6294ebadcc5f
// { dg-do compile { target c++11 } } 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:...
google
android
initlist-array4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array4.C
246
utf_8
6c1907913d332611dd16d03002d759f9
// PR c++/58636 // { dg-do compile { target c++11 } } #include <initializer_list> // { dg-error "pointer to reference" "" { target *-*-* } 0 } int foo(std::initializer_list<int&&>); int i = foo({ 0 }); // { dg-error "std::initializer_list" }
google
android
rv-template1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-template1.C
154
utf_8
5b6ef7b6e035ce04da4a7a9ed3f09464
// PR c++/44870 // { dg-do compile { target c++11 } } void foo(int&& data); template <typename T> void bar(T t) { foo(int()); } void baz() { bar(0); }
google
android
nsdmi-template7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template7.C
221
utf_8
bca364bb7be51173c515446b467d101b
// PR c++/58725 // { dg-do compile { target c++11 } } struct A { template<int=0> struct B { struct C { int x = 0; double y = x; } c; }; }; int main() { A::B<>(); }
google
android
alias-decl-37
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-37.C
464
utf_8
6399fdce6fd4f13e2010c38070408833
// PR c++/57138 // { dg-do compile { target c++11 } } template <template <typename ... X> class T, typename ... Y> struct D { template <typename ... Z> using type = T <Y..., Z...>; // { dg-error "pack expansion" } }; template <typename T> class A {}; template <typename X, typename Y> struct B; template <typename T...
google
android
pr58072
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58072.C
1,245
utf_8
016ebcf6c9d25c8f22cd01c52f674b94
// { dg-do compile { target c++11 } } // PR c++/58072 extern 'c'void*blah(void*); // { dg-error "expected unqualified-id before user-defined character literal" } extern L'c'void*Lblah(void*); // { dg-error "expected unqualified-id before user-defined character literal" } extern u'c'void*ublah(void*); // { dg-error "e...
google
android
alias-decl-9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-9.C
161
utf_8
2b0ac9ee7e77902ee76b92dfbfcc37b3
// { dg-do compile { target c++11 } } template <class T> struct A { using Result = T; }; template <class A> using Arg = typename A::Result; Arg<A<int>> b;
google
android
constexpr-template4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template4.C
586
utf_8
a05dfbf634e5313455c47b794057b288
// PR c++/55931 // { dg-do compile { target c++11 } } #include <type_traits> template<typename Type> class Test { public: constexpr Test(const Type val) : _value(val) {} constexpr Type get() const {return _value;} static void test() { static constexpr Test<int> x(42); ...
google
android
variadic133
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic133.C
807
utf_8
16289b67a240f0f662766372110d6428
// PR c++/53039 // { dg-do compile { target c++11 } } template <class, class> struct is_convertible { static const bool value = true; }; template<bool, class T> struct enable_if { typedef T type; }; template <bool...> struct Xs { static const bool value = true; }; template<typename... BTs> class BType {...
google
android
rv9p
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv9p.C
262
utf_8
8568feb0868ae4989d6f1e0f0816198b
// PR c++/36744 // { dg-do run { target c++11 } } 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
android
inh-ctor17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor17.C
485
utf_8
00a6abfdfac7889f5de46610f04cc955
// PR c++/56323 // { dg-do compile { target c++11 } } struct A { A(int i); }; typedef A B; struct C : B { using B::B; }; struct D : B { using B::A; }; C c(0); D d(0); template <class T> struct E { typedef T type; }; template <class T> struct F : E<T>::type { using E<T>::type::type; // error: E<T>::type...
google
android
decltype17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype17.C
489
utf_8
559c97a99220e8084d7a6188f0ade9dc
// PR c++/36628 // { dg-do run { target c++11 } } #include <typeinfo> #include <string.h> int rvalue(); int& lvalueref(); int&& rvalueref(); decltype(true ? rvalue() : rvalue()) f() {} decltype(true ? lvalueref() : lvalueref()) g() {} decltype(true ? rvalueref() : rvalueref()) h() {} int main() { if (strcmp (t...
google
android
not_special
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/not_special.C
1,154
utf_8
cb5b10af278fbafac78a6d53829b3d37
// 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 cause compiler declared // copy ctor or assignment to be deleted. // { dg-do compile { target c++11 } } #include <assert.h> template <bool> struct ...
google
android
pr32115
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32115.C
164
utf_8
d408752b3df9d3d5da94f8600fa0cd5a
// { dg-do compile { target c++11 } } template<typename ...T, int = 0> struct A {}; // { dg-error "end of" } A<int> a; // { dg-error "mismatch|expected|invalid" }
google
android
variadic9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic9.C
815
utf_8
8102d3233e2278c69b93f7287f306536
// { dg-do compile { target c++11 } } 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...
google
android
constexpr-empty
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty.C
129
utf_8
bd4892119061dcc2091023dfa80ffb9f
// { dg-do compile { target c++11 } } struct Empty {}; constexpr bool f(Empty) { return true; } constexpr bool x(f(Empty{}));
google
android
variadic50
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic50.C
155
utf_8
1a2755972884e0708f0c195316fbba41
// { dg-do compile { target c++11 } } int& f(int, double, ...); template<typename... Args> float& f(Args...); float& g() { return f(17, 3.14159, 3); }
google
android
range-for27
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for27.C
228
utf_8
19d7a40077513d6c8d358787faa440a7
// PR c++/58503 // { dg-require-effective-target c++11 } // { dg-options "-fpermissive -w" } struct c { }; template<int> void foo() { for (auto i : c()) { } } c* begin(const c&); c* end(const c&); template void foo<1>();
google
android
alias-decl-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
485
utf_8
dbf5ebe6ff1680117cb9bea10ed1598e
// { dg-do compile { target c++11 } } // [temp.alias]/3: // The type-id in an alias template declaration shall not refer // to the alias template being declared. The type produced by an // alias template specialization shall not directly or indirectly // make use of that specialization. template <class T> struct A; t...
google
android
initlist-protected
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-protected.C
295
utf_8
1b5c7e432be89c3edcbfaad424a2e353
// PR c++/54325 // { dg-do compile { target c++11 } } class base { protected: base() {} }; class derived : public base { public: derived() : base{} // <-- Note the c++11 curly brace syntax {} }; int main() { derived d1; return 0; }
google
android
constexpr-array3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array3.C
149
utf_8
8b7c8e7c1b64cfa0626f7f2311c9fef5
// PR c++/48132 // { dg-do compile { target c++11 } } struct C { constexpr C (int x) : c (x) {} int c; }; void foo () { C a[] = { C (0) }; }
google
android
sfinae2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae2.C
904
utf_8
84b9fb28eaa47b1cd4cbefff942c94f2
// PR c++/44967 // { dg-do compile { target c++11 } } template <typename T> T&& declval(); template<typename T1, typename T2, typename... Args> struct has_construct { typedef char one; typedef struct {char _m[2]; } two; template<typename U1, typename U2, typename... Args2> static decltype(declval<U1>...
google
android
defaulted2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted2.C
1,348
utf_8
ff0975b78a3fa3e103fac2518d1c1a72
// Negative test for defaulted/deleted fns. // { dg-do compile { target c++11 } } void f(); // { dg-message "previous" } void f() = delete; // { dg-error "deleted" } struct A { A() { } // { dg-message "previous" } void f() = default; // { dg-error "default" } }; A::A() = default; // { dg-error "redefiniti...
google
android
rv2p
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv2p.C
15,166
utf_8
e0447830998322d311c6dae7bcf22e59
// I, Howard Hinnant, hereby place this code in the public domain. // Test overload resolution among reference types // { dg-do compile { target c++11 } } // { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } } template <bool> struct sa; template <> struct sa<tr...
google
android
nsdmi-template1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
276
utf_8
6a97f223fff723db9f950c32a7828e35
// { dg-do run { target c++11 } } struct base { int calc_avg() { return 42; } }; template <class T> struct nsdmi : T { nsdmi() {} int avg() { return avg_; } int avg_ = this->calc_avg(); }; int main() { nsdmi<base> x; if (x.avg() != 42) __builtin_abort(); }
google
android
static_assert7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C
366
utf_8
10b488e73e6cc35cd83a7ed1625b7f03
// PR c++/53166 // { dg-do compile { target c++11 } } // { dg-options "-Waddress" } template <typename X, X a> struct A { static_assert (a != nullptr, "oops"); static_assert (nullptr != a, "oops"); int f() { static_assert (a != nullptr, "oops"); static_assert (nullptr != a, "oops"); return 1; } ...
google
android
initlist26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist26.C
168
utf_8
c72bde500f10f589f1bac4efa38cb9e8
// PR c++/42059 // { dg-do compile { target c++11 } } // { dg-options "" { target { ! c++1y } } } void foo (int i) { int a[i]; a = { }; // { dg-error "assign" } }
google
android
decltype51
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype51.C
129
utf_8
78e450b694e6ccb6642eab327e5e75e9
// PR c++/53721 // { dg-require-effective-target c++11 } struct A { void f() {}; auto g() -> decltype(this->f()) { } };
google
android
variadic62
.C
toolchain/gcc/gcc-4.9/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
android
initlist-lifetime1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime1.C
678
utf_8
19ff32f1a36ba4fb033bf780ec11978b
// Test that we properly extend the lifetime of the initializer_list // array even if the initializer_list is a subobject. // { dg-do run { target c++11 } } #include <initializer_list> extern "C" void abort(); bool ok; bool do_throw; struct A { A(int) { if (do_throw) throw 42; } ~A() { if (!ok) abort(); } }; t...
google
android
inh-ctor15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
308
utf_8
fd18815086e80a852974d0ac3171f5ad
// Discussions on the core reflector indicate that not inheriting base copy // constructors was a deliberate choice. // { dg-do compile { target c++11 } } struct A { A(int); }; struct B: public A { using A::A; }; A a (42); B b1 (24); // inherited B b2 (a); // not inherited { dg-error "no match" }
google
android
initlist27
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist27.C
129
utf_8
a91da33ee84c2ea78d5b6401d75d528e
// PR c++/42061 // { dg-do compile { target c++11 } } int& i = { j }; // { dg-error "invalid initialization|was not declared" }
google
android
vt-33964
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-33964.C
412
utf_8
e0bac3d7aa1877d61d0060b5ab51070a
// { dg-do compile { target c++11 } } template<typename ... Args> struct foo { static bool const value = true; }; template<typename ... Args> struct foo< typename Args::is_applied... > // { dg-error "not deducible|Args" } { static bool const value = false; }; struct not_applied { typedef void is_applied; }; s...
google
android
variadic32
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic32.C
171
utf_8
ae10d8b02067395c47adbd14383ec8de
// { dg-do compile { target c++11 } } template<typename... T> void eat(const T&...) { } void f() { eat(); eat(1); eat(1, 2); eat(17, 3.14159, "Hello, World!"); }
google
android
constexpr-aggr1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C
268
utf_8
b2677ed5d88c259b9b0fac3db40c4180
// PR c++/60951 // { dg-do compile { target c++11 } } struct Foo { constexpr Foo(int x = 0) : memb(x) {} int memb; }; struct FooContainer { Foo foo[2]; }; void fubar() { int nonConst = 0; FooContainer fooContainer; fooContainer = { { 0, nonConst } }; }
google
android
sfinae42
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae42.C
1,297
utf_8
6df8559e47140ac644ebf747ad1e33df
// PR c++/54738 // { dg-do compile { target c++11 } } template<class T> T&& declval(); template<class F, class T1, class... Ts> decltype(((*declval<T1>()).*declval<F>())(declval<Ts>()...)) test1(int); template<class...> void test1(...); template<class F, class T1, class... Ts> decltype((declval<T1>().*declval<F>())...
google
android
warn_cxx0x
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C
236
utf_8
b823b50bc430c6f0253adad46e2b9fea
// { dg-do compile { target c++11 } } // { dg-options "-std=gnu++98 -Wc++11-compat" } int static_assert; // { dg-warning "is a keyword" } int nullptr; // { dg-warning "is a keyword" } void foo() { static_assert = 5; nullptr = 5; }
google
android
pr51313
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr51313.C
228
utf_8
a349b6d9e2c645bc683f68632fc28b5b
// PR c++/51313 // { dg-do compile { target c++11 } } class ostream; extern "C" { extern int isdigit (int); } ostream& operator<<(ostream&, const unsigned char*); extern ostream cout; int main() { cout << isdigit(0); }
google
android
constexpr-wstring1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-wstring1.C
1,012
utf_8
7bca20d6ac21d6cb78ab16d5c52b7e64
// PR c++/48570 // { dg-do run { target c++11 } } extern "C" void abort (); constexpr wchar_t foo (int i) { return L"0123"[i]; } constexpr char16_t bar (int i) { return u"0123"[i]; } constexpr char32_t baz (int i) { return U"0123"[i]; } const wchar_t foo0 = foo (0); const wchar_t foo1 = foo (1); const wchar_t foo2 = f...
google
android
variadic106
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic106.C
260
utf_8
905fe01bdbc2e97450d3f9f1d066487d
// Origin: PR c++/47326 // { dg-do compile { target c++11 } } template <int _N> struct A { typedef int value_type; }; template <typename... _ARGS> auto f (_ARGS... args) -> typename A<sizeof...(args)>::value_type { return 12; } int main() { f(1,2); }
google
android
sfinae22
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae22.C
429
utf_8
0bb2af3b3aba694453aa4ddc3c11111c
// PR c++/48745 // { dg-do compile { target c++11 } } 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...
google
android
constexpr-bitfield
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield.C
155
utf_8
e4e15e959aaae288fa7a722d7abb7509
// PR c++/46369 // { dg-do compile { target c++11 } } struct A { unsigned i : 1; }; constexpr A f() { return { 1 }; } constexpr bool b = (f().i == 1);
google
android
decltype41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype41.C
726
utf_8
72998cd64ca70f08cf0e10c26977ba53
// Core 1273 // { dg-do compile { target c++11 } } template <class T> struct C; template <class T> struct D; class A { int i; static int j; friend struct C<int>; friend struct D<int>; } a; class B { int i; static int j; friend struct C<float>; friend struct D<float>; } b; template <class T> struct C...
google
android
decltype29
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype29.C
424
utf_8
c80c46a26e24be5c8c5d9ee53858de52
// PR c++/44175 // { dg-do compile { target c++11 } } template <bool, class T> struct enable_if { }; template <class T> struct enable_if <true, T> { typedef T type; }; template <int x> typename enable_if<x==0,int>::type ft() {} template<class F, int N> decltype (ft<F> (F())) // { dg-error "depth" } ft() {} int mai...
google
android
nsdmi-template6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template6.C
181
utf_8
3a5b1755ff3b8f25bdc5d3343ec58d7e
// PR c++/58829 // { dg-do compile { target c++11 } } struct A { int f() {return 0;} } a; struct B { template<int=0> struct C { int i = a.f(); }; }; B::C<> c;
google
android
gen-attrs-42
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-42.C
274
utf_8
20b999640e2ea139d7fc861ed7b40c59
// { dg-options "-pedantic" } // { dg-do compile { target { i?86-*-* && ilp32 } } } // { dg-require-effective-target c++11 } struct A { [[gnu::fastcall]] void f(); }; int main() { typedef void (A::*FP)(); FP fp[] = {&A::f}; // { dg-error "cannot convert" } }
google
android
constexpr-template3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template3.C
204
utf_8
0bcbbb5fdaa0906b82119d032554061e
// { dg-do compile { target c++11 } } struct A { constexpr operator int() { return 42; } }; template<class T> struct B { static const int versionConst = A(); enum { versionEnum = versionConst }; };
google
android
auto10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto10.C
304
utf_8
d131ba46fa4bcaa7d35a00572aeccee4
// Positive test for auto // { dg-do run { target c++11 } } #include <typeinfo> extern "C" void abort(); int main() { if (auto i = 42L) { if (typeid (i) != typeid (long int)) abort (); } while (auto i = 1) { if (typeid (i) != typeid (int)) abort (); break; } }
google
android
constexpr-specialization
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C
454
utf_8
b4f7fc3e8559006784cd512e8ac3ae22
// PR c++/56871 // { dg-do compile { target c++11 } } template<typename T> constexpr int foo(T); template<> int foo(int); template<> int foo(int); // { dg-error "previous" } template<> constexpr int foo(int); // { dg-error "redeclaration" } template<typename T> int bar(T); template<> constexpr int bar(int...
google
android
constexpr-virtual
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual.C
186
utf_8
807f755543bd07d211af77c79ad587e0
// PR c++/47067 // { dg-do compile { target c++11 } } struct X { virtual void x(); virtual ~X(); }; struct Y { virtual void y(); virtual ~Y(); }; struct Z: X, Y {} z;
google
android
defaulted11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted11.C
220
utf_8
c5cfd7dcc71474b03e84af97fcd2efb6
// Core issue 901 // { dg-do compile { target c++11 } } struct A { A(); ~A(); void operator delete (void *) = delete; void operator delete[] (void *) = delete; }; int main() { A* ap = new A; ap = new A[2]; }
google
android
sfinae10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae10.C
475
utf_8
d8f81dbe99fc84ab7913076ea0a929ca
// PR c++/48452 // { dg-do compile { target c++11 } } namespace std { template <class T> T&& declval(); } template<class T, class... Args> decltype(T(std::declval<Args>()...), char()) f(int); template<class, class...> char (&f(...))[2]; struct A { virtual ~A() = 0; }; struct B {}; static_assert(sizeof(f<A, int, i...
google
android
enum20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum20.C
115
utf_8
1bb294fb870e3913a5e6884e7c73ebce
// PR c++/47635 // { dg-do compile { target c++11 } } enum A { }; void A::f() { } // { dg-error "not a class" }
google
android
nsdmi2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi2.C
251
utf_8
6441ebb320eb7cce0916b770b17635d3
// { dg-do compile { target c++11 } } 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
android
constexpr-incomplete1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete1.C
135
utf_8
67753b063cb8c6732629cc024f42fb77
// { dg-do compile { target c++11 } } struct A { static constexpr A a = 1; // { dg-error "incomplete" } constexpr A(int i) { } };
google
android
variadic-ex7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-ex7.C
600
utf_8
5bde3756df2a90d769e92937cba566e9
// { dg-do compile { target c++11 } } template<typename...> struct Tuple { }; template<typename... Types> char& g(Tuple<Types...>); // #1 template<typename T1, typename... Types> short& g(Tuple<T1, Types...>); // #2 template<typename T1, typename... Types> int& g(Tuple<T1, Types&...>); // #3 void...
google
android
pr33955
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr33955.C
777
utf_8
408ef1f980b7138348a97aa5b521747b
// { dg-do compile { target c++11 } } template<typename T> struct uncvref { typedef T type; }; template<typename... Args> struct args { static const int size = sizeof...(Args); }; template<typename G, typename E, typename S, typename V, long GN = G::size, long EN = E::size> struct apply_args; template<typename.....
google
android
constexpr-ref2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ref2.C
384
utf_8
d1d1aecd66ba1c7f2b50e13b37172d43
// Negative reference variable tests. // { dg-do compile { target c++11 } } 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; // ...
google
android
variadic-new2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C
251
utf_8
5ad1db01bdd9d87f2a8276b08cff8db7
// { dg-do run { target c++11 } } // PR c++/32597 #include <assert.h> #include <new> template< class... Args > void f( Args... args ) { { int x = 17; (void)x; } { int y(args...); assert(y == 0); } } int main() { f(); }
google
android
variadic-mem_fn
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C
1,026
utf_8
6c67e276177a53a05508b5e974504d12
// { dg-do run { target c++11 } } // A basic implementation of TR1's mem_fn using variadic teplates #include <cassert> template<typename R, typename Class, typename... Args> class Mem_fn { public: explicit Mem_fn(R (Class::*pmf)(Args...)) : pmf(pmf) { } R operator()(Class& object, Args... args) { return (obj...
google
android
enum16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum16.C
156
utf_8
e96829e4dc7341548f88f5e5e5c472f2
// PR c++/48935 // { dg-do compile { target c++11 } } enum class ENUM { a }; ENUM::Type func() { return ENUM::a; } // { dg-error "does not name a type" }
google
android
gen-attrs-47
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-47.C
446
utf_8
8cebe1c86890d80770a5d35af3f47211
// { dg-do compile { target c++11 } } // Example taken from dcl.attr.grammar: int p[10]; void f() { int x = 42, y[5]; /* Here, the '[[' should have introduced an attribute, on a lambda invocation an array subscripting expression. */ int(p[[x] { return x; }()]); // { dg-error "expected|consecutive" ...
google
android
pr31431
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31431.C
272
utf_8
3119094b6e17edcd9db5cd3d996ec1ca
// { dg-do compile { target c++11 } } template<typename..., typename> void foo(); // { dg-message "note" } void bar() { foo<int>(); // { dg-error "no matching function" } // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 } }
google
android
enum26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum26.C
239
utf_8
a2836b56e76f93a2b20d418618e3e12e
// PR c++/54216 // { dg-do compile { target c++11 } } // { dg-options "-pedantic" } enum {}; // { dg-warning "empty anonymous" } enum class {}; // { dg-error "anonymous" } enum class { x }; // { dg-error "anonymous" }
google
android
constexpr-ctor13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor13.C
221
utf_8
28a02520a5e291f2238f304437c3a5a8
// PR c++/55753 // { dg-do compile { target c++11 } } struct A { double r,i; constexpr A(double r = 0.0, double i = 0.0): r(r), i(i) {} }; template <typename Tp> struct B { B() { A((true ? 1.0 : A())); } };
google
android
alias-decl-23
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-23.C
308
utf_8
309011cca7386ec740ec766111385245
// PR c++/52233 // { dg-do compile { target c++11 } } template <typename t> struct foo { template <template <typename...> class... xs> using type = int; }; template <typename t, template <typename...> class... xs> struct bar { using type = typename foo<t>::template type<xs...>; }; bar<int, foo> x;
google
android
sfinae24
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae24.C
493
utf_8
3f877c00bb58d53e5689770c03efc4e7
// PR c++/49058 // This error is not subject to SFINAE because it doesn't happen in the // deduction context. // { dg-do compile { target c++11 } } // { dg-prune-output "note" } template<typename T> T val(); struct F1 { void operator()(); }; template<typename F> struct Bind { template<typename R = decl...
google
android
initlist57
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist57.C
196
utf_8
15b2c184e7e5156773bfef4a801e4ecc
// PR c++/50054 // { dg-do compile { target c++11 } } void g( const int& (a)[1] ) {} // { dg-error "array of references" } int main () { g( { 1, 2 } ); // { dg-error "initializer list" } }
google
android
initlist17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist17.C
159
utf_8
a2de6d6fef707d6426afbc2fa06fc026
// { dg-do compile { target c++11 } } void f(int i); int main() { f({42.0}); // { dg-error "narrowing" } return {1.0}; // { dg-error "narrowing" } }
google
android
nullptr15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr15.C
880
utf_8
0444bf2cdbf5553fb71f901199882267
// { dg-do compile { target c++11 } } // 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> T* g( T* t )...