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
sfinae41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae41.C
185
utf_8
90a3580cc1ad805e9c175338e56e381a
// PR c++/54542 // { dg-do compile { target c++11 } } template <class T> void f(decltype(new T(1, 2)) *) { T(1, 2); } template <class T> void f(...) {} int main() { f<int>(0); }
google
android
variadic69
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic69.C
679
utf_8
080fbb2e4a74f8bd15d05faa165b16f1
// { dg-do compile { target c++11 } } template<typename T> struct stored_value { explicit stored_value() : value() { } explicit stored_value(const T& value) : value(value) { } stored_value(int, const T& value) : value(value) { } T value; }; template<typename... Values> struct myclass : public stored_value<V...
google
android
variadic154
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic154.C
181
utf_8
081a4bedbab268a6ae607a361a5687db
// PR c++/60374 // { dg-do compile { target c++11 } } template<typename> struct A {}; template<typename...T> struct A<T::T...> {}; // { dg-error "typename|partial|T" } A<int> a;
google
android
decltype55
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype55.C
419
utf_8
f94e897a0b87b037c2e3f9e1357c1cab
// PR c++/53211 // { dg-do compile { target c++11 } } template<typename A, typename B> struct is_same { static const bool value = false; }; template<typename A> struct is_same<A, A> { static const bool value = true; }; template<typename... Args> void func(Args... args) { int arr[] = { args... }; static_asser...
google
android
constexpr-ctor
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor.C
128
utf_8
d0427dc74b88a57224dec4d9261a99f8
// { dg-do compile { target c++11 } } struct A { int i; constexpr A() { } // { dg-error "uninitialized member .A::i" } };
google
android
inh-ctor18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor18.C
263
utf_8
d3df2168b01c7df3891e31a076616e58
// PR c++/56358 // { dg-do compile { target c++11 } } struct foo { explicit foo(int) {} }; template<typename T> struct bar: T { using T::T; // Bad explicit bar(): T(0) {} void baz() { // Also bad using qux = T; } }; bar<foo> b, b2(42);
google
android
pr31437
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31437.C
292
utf_8
668250e3f86acca537b2f1640e6cd882
// { dg-do compile { target c++11 } } template <typename... T> struct A // { dg-message "candidates|A" } { A(T* p) { // { dg-error "parameter packs|T" } (A<T...>*)(p); } }; A<int> a(0); // { dg-error "no matching" } // { dg-message "candidate" "candidate note" { target *-*-* } 9 }
google
android
defaulted26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted26.C
173
utf_8
6c1b7b2d94aac6ba3656a0418fe2026c
// PR c++/49066 // { dg-do compile { target c++11 } } void foo() = delete; // { dg-message "declared here" } void foo(); int main() { foo(); } // { dg-error "deleted" }
google
android
constexpr-ice4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice4.C
158
utf_8
a2444cbecc90b8c642eeb0fb89f00654
// PR c++/51612 // { dg-do compile { target c++11 } } struct A {}; struct B : virtual A { constexpr B() { } // { dg-error "has virtual base classes" } };
google
android
ref-qual6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual6.C
216
utf_8
ba0b53c553f6ff24cf6f794b57c9bc32
// Binding an rvalue to && beats binding it to const& (13.3.3.2). // { dg-require-effective-target c++11 } struct A { int operator+(int) &&; }; void operator+ (const A&, int); int main() { return A() + 42; }
google
android
constexpr-array
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array.C
197
utf_8
38cd934a198d947354c7b7fbba1d2318
// { dg-do compile { target c++11 } } // { dg-final { scan-assembler-not "static_initialization" } } struct A { int i; constexpr A(): i(0) { } }; struct B { A a[4]; }; extern const B b{};
google
android
initlist-value
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-value.C
600
utf_8
742c772ced8eedc3c0511b94b8410082
// Test for value-initialization via {} // { dg-do run { target c++11 } } void * operator new (__SIZE_TYPE__, void *p) { return p; } void * operator new[] (__SIZE_TYPE__, void *p) { return p; } // Empty base so A isn't an aggregate struct B {}; struct A: B { int i; }; struct C: A { C(): A{} {} }; int f(A a) { r...
google
android
implicit4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit4.C
383
utf_8
25f074057f9be4abafc2e63b15388fe3
// Test that a base with only a move constructor causes the implicit copy // constructor to be deleted. // { dg-do compile { target c++11 } } struct A // { dg-message "declares a move" } { A(); A(A&&); }; struct B: A // { dg-error "use of deleted" } { }; int main() { B b1; B b2(b1); // { dg-error "d...
google
android
variadic131
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic131.C
210
utf_8
79ecddf7e7860cf9fd4194a0a3bdc4d5
// PR c++/38543 // { dg-do compile { target c++11 } } template< typename ... T > void foo( T ... args ); template<> void foo( ){} template<> void foo(int,double){} int main() { foo( 0, 0.0 ); return 55; }
google
android
alias-decl-33
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-33.C
246
utf_8
9aa33d8c610502fc32f4a0df31dd626a
// PR c++/51239 // { dg-require-effective-target c++11 } template<class... x> class list{}; template<class a, class... b> using tail=list<b...>; template <class...T> void f(tail<T...>); // { dg-error "alias" } int main() { f<int,int>({}); }
google
android
constexpr-sassert
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-sassert.C
214
utf_8
0243ed8d6dc6cc84334b7250ce7437cc
// Allow static_assert in constexpr constructors, too. // { dg-do compile { target c++11 } } template<typename T> struct A { int i; constexpr A(int i) : i(i) { static_assert(sizeof(T) == 1, ""); } };
google
android
variadic73
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic73.C
473
utf_8
d48de12d270e46e8e7b9a70f8e33ec94
// { dg-do run { target c++11 } } struct A {}; struct B {}; struct C {}; template<typename... Exceptions> void f(int idx) throw(Exceptions...) { if (idx == 0) throw A(); else if (idx == 1) throw B(); else if (idx == 2) throw C(); } extern "C" void abort(); int main() { try { f<A, B, C>(0); abort(); } ...
google
android
nsdmi-union2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-union2.C
213
utf_8
97244e2bdff262e5f89cc9d5717cbeee
// PR c++/52377 // { dg-require-effective-target c++11 } union A // { dg-error "multiple" } { int i = 4; int j = 2; }; A a; union B { int i,j; B(): i(1), j(2) {} // { dg-error "multiple" } }; B b;
google
android
udlit-raw-str
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-raw-str.C
574
utf_8
21d8f3abb7d65b16b03ff3144fcea486
// { dg-do compile { target c++11 } } #include <string> std::string operator"" _i18n(const char*, std::size_t); std::string vogon_poem = R"V0G0N( O freddled gruntbuggly thy micturations are to me As plured gabbleblochits on a lurgid bee. Groop, I implore thee my f...
google
android
variadic139
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic139.C
285
utf_8
0205bd13de315700649af27850846618
// Origin: PR c++/53609 // { dg-do compile { target c++11 } } template<class...I> struct List {}; template<int T> struct Z {static const int value = T;}; template<int...T> using LZ = List<Z<T>...>; template<class...U> struct F { using N = LZ<U::value...>; }; F<Z<1>, Z<2> >::N A;
google
android
initlist78
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist78.C
157
utf_8
0ea881619a668e35542e587d9eb84ead
// PR c++/58639 // { dg-require-effective-target c++11 } struct node { node &parent; }; struct vector { node n; }; vector v({}); // { dg-error "" }
google
android
constexpr-ex3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ex3.C
560
utf_8
b17c2ffac9fe7ca0a721dff59a843dc0
// { dg-do compile { target c++11 } } // { dg-options "-ftrack-macro-expansion=0" } #define SA(X) static_assert (X, #X) struct A { int i; constexpr A(int _i) { i = _i; } // { dg-error "empty body|uninitialized member" } }; template <class T> struct B { T t; constexpr B(T _t): t(_t) { } }; B<int> b(1); ...
google
android
overloadn
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/overloadn.C
12,643
utf_8
0f2bb9eb8737886ed5d48f3cd383ee43
// { dg-do link { target c++11 } } // { dg-options "" } // Generated by overload.py template<typename _Tp> inline _Tp&& movel(_Tp& __t) { return static_cast<_Tp&&>(__t); } struct S{}; S l; // lvalue (l) S const cl = l; // const lvalue (cl) S r() { return l; } ...
google
android
constexpr-diag1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
526
utf_8
a1e5b47dd367fc6dc2abc0b1dae26381
// Test that we explain why a template instantiation isn't constexpr // { dg-do compile { target c++11 } } template <class T> struct A { T t; constexpr int f() { return 42; } // { dg-error "enclosing class" } }; struct B { B(); operator int(); }; constexpr A<int> ai = { 42 }; constexpr int i = ai.f(); constexpr...
google
android
forw_enum3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum3.C
903
utf_8
1dbb72d7cb864fd82bbd03dc412332fe
// { dg-do compile { target c++11 } } 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; enum class E2 : i...
google
android
pr60249
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C
212
utf_8
0ec463c125bf90b0bc2b4ce4298afcc7
// PR c++/60249 // { dg-do compile { target c++11 } } decltype(""_) x; // { dg-error "unable to find string literal operator" } // { dg-error "invalid type in declaration before" "invalid" { target *-*-* } 4 }
google
android
gen-attrs-27
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-27.C
199
utf_8
af79bc7665b33968f22046002f6e30cf
//PR c++/29980 // { dg-do compile { target c++11 } } struct A { typedef int X; }; // { dg-message "previous declaration" } struct [[gnu::unused]] A::X; // { dg-error "typedef-name" }
google
android
variadic77
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic77.C
321
utf_8
d81d142f600f2ba73ae42c555c79601e
// PR c++/33496 // { dg-do compile { target c++11 } } 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 "" } } }; int bar () { return S<0, 1, 2>::foo<0, 1> (); }...
google
android
auto27
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto27.C
233
utf_8
bc376e5f73fb976671610bbcc40435bc
// PR c++/51186 auto main()->int // { dg-error "std=" "std" { target { ! c++11 } } } // { dg-error "auto" "auto" { target { ! c++11 } } 3 } // { dg-error "no type" "no type" { target { ! c++11 } } 3 } { }
google
android
constexpr-template6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template6.C
216
utf_8
7af69efd7e063989a419444f87d1e491
// PR c++/59268 // { dg-do compile { target c++11 } } template <typename> struct A { constexpr A (int) {} virtual void foo () { constexpr A<void> a (0); } }; void bar () { A<int> a (3); a.foo (); }
google
android
sfinae37
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae37.C
612
utf_8
7b81463244b957c8c4af2aa02bc32a56
// PR c++/51213 // { dg-do compile { target c++11 } } class C { typedef int type; }; template<int> struct I; template<> struct I<2> { }; template<class T, class = typename T::type> auto f(int) -> char; template<class> auto f(...) -> char (&)[2]; static_assert(sizeof(f<C>(0)) == 2, "Ouch"); typedef int testf[si...
google
android
ref-qual3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual3.C
398
utf_8
68b27ec15231994ad0330625660d2720
// An explicitly defaulted function can have a ref-qualifier. // { dg-require-effective-target c++11 } struct A { A& operator=(const A&) & = default; }; template<class T> struct B { B& operator=(const B&) & = default; }; template<class T> void f() { B<T> b; b = B<T>(); B<T>() = b; // { dg-error "" } } ...
google
android
overload2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/overload2.C
821
utf_8
15b4148c92763edcf90b0fe0cb6f7742
// Core 1321 // { dg-do compile { target c++11 } } // Two dependent names are equivalent even if the overload sets found by // phase 1 lookup are different. Merging them keeps the earlier set. int g1(int); template <class T> decltype(g1(T())) f1(); int g1(); template <class T> decltype(g1(T())) f1() { return g1(T());...
google
android
constexpr-nonlit
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit.C
298
utf_8
7984f830cb12240213de4cb699fc0fad
// FIXME this is currently invalid, but seems like it should be OK // { dg-do compile { target c++11 } } struct A { A() { } }; template<class T> constexpr bool ignore(T&&) { return true; } static_assert(ignore(10), "Error"); // OK A s; static_assert(ignore(s), "Error"); // Currently an error
google
android
pr31442
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31442.C
275
utf_8
85c07df4cc73b3fd07e5bd1d54420090
// { dg-do compile { target c++11 } } 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
android
variadic19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic19.C
618
utf_8
b6eb5a5a2dea08c17e47320efabe05df
// { dg-do compile { target c++11 } } template<typename... Args> struct tuple { static const int value = 0; }; template<typename T, template<class T> class... Metafunctions> struct tuple<Metafunctions<T>...> { static const int value = 1; }; template<typename T> struct add_pointer; template<typename T> struct add_...
google
android
nullptr30
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr30.C
955
utf_8
49c1560dffff238b969c66a36d9047af
// PR c++/58176 // { dg-do compile { target c++11 } } // Nil struct nil_ { constexpr nil_ () {} }; constexpr nil_ nil; // Cons template <class H, class T = nil_> struct cons_ { using head_ = H; using tail_ = T; H head; T tail; constexpr cons_() {} constexpr cons_(H const &h, T const &t) : he...
google
android
auto14
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto14.C
395
utf_8
73468f1855a41f415ce4bb0b0d6ac5d1
// PR c++/40306, c++/40307 // { dg-do run { target c++11 } } template< typename T > struct test { test run() { auto tmp = *this; return tmp; } test run_pass() { test tmp( *this ); return tmp; } test run_fail() { auto tmp( *this ); return tmp; } }; int main() { ...
google
android
variadic88
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic88.C
341
utf_8
ca0631935294493842fa9b4235ef77f5
// { dg-do compile { target c++11 } } template<template<typename...> class TT> TT<int, float, double> foo(TT<int, float>) { return TT<int, float, double>(); } template<typename T> int& foo(T) { static int i = 0; return i; } template<typename T, typename U> struct pair {}; void bar() { pair<int, float> p; ...
google
android
constexpr-condition
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C
231
utf_8
1b3b6506c34be30daa78b4f5636f9ca4
// { dg-do compile { target c++11 } } // Core DR 948 constexpr int something() { return 3; } int main() { if (constexpr long v = something()) {} if (static long v = something()) { } // { dg-error "decl-specifier invalid" } }
google
android
pr31445
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31445.C
169
utf_8
1de809553a185c022d03a44ef59095c3
// { dg-do compile { target c++11 } } template <typename... T> struct A { void foo(T...); A(T... t) { foo(t); } // { dg-error "parameter packs|t" } }; A<int> a(0);
google
android
vt-34606
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34606.C
235
utf_8
9ae58cd25d56dbaad7ed7765c88d2e17
// { dg-do compile { target c++11 } } template<typename...> struct A; template<typename T, typename... U> struct A<T, U> // { dg-error "parameter packs|U" } { template<typename> struct B; template<typename X> struct B<X*> {}; };
google
android
constexpr-overflow
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow.C
322
utf_8
b0f3e3a129a29b94607b7667c179da90
// { dg-do compile { target c++11 } } // { dg-options "-w -ftrack-macro-expansion=0" } #include <limits.h> extern constexpr int max_s = INT_MAX + 1; // { dg-error "" } extern constexpr unsigned max_u = UINT_MAX + 1u; // OK extern constexpr int abs_s = -INT_MIN; // { dg-error "" } overflows on 2's complement machine...
google
android
variadic123
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic123.C
192
utf_8
65d55dff0ff5ff941c35f3ec36247ce5
// PR c++/52824 // { dg-do compile { target c++11 } } template<typename G, typename H> struct foo {}; template<typename... G> struct bar : foo<G...> {}; int main() { bar<int, float> f; }
google
android
defaulted29
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted29.C
198
utf_8
74625e2ffd1ab0c5a552aa67c04bab26
// PR c++/46696 // { dg-do compile { target c++11 } } struct A { A& operator= (A const&); }; struct B { A ar[1]; B& operator= (B const&) = default; }; int main() { B x; B y; y = x; }
google
android
constexpr-rom
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C
601
utf_8
14b03001c80164ad6ad6da0c918b59b5
// PR c++/49673: check that test_data goes into .rodata // { dg-do compile { target c++11 } } // { dg-additional-options -G0 { target { { alpha*-*-* frv*-*-* ia64-*-* lm32*-*-* m32r*-*-* microblaze*-*-* mips*-*-* nios2-*-* powerpc*-*-* rs6000*-*-* score*-*-* } && { ! { *-*-darwin* *-*-aix* alpha*-*-*vms* } } } } } // {...
google
android
variadic-throw
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-throw.C
444
utf_8
a83d7b2e8c88d3199390bf0b51c597e1
// { dg-do compile { target c++11 } } // { dg-prune-output "note" } // PR c++/33509 template<int M, int N> struct pair { int i, j; pair() : i(M), j(N) {} }; template<int... M> struct S { template<int... N> static int foo() throw (pair <M, N>...) // { dg-error "mismatched" } { return 1; } }; int bar () {...
google
android
pr51216
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr51216.C
339
utf_8
0826580203443f6140fcf59428ad5352
// PR c++/51216 // { dg-do compile { target c++11 } } // { dg-options "" } void foo() { int i = ({ if (1) ; }); // { dg-error "ignored" } int j = ({ for (;;) ; }); // { dg-error "ignored" } int k = ({ while (1) ; }); // { dg-error "ignored" } int l = ({ do { } while (1); }); // { dg-e...
google
android
variadic150
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic150.C
144
utf_8
80ff2b10632dcf314d21c5a8921f3a55
// PR c++/60219 // { dg-require-effective-target c++11 } template<typename..., int> void foo(); void bar() { foo<0>; // { dg-error "" } }
google
android
gen-attrs-32
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-32.C
598
utf_8
40c67ccfef0cb87d376e264fb6122715
// PR c++/35315 // { dg-do compile { target c++11 } } typedef union { int i; } U [[gnu::transparent_union]]; // { dg-warning "ignored" } static void foo(U) {} static void foo(int) {} void bar() { foo(0); } typedef union U1 { int i; } U2 [[gnu::transparent_union]]; // { dg-warning "ignored" } static void foo2(U1)...
google
android
constexpr-ctor5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor5.C
304
utf_8
a15ac39628455598191a6c7526c0ea4b
// PR c++/46877 // { dg-do compile { target c++11 } } 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
android
constexpr-union5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-union5.C
603
utf_8
01b88919162b508acd06e72325ccf2df
// PR c++/54922 // { dg-do compile { target c++11 } } // { dg-options "-pedantic" } #define SA(X) static_assert(X,#X) struct A { union { union { union { unsigned char i; int j; }; }; }; constexpr A() : i(42) {} }; constexpr A a; SA((a.i == 42)); struct B { struct { int h; stru...
google
android
nsdmi-union1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-union1.C
274
utf_8
d1503365b6615b562965b9d47e9327c5
// PR c++/52377 // { dg-do run { target c++11 } } union Test { int a{4}; }; union B { int i = 42; double d; B() = default; B(double d): d(d) { } }; int main() { Test t; B b; B b2(4.2); if (t.a != 4 || b.i != 42 || b2.d != 4.2) __builtin_abort(); }
google
android
rv8p
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv8p.C
1,811
utf_8
40b10e2a2f81d881e2ce664b540bcd1a
// 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
defaulted31
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted31.C
286
utf_8
58fdaec80ad4602fd6ddca6b2bdc1150
// PR c++/39164 // { dg-do compile { target c++11 } } struct A { A() { } // { dg-message "defined" } ~A() = default; // { dg-error "defaulted" } }; A::A() = default; // { dg-error "redefinition" } A::~A() noexcept (true) { } // { dg-error "defaulted" } int main() { A a; }
google
android
forw_enum10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum10.C
763
utf_8
9a635853faf45f15109b67f28e1e484d
// { dg-do compile { target c++11 } } //This error is diagnosed at instantiation time template<typename T> struct S1 { enum E : T; // { dg-error "previous definition" } enum E : int; // { dg-error "different underlying type" } }; template struct S1<short>; // { dg-message "required from here" } template...
google
android
sfinae40
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae40.C
243
utf_8
2fb8fa59910d2727eae209d68c2185da
// PR c++/54541 // { dg-do compile { target c++11 } } template <typename T> T&& declval(); struct X; X f(int); template <class T> void g(decltype((void)f(declval<T>())) *) {} template <class T> void g(...) {} int main() { g<int>(0); }
google
android
variadic30
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic30.C
161
utf_8
53e6fde1ee24af6c60d7aaed5d68e021
// { 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
variadic76
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic76.C
217
utf_8
9ae68224072da4a2723e2c666742afdf
// PR c++/33496 // { dg-do compile { target c++11 } } template<int... N> int foo () { return sizeof... (N ()); // { dg-error "" } return sizeof... (N) (); // { dg-error "" } } int bar () { return foo<0> (); }
google
android
nsdmi3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C
300
utf_8
c39474dc306a716942bff0db9902a8ec
// { dg-do compile { target c++11 } } struct A { int i; explicit constexpr A(int i): i(i) {} }; struct B { A a1 = 1; // { dg-error "" } A a2 { 2 }; A a3 = { 3 }; // { dg-error "" } }; constexpr B b; // { dg-error "B::B" } // { dg-message "a1. is invalid" "" { target *-*-* } 11 }
google
android
variadic24
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic24.C
163
utf_8
2dbc19f9c68b17fc1a0c765277c318db
// { dg-do compile { target c++11 } } template<typename T, T... Values> struct vector_c { }; vector_c<int, 17, 42> intvec; vector_c<char, 'a', 'b', 'c'> charvec;
google
android
variadic-sizeof2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-sizeof2.C
228
utf_8
ab8ba157633a4a130772607a4ddbd4ef
// PR c++/57471 // { dg-require-effective-target c++11 } struct A { static constexpr bool value = true; }; template<typename... Types> struct B { static_assert(A::value, ""); static_assert(sizeof...(Types) == 0, ""); };
google
android
constexpr-tuple
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-tuple.C
1,763
utf_8
77e5599180280cec4988ec1ddb372b25
// PR c++/53202 // { dg-do run { target c++11 } } #include <tuple> template<typename Callable> struct Bind_simple { explicit Bind_simple(const Callable& callable) : _M_bound(callable) { } Bind_simple(const Bind_simple&) = default; Bind_simple(Bind_simple&&) = default; auto operator()...
google
android
ref-qual11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual11.C
176
utf_8
e25aa6f18faad387b7f1ade3529476a6
// PR c++/57253 // { dg-require-effective-target c++11 } template<typename T> struct foo; template<> struct foo<void()&> {}; template<> struct foo<void()> {}; int main() {}
google
android
implicit9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit9.C
271
utf_8
89d04ac4ced4669c0a8445e3dbdbb4eb
// Test that private base dtor makes derived ctor deleted // { dg-do compile { target c++11 } } struct A { A(); private: ~A(); // { dg-error "private" } }; struct B: A { }; // { dg-error "implicitly deleted|context" } B * b = new B; // { dg-error "deleted" }
google
android
initlist86
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C
245
utf_8
ce1c3896ddd664d6cbfa86d425a7cf39
// PR c++/61382 // { dg-do run { target c++11 } } struct A { int i,j; A(int i,int j):i(i),j(j){} }; extern "C" int printf (const char *, ...); int main() { int i = 0; A a{i++,i++}; if (a.i != 0 || a.j != 1) __builtin_abort(); }
google
android
nsdmi-template4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template4.C
235
utf_8
ecc55c2acf604366d5eab66ebf6a29dd
// PR c++/57887 // { dg-do compile { target c++11 } } struct B { template<int N> struct A { int X = N; }; }; template<int M> struct C { int Y = M; template<int N> struct A { int X = N; int Y = M; }; };
google
android
constexpr-non-const-arg3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg3.C
346
utf_8
0a75560f29cb0998e87af2e6941bea4d
// PR c++/49988 // { dg-do run { target c++11 } } 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 (b.a.data[0...
google
android
override1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/override1.C
1,197
utf_8
6100e2ec12da18b9cf85addbe5f50a30
// { dg-do compile { target c++11 } } struct B { virtual void f() final {} virtual void g() {} virtual void x() const {} }; struct B2 { virtual void h() {} }; struct D : B { virtual void g() override final {} // { dg-error "overriding" } }; template <class T> struct D2 : T { void h() override {} // { dg-...
google
android
initlist12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist12.C
270
utf_8
643eb2806cf5b8eee7e33463d6bd3994
// PR c++/38698 // { dg-do compile { target c++11 } } // { 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
android
range-for3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for3.C
729
utf_8
ba9e5975a5058b94945c4d18bb19b344
// Test for range-based for loop // Test the loop with a custom iterator // with begin/end in std // { dg-do compile { target c++11 } } struct iterator { int x; explicit iterator(int v) :x(v) {} iterator &operator ++() { ++x; return *this; } int operator *() { return x; } bool operator != (const i...
google
android
constexpr-condition2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-condition2.C
450
utf_8
8581fb1eeb620cb25e1a416019fc44de
// PR c++/48909 // { dg-do compile { target c++11 } } #define SA(X) static_assert((X),#X) constexpr int const * is_sorted_until(int const * first, int const * last) { return first == last || first + 1 == last ? last : (*(first + 1) < *first) != false ? first + 1 : is_sorted_until(first + 1, last); } int main() ...
google
android
pr38795
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr38795.C
207
utf_8
002a61df09102ac4a6f9dc2286ece2f6
// PR c++/38795 // { dg-do compile { target c++11 } } template<typename... T> int foo(int i) { return *reinterpret_cast<T*>(i); // { dg-error "not expanded with|T" } } void bar(int i) { foo<int>(i); }
google
android
dc5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/dc5.C
256
utf_8
677f54601e79fdc0353d4b7835f02857
// { dg-do run { target c++11 } } #include <cassert> int count = 0; struct VB { VB() {++count;} }; struct B : virtual VB { B() : B(42) {} B(int) {} }; struct D : B { D() {} D(int) : D() {} }; int main() { D d{42}; assert(count == 1); }
google
android
variadic2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic2.C
532
utf_8
5252a5695606031a85c7164558177566
// { dg-do compile { target c++11 } } template<typename... Args = int> // { dg-error "default argument" } class tuple2; template<typename... = int> // { dg-error "default argument" } class tuple3; template<typename T1, typename T2, typename... Rest> struct two_or_more {}; // { dg-error "provided for" } typedef two_o...
google
android
constexpr-initlist8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist8.C
132
utf_8
2f5a541884b93dc4fac5f08d637acbf0
// PR c++/63415 // { dg-do compile { target c++11 } } template <typename T> struct A { static constexpr int value = int(T{}); };
google
android
constexpr-ctor4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor4.C
153
utf_8
fe03ae0923ec0f159b32d4c95a97afbb
// PR c++/46873 // { dg-do compile { target c++11 } } struct S { int i:1; }; struct T { const S s; constexpr T (S a = S ()) : s (a) { } }; T t;
google
android
variadic134
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic134.C
431
utf_8
70f85a4313e0ae6d4f02299251ddaaf1
// PR c++/53862 // { dg-do compile { target c++11 } } typedef unsigned long size_t; template<typename> struct is_scalar { static const bool value = true; }; template<bool, typename T> struct enable_if { typedef T type; }; template <size_t N, typename... Args> void f(Args...) {} template <size_t N, typename T, typen...
google
android
variadic60
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic60.C
103
utf_8
38249542f51fe10935672f11f3ada1b6
template<typename... Args> class tuple; // { dg-error "variadic templates" "" { target { ! c++11 } } }
google
android
decltype26
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype26.C
227
utf_8
099f210b6e74b9250630b2e61e23fddf
// { dg-do compile { target c++11 } } struct A { }; template <class T> decltype(f(T())) f(T t) // { dg-error "depth" } { return f(t); } int main() { f(A()); // { dg-error "no match" } } // { dg-prune-output "note" }
google
android
inh-ctor1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor1.C
196
utf_8
ce0c2d69b70da2aab0639e2d4a73e306
// { dg-do compile { target c++11 } } struct A { int i; constexpr A(int i): i(i) {} }; struct B: A { using A::A; }; constexpr B b(42); #define SA(X) static_assert((X),#X) SA(b.i == 42);
google
android
variadic-diag1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-diag1.C
311
utf_8
a959853b4b06b6225bb508d5c51f1e43
// PR c++/55232 // { dg-do compile { target c++11 } } struct vector { typedef int value_type; }; template< class U, class... T > struct X { void push_back( typename T::value_type ... vals ) { U::asoeuth; // { dg-error "" } } }; int main() { X< int, vector > x; x.push_back( 0 ); }
google
android
vt-34051-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34051-2.C
171
utf_8
68f52218bee5ae11a023b9c0fec5106a
// { dg-do compile { target c++11 } } template<typename... T> struct A { int i __attribute__((aligned(__alignof(T)))); // { dg-error "parameter packs|T" } }; A<int> a;
google
android
pr47476
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr47476.C
134
utf_8
4a1a8e5102e4cf4f1f2452ab499ac012
// PR c++/47476 // { dg-do compile { target c++11 } } int foo (int a, int b) { const bool c ((a != 0) == (b != 26)); return c; }
google
android
variadic109
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic109.C
268
utf_8
a1b794330997bd1ff2a965446ae0dc4a
// PR c++/48292 // { dg-do compile { target c++11 } } template <typename... Args> int g(Args...); template <int N = 0> struct A { template <typename... Args> static auto f(Args... args) -> decltype(g(args...)); }; int main() { A<>::f(); return 0; }
google
android
variadic-unify
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-unify.C
336
utf_8
72f7c5714fa45fa32619b387e484e88b
// { dg-do compile { target c++11 } } template<typename...> struct tuple { }; template<typename... Args1, typename... Args2> void foo(tuple<Args1..., Args2...>, tuple<Args1...>, tuple<Args2...>); struct X{ }; void bar() { tuple<int, float> tif; tuple<double, X> tdx; tuple<int, float, double, X> tall; foo(tal...
google
android
auto2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto2.C
1,087
utf_8
c3b17f280e93f3b62594467d32d87662
// Positive test for auto // { dg-do run { target c++11 } } #include <typeinfo> extern "C" void abort(); int f() {} struct A { int i; int f() {} A operator+(A a) { return a; } }; template <class T> void g(T t) { auto x = t+t; if (typeid(x) != typeid(t+t)) abort(); auto p = new auto(&t); if (typei...
google
android
sfinae17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae17.C
446
utf_8
cd64e740d4c3e254f7be08bba361c384
// 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() = delete; }; static_assert(sizeof(f<DelDtor[2]>(0)) != 1, "Error"); struct A { static DelDtor *p; }; template<class T, class = decltyp...
google
android
variadic65
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic65.C
358
utf_8
1fbe39ae1da7fe47a33025b7cc390e55
// { dg-do compile { target c++11 } } struct unused; template<typename T1 = unused, typename T2 = unused, typename T3 = unused, typename T4 = unused, typename T5 = unused, typename T6 = unused> struct tuple {}; template<typename... Args> tuple<Args...> foo() { } // { dg-bogus "cannot expand" "" } int main() ...
google
android
variadic29
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic29.C
1,047
utf_8
4710b3e65fdc7735948f575588e21df4
// { dg-do compile { target c++11 } } template<typename Signature> struct function_traits; template<typename R, typename... ArgTypes> struct function_traits<R(ArgTypes...)> { typedef R result_type; }; template<typename R, typename Class, typename... ArgTypes> struct function_traits<R (Class::*)(ArgTypes...)> { ty...
google
android
pr51547
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr51547.C
572
utf_8
28465619fad84c387cade9fc57805304
// PR c++/51547 // { dg-do compile { target c++11 } } template <class T> struct vector { T* begin() { return &member; } const T* begin() const { return &member; } T member; }; struct Bar { int x; }; struct Foo { const vector<Bar>& bar() const { return bar_; } vector<Bar> bar_; }; templa...
google
android
nullptr08
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr08.C
256
utf_8
7bc03ec249f301bc0bfde63509409344
// { dg-do compile { target c++11 } } // Test conversion to bool #define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0) void fun() { assert_true(nullptr ? false : true); decltype(nullptr) mynull = 0; assert_true(mynull ? false : true); }
google
android
pr32128
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32128.C
213
utf_8
73b6cddbd30dfea6a9263cc3c8d5abcb
// { dg-do compile { target c++11 } } template<typename...> struct A; template<typename...T, typename...U> struct A<T..., U...> {}; // { dg-error "must be at the end" } A<int> a; // { dg-error "incomplete" }
google
android
initlist-explicit-sfinae
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-explicit-sfinae.C
1,063
utf_8
f61f621dcd5efc7adaf806419bd64a07
// { dg-do compile { target c++11 } } template<typename _Tp> _Tp&& declval() noexcept; template<bool b> struct bt { static constexpr bool value = b; }; template <typename To_, typename... From_> class my_is_convertible_many { private: template <typename To> struct indirector { indirector(To); }...
google
android
decltype10
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype10.C
197
utf_8
0e5a3836bf22c03696252480b80064b6
// PR c++/34271 // { dg-do compile { target c++11 } } template<int> struct A { static int i; }; template<int N> int A<N>::i(decltype (A::i; // { dg-error "expected primary-expression before" }
google
android
variadic61
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic61.C
122
utf_8
fc2fc2c87d783c7e4469a5ddeec5b902
// { dg-options "-std=gnu++98 -pedantic" } template<typename... Args> class tuple; // { dg-warning "variadic templates" }
google
android
gen-attrs-51
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-51.C
186
utf_8
a80aa159eb3e2fe0b9f619cbe96ece0b
// { dg-do compile { target c++11 } } typedef char layout_type; struct A { layout_type member [[gnu::aligned (16)]]; }; static_assert (sizeof (A) == 16, "Alignment should be 16");
google
android
alias-decl-dr1286
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286.C
403
utf_8
0c857f35d307877fbdc35abb07bb117c
// DR 1286: An alias template can be equivalent to an underlying template. // { dg-do compile { target c++11 } } template <class T, class U> struct same; template <class T> struct same<T,T> {}; template <class T> struct A {}; template <class T> using B = A<T>; template <template <class> class T> class C {}; void f(...
google
android
udlit-tmpl-arg-neg
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-tmpl-arg-neg.C
144
utf_8
b0d09c427406afa79404ae6e27aa438a
// { dg-do compile { target c++11 } } template<char...> int operator"" _xyz(unsigned long long); // { dg-error "has invalid argument list" }
google
android
gen-attrs-56
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-56.C
159
utf_8
f48062e4d0290e1ca4859c283ed90e0f
// PR c++/58724 // { dg-do compile { target c++11 } } namespace foo __attribute__((visibility("default"))) {} namespace bar [[gnu::visibility("default")]] {}