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
defaulted35
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted35.C
128
utf_8
29df83a5c7676bf6c4a15ad339771ce7
// PR c++/53096 // { dg-do compile { target c++11 } } struct foo { foo(foo&) = default; foo& operator=(foo&) = default; };
google
android
variadic-explicit2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-explicit2.C
254
utf_8
0da7e7dea9fa31e0ecb2cc0bfd7f14de
// PR c++/56774 // { dg-require-effective-target c++11 } template <class ... Args> struct mytype {}; template <class T, class ... Args> void something( mytype<T, Args...> ) { } int main() { something<int, char, bool>( mytype<int, char, bool>() ); }
google
android
vt-34219-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34219-2.C
466
utf_8
ffedf1e64b2d3400b223433982b63f96
// { dg-do compile { target c++11 } } template<template<typename... T> class Comp, typename... T> void f( T... Value) { static_assert( Comp<T>::value > 0, "" ); // { dg-error "parameter packs|T" } } template<template<typename... T> class Comp, typename... T> void g( T... Value) { static_assert( Comp<T...>::value >...
google
android
alias-decl-32
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-32.C
560
utf_8
b5b5655baa65fca823be8f56b2a84f4d
// PR c++/56611 // { dg-do compile { target c++11 } } template<class T> struct remove_reference { typedef T type; }; template<class T> struct remove_reference<T&> { typedef T type; }; template<class T> T declval() { return T(); } int f(int, int){return 0;} struct Func{}; template<class... Args> using result2 = d...
google
android
variadic-crash2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C
305
utf_8
487cbd86a6922cf1b1ed0e770dfe74ee
// Origin: PR c++/39637 // { dg-do compile { target c++11 } } template<class... Types> void f(Types...) { enum {e = sizeof(Types)}; // { dg-error "parameter packs not expanded with '...'" } enum {e1 = sizeof...(Types)}; } int main() { f(0); }
google
android
variadic113
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic113.C
400
utf_8
9e521030f6848afc11055264f33c4983
// PR c++/49251 // { dg-do compile { target c++11 } } // { dg-options "-Wunused-parameter" } struct A {}; template <int> int f(A); template< int... Indices > struct indices {}; template< class... Args > void sink( Args&&... ) {} template< class T, int... Indices > void unpack_test( T && t, indices<Indices...> ) { ...
google
android
sfinae31
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae31.C
205
utf_8
50313f4f27fe7570cc0cd8a78fa9568a
// PR c++/51973 // { dg-do compile { target c++11 } } template <class T> void f(T t) { } template <class T> decltype(f<T>(0)) g(); template <class T> decltype(f<T*>(0)) g(); int main() { g<void>(); }
google
android
decltype-incomplete1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype-incomplete1.C
135
utf_8
f1c16eae211724928eb3908ca78a9906
// PR c++/59270 // { dg-do compile { target c++11 } } struct A { struct B b; // { dg-error "incomplete type" } }; decltype(A()) a;
google
android
decltype53
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype53.C
140
utf_8
18ed71440e53d896399bdba36dc42a08
// PR c++/57092 // { dg-do compile { target c++11 } } template <void (*F)(int)> class B { decltype(F) v; }; void foo(int) {} B<foo> o;
google
android
defaulted33
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted33.C
437
utf_8
67097a3ced85b4b8ea34ea837cf7b60f
// PR c++/50973 // { dg-do compile { target c++11 } } class HD { public: virtual ~HD() {}; }; class InputHD : public virtual HD { }; class OutputHD : public virtual HD { }; class IOHD : public InputHD, public OutputHD { }; template <typename T, unsigned int N> class ArrayNHD : public IOHD { public: ~ArrayNHD()...
google
android
nullptr05
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr05.C
244
utf_8
a73ee885f74ff59b41948dc0192b6b15
// { dg-do compile { target c++11 } } // Test assignment to method pointer class F { }; typedef void (F::*pmf)(); const pmf pmf1 = nullptr; const pmf pmf2 = __null; const pmf pmf3 = 0; decltype(nullptr) mynull = 0; const pmf pmf4 = mynull;
google
android
rv10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv10.C
157
utf_8
ce88e86fef9026207a379023cb8c2d11
// { dg-do compile { target c++11 } } struct A { A() = default; A(const A&) = delete; }; A&& f(); void h(A&&); void g() { A&& arr = f(); h(f()); }
google
android
rv-cast3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C
363
utf_8
2f59293907015075e8362ece252a2234
// PR c++/51406 // { dg-do run { target c++11 } } extern "C" int printf(const char *,...); extern "C" void abort(); struct A { int a; A() : a(1) {} }; struct B { int b; B() : b(2) {} }; struct X : A, B {}; int main() { X x; int a=static_cast<A&&>(x).a; int b=static_cast<B&&>(x).b; // printf ("%d %d\n...
google
android
pr34057
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr34057.C
176
utf_8
d2b8cb652ab68b15ccd485a4246d7d02
// PR c++/34057 // { dg-do compile { target c++11 } } template <typename... T> struct A { typedef T X __attribute__ ((vector_size (8))); // { dg-error "not expanded|T" } };
google
android
nsdmi-template3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template3.C
150
utf_8
a4838f227c782d1dc8cc894a19deb0d1
// PR c++/58760 // { dg-do compile { target c++11 } } enum en { a,b,c }; struct B { template<en N> struct A { const int X = N; }; };
google
android
noexcept17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept17.C
1,128
utf_8
4cd6354a621fc0de10ad07d6e1037744
// PR c++/50043 // { dg-do compile { target c++11 } } struct True1 {}; struct True2 { ~True2(); }; struct True3 { ~True3(){ throw 0; } }; struct False { ~False() noexcept(false); }; template <typename Base> struct A : Base { }; template <typename Member> struct B { Member mem; }; template <typename Base, typena...
google
android
variadic-explicit1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-explicit1.C
234
utf_8
b7cf6bf476e96d2d1f1916ba806c31c0
// { dg-do compile { target c++11 } } template<class T, class U> struct A { }; template<class... T, class ... U> void f( A<T,U>... p); void g() { f<int>( A<int,unsigned>(), A<short,unsigned short>() ); }
google
android
implicit10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit10.C
288
utf_8
0ec3816b51b6f7dc7ac0ca065da5908e
// PR c++/46103 // { dg-do compile { target c++11 } } struct MoveOnly { MoveOnly(const MoveOnly&) = delete; MoveOnly(MoveOnly&&) { } MoveOnly() = default; }; struct A { MoveOnly mo[1]; A() = default; A(A&&) = default; }; int main() { A a; A aa = static_cast<A&&>(a); }
google
android
pr58510
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58510.C
146
utf_8
fde4df725e337b433baf1bd5c4490563
// PR c++/58510 // { dg-do compile { target c++11 } } void foo() { union { // { dg-error "multiple" } int i = 0; char c = 0; }; }
google
android
noexcept10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept10.C
788
utf_8
41709bd79f8c59f70e3a34cf743752de
// PR c++/49082 // { dg-do compile { target c++11 } } namespace std { template <class T> T&& declval() noexcept; } struct Base { Base(const Base&) noexcept(false); Base(Base&&) noexcept(false); ~Base() noexcept(false); }; struct Derived : Base { // Derived(const Derived&) = default; // Derived(Derived&&) = ...
google
android
auto41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto41.C
178
utf_8
b623d8315eec1dcad57d4b98eb3f1bef
// PR c++/58550 // { dg-do compile { target c++11 } } auto foo(); // { dg-error "auto" "" { target { ! c++1y } } } auto fp = foo; // { dg-error "auto" "" { target c++1y } }
google
android
inh-ctor13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C
270
utf_8
8103537185da64927ab92eda02cb449f
// { dg-do compile { target c++11 } } struct A { int i; template <class T> A(T t); }; struct C { C() = delete; // { dg-message "declared here" } }; struct B: A, C { using A::A; // { dg-error "C::C" } }; int main() { B b(24); // { dg-error "B::B" } }
google
android
initlist33
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist33.C
181
utf_8
6ba09d9c9e0fd292dde60c4e745e9293
// PR c++/44045 // { dg-do compile { target c++11 } } struct base { virtual ~base() { } }; int main() { base ptr_array[1]; ptr_array = { base() }; // { dg-error "assign" } }
google
android
constexpr-fnptr
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C
209
utf_8
aa1967267d5d21b22c4d54dfa617fcfc
// { dg-do compile { target c++11 } } constexpr bool is_negative(int x) { return x < 0; } constexpr bool check(int x, bool (*p)(int)) { return p(x); } // #1 static_assert(check(-2, is_negative), "Error");
google
android
sfinae1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae1.C
215
utf_8
c35ea6ad33826ef666775473d62deace
// { dg-do compile { target c++11 } } template< typename T_VECTOR > void f(const T_VECTOR &a, decltype(a[0]) t = 0); template< typename T > void f(const T &a, decltype(a*1) t = 0); int main() { int c; }
google
android
explicit7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit7.C
536
utf_8
ba14aa5d6a38127d55331f0cce7f0ac9
// [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-do compile { target c++11 } } // { dg-options "" } struct A { ...
google
android
extern_template-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/extern_template-3.C
153
utf_8
a90d02344ce471556a85a9970c53f219
// PR c++/37256 // { dg-options "-O" } template <typename T_> struct B { T_ f(); }; extern template class B<int>; void f() { B<int> t; t.f(); }
google
android
variadic-function
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-function.C
1,952
utf_8
aaa90c1c2261698f9319415498163db1
// { dg-do run { target c++11 } } // 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; virtual invoker_base...
google
android
vt-34051
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34051.C
184
utf_8
5467a83ac0976a235585b60da502cab7
// { dg-do compile { target c++11 } } struct A { operator int(); }; template <typename... T> struct B : A { using A::operator T; // { dg-error "parameter packs|T" } }; B<int> b;
google
android
constexpr-ctor8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor8.C
184
utf_8
ffacf7a72c70b9005717367b0d680d5f
// PR c++/46466 // { dg-do compile { target c++11 } } // { dg-options "-fno-elide-constructors" } struct S { bool b; }; constexpr S f() { return S{true}; } static_assert(f().b, "");
google
android
gen-attrs-52
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C
691
utf_8
333431ceea0cc9c035073efbc0ffd818
// { dg-do compile { target c++11 } } struct A {int i;} a [[gnu::aligned(16)]]; struct B {int i;} __attribute__((aligned(16))) b; int main () { A aa; B bb; static_assert (sizeof (a) == 4, "sizeof (a) should be 4"); static_assert (sizeof (b) == 16, "sizeof (b) should be 16"); static_assert (sizeof (aa) == 4, "s...
google
android
alias-decl-41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-41.C
525
utf_8
99499efe942d19fb669e10a40ff36723
// PR c++/60182 // { dg-require-effective-target c++11 } class B {}; template <typename> using __allocator_base = B; template <typename> class F : __allocator_base<int> {}; class C {}; template <typename, typename = F<int> > class G : C {}; template <typename> class D; class A { using Container = G<D<char>>; A(); ...
google
android
trailing4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing4.C
353
utf_8
2ad5fda8773a00bc10a1c9cad2acfea8
// PR c++/38597 // { dg-do compile { target c++11 } } template<class T, class U> auto f(T,U) -> decltype(T() + U()) { return T() + U(); } template<class T> void g(T){} // { dg-message "note" } int main() { g(f); } // { dg-error "no matching function" } // { dg-message "(candidate|deduce template parameter)" "candid...
google
android
gen-attrs-26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-26.C
326
utf_8
9e74151533939eec71479d0f43cbf925
// PR c++/28659 // The attribute was causing us to get confused in merge_types when // combining the template type with an uninstantiated version. // { dg-do compile { target c++11 } } template<class T> struct [[gnu::aligned(1)]] A { A& operator=(const A &t); }; template<class T> A<T>& A<T>::operator=(const A<T> &t...
google
android
variadic48
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic48.C
178
utf_8
676fd44c5b2045f4192bfe20e5bb0a38
// { dg-do compile { target c++11 } } template<typename T, typename... Args> int& f(const T&, Args...); template<typename T> float& f(const T&); float& g() { return f(17); }
google
android
enum19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum19.C
250
utf_8
f05f6314bab056a03c548eb4c50f323a
// We shouldn't give an ABI warning about promotion in switch. // { dg-do compile { target c++11 } } // { dg-options "-fabi-version=5 -Wabi" } enum class Foo { X }; void test(Foo val) { switch(val) { case Foo::X: break; } };
google
android
pr34058
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr34058.C
152
utf_8
b5f4aef18b560b7280f82fd482d125c3
// PR c++/34058 // { dg-do compile { target c++11 } } template <typename...T> struct A { typedef T X; // { dg-error "not expanded|T" } }; A<int> a;
google
android
variadic13
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic13.C
724
utf_8
3b05da0d3571c6c7da63d32c47090038
// { dg-do compile { target c++11 } } template<typename... Args> struct tuple1 { }; template<typename... Args> struct tuple2 { }; template<typename T, typename U> struct same_tuple_args { static const bool value = false; }; template<typename... Args> struct same_tuple_args<tuple1<Args...>, tuple2<Args...> > { sta...
google
android
constexpr-nonlit2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit2.C
275
utf_8
be8f4e5fcb1c587cafceedac941319f3
// { dg-do compile { target c++11 } } struct A { ~A(); }; template<class T> struct W { T t; template<class U> constexpr W(U&& u) : t(u) {} }; template <class T> constexpr W<T> make_w(T& w) { return W<T>(w); } A a; constexpr auto w = make_w(a); // { dg-error "" }
google
android
pr32126
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32126.C
240
utf_8
8a715adc2a6db859856409d91c405be0
// { dg-do compile { target c++11 } } template<typename...> struct A; template<typename...T> struct A<T> // { dg-error "not expanded|T|" } { static int i; }; A<char> a; // { dg-error "incomplete" } A<int> b; // { dg-error "incomplete" }
google
android
constexpr-static7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static7.C
249
utf_8
87292f68351963d96827c53492d263bd
// PR c++/48945 // { dg-do compile { target c++11 } } struct A { static constexpr bool is(); static constexpr bool is_not(); }; constexpr bool A::is() { return true; } constexpr bool A::is_not() const { return true; } // { dg-error "static" }
google
android
initlist30
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist30.C
211
utf_8
a558a49726098b2e30f9484a7f3b4bb8
// Testcase for variadic init list deduction. // { dg-do compile { target c++11 } } #include <initializer_list> template <class... Ts> void f (std::initializer_list<Ts>... ls); int main() { f({1},{2.0}); }
google
android
decltype47
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype47.C
246
utf_8
c2cf8458d012a9b5f9ca051e825817dd
// PR c++/55564 // { dg-do compile { target c++11 } } template <typename T, decltype(sizeof(T)) N> auto array_size(T(&)[N]) -> decltype(N) { return N; } int main() { int simple[4] = {}; int result = array_size(simple); return result; }
google
android
forw_enum6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum6.C
1,914
utf_8
ca02747103f56bffffb3123b031b0498
// { dg-do compile { target c++11 } } enum class E1 : int; // { dg-error "previous definition" } enum E1 : int; // { dg-error "scoped/unscoped mismatch" } enum E2 : int; // { dg-error "previous definition" } enum class E2 : int; // { dg-error "scoped/unscoped mismatch" } enum struct E3 : int; enum class E3 : int; ...
google
android
static_assert9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert9.C
179
utf_8
96a83ae08e1b9f6eabf194d6d9b2bb73
// PR c++/58837 // { dg-require-effective-target c++11 } void f(); static_assert(f, ""); struct A {}; static_assert(A::~A, ""); // { dg-error "non-static member function" }
google
android
constexpr-ctor7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C
293
utf_8
4c9e9cea1c33d8fc917f7ae05a1e2d71
// PR c++/47199 // { dg-do compile { target c++11 } } // { dg-options "-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
android
range-for4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for4.C
2,030
utf_8
cf3faabae812bd6f8ade13f3c1d36871
// Test for range-based for loop with templates // { dg-do run { target c++11 } } /* Preliminary declarations */ namespace pre { struct iterator { int x; iterator (int v) :x(v) {} iterator &operator ++() { ++x; return *this; } int operator *() { return x; } bool operator != (const iterator &o) {...
google
android
variadic-bind
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C
12,155
utf_8
8eb6bba0c4ef3e1b77151f91ce5ddeb3
// { dg-do run { target c++11 } } // A basic implementation of TR1's bind using variadic teplates #include <cassert> // Trivial reference_wrapper template<typename T> struct reference_wrapper { reference_wrapper(T& x) : ptr(&x) { } operator T&() const { return *ptr; } T& get() const { return *ptr; } T* ptr; ...
google
android
sfinae18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae18.C
269
utf_8
3a25274828c6da4b448d4af66043eea1
// PR c++/48530 // { dg-do compile { target c++11 } } template<class T, class = decltype(T()) > char f(int); template<class> char (&f(...))[2]; struct DelDtor { DelDtor() = default; ~DelDtor() = delete; }; static_assert(sizeof(f<DelDtor>(0)) != 1, "Error");
google
android
alias-decl-debug-0
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
319
utf_8
af3a174668c74fe4e8cda5dbe9e149b1
// Origin: PR c++/51032 // { dg-do compile { target c++11 } } // { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* nios2-*-* } { "*" } { "" } } // { dg-options "-gstabs+" } template <class C> struct A { template<class U> using B = U*; int a; }; A<int> a;
google
android
pr57101
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr57101.C
4,606
utf_8
147b75ffdfd9b9782c989d7ba9b08991
// { dg-do compile { target c++11 } } // { dg-options "-fcompare-debug" } typedef long unsigned size_t; namespace { template < typename _Tp, _Tp __v > struct integral_constant { static const _Tp value = __v; }; typedef integral_constant < bool, false > false_type; template < typename > struct remove_cv; ...
google
android
constexpr-pos1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-pos1.C
1,244
utf_8
71bf544adf239f884a43b6d72e78604e
// Positive examples from N3092 (FCD) // { dg-do compile { target c++11 } } #define SA(X) static_assert(X, #X) constexpr int bufsz = 1024; // OK: definition SA (bufsz == 1024); constexpr int square(int x); // OK: declaration struct pixel { int x; int y; // OK: declaration constexpr pixel(int); }; constexpr ...
google
android
alias-decl-14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-14.C
466
utf_8
4c605627a3a9df4c9a6771e8b27bf8d5
// Origin: PR c++/51145 // { dg-do compile { target c++11 } } struct A {}; template<class> using X = A; struct X<int>* px; // { dg-error "using\[^\n\r\]*alias\[^\n\r\]*specialization\[^\n\r\]*X<int>\[^\n\r\]*after\[^\n\r\]*struct|invalid type in declaration before\[^\n\r\]*;" } template<int> using Y = A; struct Y<...
google
android
pr58871
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58871.C
229
utf_8
0015dc46694c26453738cf6d0f1ff9f1
// PR c++/59111 // { dg-do compile { target c++11 } } template<typename T> struct A : virtual T // { dg-error "base type" } { A(); A(const A&); }; template<typename T> A<T>::A(const A<T>&) = default; A<int> a = A<int>();
google
android
union5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/union5.C
316
utf_8
d628aec947fb9383000669568fb54fe3
// PR c++/49803 // { dg-do compile { target c++11 } } // { dg-options "" } 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
android
constexpr-array4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array4.C
283
utf_8
6451aa5bb5fa736dda3ebad1dc2e8336
// PR c++/49924 // { dg-do compile { target c++11 } } struct A { constexpr A() { } }; struct B { A array[1]; //non-static member array of a literal type w constexpr ctor constexpr B() : array{} { } // here is the problem }; int main() { constexpr B b{}; // won't compile }
google
android
constexpr-overflow2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow2.C
167
utf_8
49a55dd7856ddc68e96fae9181b210ee
// PR c++/47504 // { dg-do compile { target c++11 } } char constexpr sub(char arg) { return char(arg - char(1)); } int main() { static char constexpr m = sub(-1); }
google
android
decltype2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype2.C
1,257
utf_8
afae87d16eb211bb5a4f1eb745c2d853
// { 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; }; #define CHECK_DECLTYPE(DECLTYPE,RESULT) \ static_assert(is_same< DECLTYPE , RESULT >::value, #RESULT) struct ...
google
android
auto17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto17.C
154
utf_8
e704b624ce374dc37104f7479db8fe94
// PR c++/42567 // { dg-do compile { target c++11 } } template<typename B> struct A { template<typename C> void fn(C c) { auto& key = *c; } };
google
android
variadic115
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic115.C
293
utf_8
b872155b4ce3f1a8adbd7af4bcf9666d
// PR c++/49593 // { dg-do compile { target c++11 } } template<typename... T> void f(T...) { } template<typename... Args> static void g(Args&&... args) { f( static_cast<Args>(args)... ); f( (Args)args... ); f( Args(args)... ); f( Args{args}... ); } int main() { g(1, '2', 3.0); }
google
android
constexpr-ctor9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor9.C
193
utf_8
6b0cc0cbb9bdac5fe98a7d492e9b3c17
// PR c++/47774 // { dg-do compile { target c++11 } } struct A { A() {} }; template <typename T> struct array { constexpr array() : mem() {} T mem[7]; }; int main() { array<A> ar; }
google
android
variadic68
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic68.C
389
utf_8
cbf0606e23f91aeddb437ce331a056d4
// { dg-do run { target c++11 } } 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() { int test_ar...
google
android
gen-attrs-16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-16.C
261
utf_8
aa97e3d1f293c6ba70681149783f1e75
// { dg-do compile { target c++11 } } // Origin: <rguenth at tat dot physik dot uni-tuebingen dot de> // PR c++/10479: use of non dependent expressions in attributes in templates template <int i> struct foo2 { float bar [[gnu::aligned(alignof(double))]]; };
google
android
constexpr-base2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base2.C
194
utf_8
460ea40517988382f23290096b62251e
// PR c++/46293 // { dg-do compile { target c++11 } } struct A { }; struct C { int i; constexpr C(int i): i(i) {} }; struct B: A, C { constexpr B(): A(), C(42) { } }; constexpr B b{};
google
android
enum4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum4.C
121
utf_8
4314a939d182c8ee315404a2d9cf3ec3
// PR c++/40633 // { dg-do compile { target c++11 } } template< typename T > struct wrap { enum class E { val }; };
google
android
gen-attrs-57
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-57.C
158
utf_8
0b245fbb9cc3ac28a40dc6e149c159ec
// PR c++/59096 // { dg-do compile { target c++11 } } template<typename T> struct A { typedef T B [[mode]]; // { dg-warning "ignored" } }; A<int>::B b;
google
android
udlit-systemheader
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-systemheader.C
70
utf_8
ff425f0355a54d312eec6e5a8f284e41
// { dg-do compile { target c++11 } } #include "udlit_system_header"
google
android
udlit-linkage-neg
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-linkage-neg.C
127
utf_8
6d05f0ca69e3af1248dac02fe71e5c37
// { dg-do compile { target c++11 } } extern "C"_badlinkage { // { dg-error "expected unqualified-id before" } int foo(); }
google
android
implicit1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit1.C
575
utf_8
bb928b3447417cab31c9315cb1829c82
// Test for implicitly deleted destructors. // { dg-do compile { target c++11 } } // { dg-prune-output "default definition would be ill-formed" } // { dg-prune-output "within this context" } class C { void operator delete (void *); // { dg-error "private" } public: virtual ~C(); // { dg-error "overriding" } }; ...
google
android
constexpr-ice10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice10.C
150
utf_8
d2952f6531f8571d5810a7da973458de
// PR c++/60225 // { dg-do compile { target c++11 } } struct A { constexpr A() {} static constexpr A a[2] = {}; // { dg-error "incomplete" } };
google
android
enum9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum9.C
98
utf_8
93c84144d7315544bcdba227b8f91255
// { dg-do compile { target c++11 } } enum class E { }; E f(); bool b2 = static_cast<bool>(f());
google
android
gen-attrs-43
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-43.C
167
utf_8
862c0de8eebeba661b318aa5db148611
// { dg-do compile { target c++11 } } template <class T> struct A { }; template [[gnu::packed]] struct A<int>; // { dg-warning "ignored in explicit instantiation" }
google
android
inline-ns2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C
682
utf_8
3e2f011d130eb1b8b8c5b45e6f650dfb
// { dg-do compile { target c++11 } } namespace Q { inline namespace V1 { extern int i; // { dg-message "" } extern int j; // { dg-message "" } void f(); // { dg-message "" } void g(); // { dg-message "" } } inline namespace V2 { extern int j; // { dg-message "" } void g(); // { ...
google
android
decltype57
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype57.C
118
utf_8
dd6c683be4f9a9a39eaad1f127661efd
// PR c++/58633 // { dg-do compile { target c++11 } } void foo(int i) { typedef int I; decltype(i.I::~I())* p; }
google
android
variadic31
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic31.C
187
utf_8
f70ba7809b0c920286a2931562960246
// { dg-options "-g" } // { dg-do compile { target c++11 } } template<typename... T> void eat(T...) { } void f() { eat(); eat(1); eat(1, 2); eat(17, 3.14159, "Hello, World!"); }
google
android
constexpr-53094-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-53094-1.C
168
utf_8
ecc3b96f5ee5f153f34313ef65b34ef6
// { dg-do compile { target c++11 } } typedef float __attribute__ ((vector_size (4 * sizeof (float)))) V4; constexpr V4 v = { 1, 1, 1, 0 }; constexpr V4 r = v[0] + v;
google
android
variadic18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic18.C
1,016
utf_8
e7b3b347202f88043f677ea7ce8e4e18
// { dg-do compile { target c++11 } } template<typename...> class tuple { }; template<typename T, template<typename T> class... Metafunctions> struct apply_all { typedef tuple<typename Metafunctions<T>::type...> type; }; template<typename T, typename U> struct is_same { static const bool value = false; }; templa...
google
android
constexpr-object2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C
467
utf_8
914d26de010d266f5cd174d5077c23de
// { dg-do compile { target c++11 } } 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)]; // OK -- no...
google
android
rv-func2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-func2.C
140
utf_8
94c30aa2c23a35b6b477f7b1b868841b
// PR c++/49458 // { dg-do compile { target c++11 } } typedef void ftype(); struct A { operator ftype&(void); }; ftype &&frvref = A();
google
android
linkage2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/linkage2.C
1,031
utf_8
597f79827ab167c158bc3b52aa51e573
// 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-do...
google
android
variadic-value1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-value1.C
336
utf_8
edf9e45ed1a17b392fa9f15f8a7cce75
// PR c++/52796 // { dg-do run { target c++11 } } inline void *operator new(__SIZE_TYPE__ s, void *p) { return p; } struct A { int i; template<class... Ts> A(Ts&&... ts): i(ts...) { } }; static union { unsigned char c[sizeof(A)]; int i; }; int main() { i = 0xdeadbeef; if (i != 0) __builtin_abort(); }
google
android
constexpr-union4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C
314
utf_8
5a7503f8381d02697b9d955f1dd4e944
// PR c++/54922 // { dg-do compile { target c++11 } } struct nullable_int { bool init_; union { unsigned char for_value_init; int value_; }; constexpr nullable_int() : init_(false), for_value_init() {} }; #define SA(X) static_assert(X,#X) constexpr nullable_int n; SA((n.for_value_init == 0));
google
android
inh-ctor14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor14.C
101
utf_8
d63030a495d3f739100adf7533569800
// PR c++/55261 // { dg-do compile { target c++11 } } struct A { }; struct B : A { using A::A; };
google
android
implicit6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit6.C
287
utf_8
730f08a581341e539b3720c9e2d11c18
// Circular implicit declarations were causing errors // { dg-do compile { target c++11 } } struct Ray; struct Vector { virtual void f(); // make non-trivially-copyable Vector(const Ray &) ; }; struct array { Vector v; }; struct Ray { array a; }; extern Ray r1; Ray r2=r1;
google
android
gen-attrs-17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-17.C
495
utf_8
901e9aa464bf529bf9c59b30e0dcad05
// { dg-do compile { target c++11 } } // Origin: Benjamin Kosnik <bkoz at gcc dot gnu dot org> // PR c++/17743: Attributes applied to typedefs. struct A { typedef char layout_type[sizeof(double)] [[gnu::aligned(alignof(double))]]; layout_type data; }; struct B { typedef char layout_type[sizeof(double)]; lay...
google
android
defaulted25
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted25.C
160
utf_8
6f73d994ec6b567f3086494c830b9ddc
// PR c++/48930 // { dg-do compile { target c++11 } } // { dg-prune-output "note" } struct A { A(const A&) = default; }; A a; // { dg-error "no match" }
google
android
constexpr-is_literal
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C
677
utf_8
37f592a6d675c9e237fe68fa9fdf71ca
// { dg-do compile { target c++11 } } #include <type_traits> #define IS_LIT(T) (std::is_literal_type<T>::value) #define SA(X) static_assert (X, #X) #define YES(T) SA(IS_LIT(T)) #define NO(T) SA(!IS_LIT(T)) enum E1 { }; enum class E2 { }; struct Literal {}; struct NotLiteral { ~NotLiteral(); }; YES(int); YES(int[...
google
android
udlit-tmpl-arg
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-tmpl-arg.C
82
utf_8
ebbb3f1b85b16c5be2a25964d8017ab6
// { dg-do compile { target c++11 } } template<char...> int operator"" _abc();
google
android
explicit6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit6.C
265
utf_8
ba3e0584cbce47fcf6afb488bb1a336d
// PR c++/47080 // { dg-options "" } // { dg-do compile { target c++11 } } struct A { explicit operator int(); // { dg-message "qualification conversion" } }; int main() { bool b((A())); // { dg-error "invalid user-defined" } !A(); // { dg-error "" } }
google
android
defaulted44
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted44.C
424
utf_8
2ee0772db61578cee819eb3f0c529df5
// PR c++/57319 // { dg-require-effective-target c++11 } namespace N1 { struct A { }; struct B: virtual A { }; struct C: virtual B { }; struct D: C { void operator= (D &); }; } namespace N2 { struct A { A& operator=(A&&); }; struct B: virtual A { }; // { dg-warning "move assignment" } struct C:...
google
android
rv-cond1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-cond1.C
211
utf_8
ccba3040ed86b5ffae7d72b18f556d1c
// PR c++/58714 // { dg-do compile { target c++11 } } struct X { X& operator=(const X&) = delete; X& operator=(X&& ) = default; }; void f(bool t) { X a, b; *(t ? &a : &b) = X(); (t ? a : b) = X(); }
google
android
variadic-rref
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-rref.C
550
utf_8
0e1a5d3d60669df0ab8d526a879627f5
// { dg-do compile { target c++11 } } // 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_...
google
android
constexpr-typeid
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C
371
utf_8
c868309eb133e9093601e0e6e0842fa8
// { dg-do compile { target c++11 } } #include <typeinfo> struct A { virtual void f(); }; extern constexpr const std::type_info* p1 = &typeid(int); extern constexpr const std::type_info* p2 = &typeid(A); // typeid-expression whose operand is of a polymorphic class type extern constexpr const std::type_info* p3 = &ty...
google
android
initlist66
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist66.C
583
utf_8
a68c6107558f25b70fd1a97ccd9b3825
// PR c++/52510 // { dg-do compile { target c++11 } } typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; typedef uint64_t upad64_t; typedef struct _pthread_cond { struct { uint8_t __pthread_cond_flag[4]; uint16_t __pthread_cond_type...
google
android
variadic151
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic151.C
166
utf_8
3581300f9c431d4c679bd228cd9faf45
// PR c++/54440 // { dg-do compile { target c++11 } } template <class...T> struct A { template <T... t, class U> struct B { }; }; A<int,char>::B<42,'a',float> b;
google
android
sfinae15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae15.C
199
utf_8
70024a74cac9c3e92822de9ddf31bc67
// PR c++/48531 // { dg-do compile { target c++11 } } template<class T, class = decltype(T()) > char f(int); template<class> char (&f(...))[2]; static_assert(sizeof(f<int[]>(0)) != 1, "Error");
google
android
sfinae8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae8.C
325
utf_8
547894832b1452d5f513938e0cb8a166
// PR c++/48449 // { dg-do compile { target c++11 } } template<class T, class = decltype(T())> char f(int); template<class> char (&f(...))[2]; struct A { virtual ~A() = 0; }; static_assert(sizeof(f<int&>(0)) != 1, "Error"); static_assert(sizeof(f<void()>(0)) != 1, "Error"); static_assert(sizeof(f<A>(0)) != 1, "Erro...
google
android
nullptr01
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr01.C
200
utf_8
91cd11ac5ee209597b98320eabafd845
// { dg-do compile { target c++11 } } // Test assignment to pointer char* const cp1 = nullptr; char* const cp2 = __null; char* const cp3 = 0; decltype(nullptr) mynull = 0; char* const cp4 = mynull;
google
android
udlit-raw-op
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-raw-op.C
413
utf_8
207aa7deaf0ee81a956f5599c30abce2
// { dg-do run { target c++11 } } #include <cassert> #include <cstring> int operator"" _raw_umber(const char * str) { return strlen(str); } int main() { int i = 0123012301230123012301230123012301230123012301230123012301230123_raw_umber; assert( i == 64 ); int j = 90123456789012345678901234567890123456789012...
google
android
constexpr-switch2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-switch2.C
296
utf_8
6c91ba87eea37f77b9dbfcbf6c0b805b
// Test for constexpr conversion in case context // { dg-do compile { target c++11 } } enum class E { e1, e2 }; struct A { E e; constexpr operator E() { return e; } constexpr A(E e): e(e) { } }; E e; int main() { switch (e) { case A(E::e1): case A(E::e2): ; } }