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 | error7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error7.C | 246 | utf_8 | f75f41e0c1359b56dd9a9190d3b7dbfc | // Test for printing the type of T{} in error messages.
// { dg-do compile { target c++11 } }
template <class T, T t> struct A { };
template <class T> A<T,T{}> f(T t); // { dg-message "T{}" }
int main()
{
f(); // { dg-error "no match" }
}
|
google | android | constexpr-reinterpret1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-reinterpret1.C | 674 | utf_8 | 480a01a611bbd0507bade69dfc6fc6c3 | // PR c++/56728
// { dg-require-effective-target c++11 }
class B {
public:
static B instance;
class Inner
{
public:
class Wuzi
{
unsigned int m;
} m_Class[3];
unsigned m_Int[4];
};
constexpr static Inner & getInner()
{
/* I am surprised this is considered a constexpr */
ret... |
google | android | explicit5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit5.C | 293 | utf_8 | f347276901d21feb41a426530f369377 | // test for extension of DR 899 to handle template ctors
// { dg-do run { target c++11 } }
int r = 1;
struct C {
C() { }
template <class T = int> C(C&, T = 0) { r = 0; }
};
C c;
struct A
{
explicit operator C&() const { return c; }
};
int main()
{
A a;
C c2 (a);
return r;
}
|
google | android | gen-attrs-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-2.C | 112 | utf_8 | 55d3adc084d366b23be078511b3dfa85 | // { dg-do compile { target c++11 } }
struct [[gnu::packed]] A
{
void f () const;
};
void
A::f () const
{
}
|
google | android | inh-ctor8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C | 218 | utf_8 | 3e47bc4c1090a1639f8ab3081f4464c0 | // { dg-do compile { target c++11 } }
struct A
{
int i;
explicit A(int i): i(i) {}
};
struct B: A
{
using A::A;
};
void f(B);
int main()
{
f(B(42)); // OK
f(42); // { dg-error "could not convert" }
}
|
google | android | long_long | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/long_long.C | 104 | utf_8 | 41600003230a22f3cbcc4e6fac3dde3d | // { dg-do compile { target c++11 } }
// { dg-options "-pedantic" }
void foo()
{
long long x = 17;
}
|
google | android | elision_weak | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/elision_weak.C | 118 | utf_8 | af521f07a34d29e505189640746f3ea0 | // { dg-do compile }
struct S
{
S() {}
S(S&) {}
};
S f()
{
S s;
return s;
}
void g()
{
S s;
throw s;
}
|
google | android | inline-ns5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inline-ns5.C | 107 | utf_8 | 868d9c1bbed4bb85f1cbb3ad116f6eb1 | // { dg-options "-std=gnu++98 -pedantic-errors" }
inline namespace { } // { dg-error "inline namespaces" }
|
google | android | gen-attrs-11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-11.C | 252 | utf_8 | 7de2f3d73363a0558cd75484e381dcca | // { dg-do compile { target c++11 } }
// PR c++/13791
template <typename T> struct O {
struct [[gnu::packed]] I {
int i;
char c;
};
I* foo();
};
template <typename T>
typename O<T>::I*
O<T>::foo() { return 0; }
template class O<int>;
|
google | android | udlit-concat | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-concat.C | 504 | utf_8 | 6260f7d860d2a182d4ee1545400dfef8 | // { dg-do compile { target c++11 } }
#include <string>
std::string operator"" _www(const char*, size_t);
std::string concat01 = "Hello, " "World!"_www;
std::string concat10 = "Hello, "_www "World!";
std::string concat11 = "Hello, "_www "World!"_www;
class Tachyon { };
Tachyon operator"" _fast(const char*, size... |
google | android | range-for16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for16.C | 455 | utf_8 | e52b898f780ed4b01b2040fda37a40e1 | // Test for range-based for loop with arrays of
// incomplete type or unknown size
// { dg-do compile { target c++11 } }
extern int a[10];
extern int b[];
struct S;
extern S c[10];
extern S d[];
void test()
{
for (int n : a);
for (int n : b); // { dg-error "incomplete type" }
for (S &n : c); // { dg-err... |
google | android | gen-attrs-44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-44.C | 132 | utf_8 | 12437169955b7d6fc70547853053ddac | // PR c++/52671
// { dg-do compile { target c++11 } }
[[gnu::deprecated]] enum E { E0 }; // { dg-warning "ignored in declaration" }
|
google | android | enum_base_warn | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum_base_warn.C | 430 | utf_8 | e7c84c63ead58305d6411cb0d3c78c80 | // { dg-do run { target c++11 } }
// { dg-options "-O2 -Wtype-limits" }
extern void link_error (void);
enum Alpha : unsigned char {
ZERO = 0, ONE, TWO, THREE
};
Alpha a2;
int m1 = -1;
int GetM1() {
return m1;
}
int main() {
a2 = static_cast<Alpha>(GetM1());
if (a2 == -1) { // { dg-warning "always false due" }
... |
google | android | variadic47 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic47.C | 326 | utf_8 | e6b4bb01f7c8c817f0070077cc489487 | // { dg-do compile { target c++11 } }
template<typename T> struct wrap { };
template<typename... Args>
int& f(const Args&...);
template<typename... Args>
float& f(const wrap<Args>&...);
int& g(int x, float y, double z)
{
return f(x, y, z);
}
float& h(wrap<int> x, wrap<float> y, wrap<double> z)
{
return f(x, y, ... |
google | android | range-for25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for25.C | 356 | utf_8 | a1ffe33575e516147d04bf615cd38349 | // PR c++/57243
// { dg-require-effective-target c++11 }
struct snarf
{
template <class T>
void get() {}
};
template <class T>
struct container
{
snarf * begin() { return nullptr; }
snarf * end() { return nullptr; }
};
template <class T>
void foo()
{
container<int> arr;
for( auto i : arr )
i.get<int... |
google | android | initlist47 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist47.C | 175 | utf_8 | 012b0613830ba9e997ec6a1aa5dd1787 | // { dg-do compile { target c++11 } }
struct A { ~A() = delete; }; // { dg-message "declared" }
int main()
{
typedef const A cA[2];
cA{}; // { dg-error "deleted" }
}
|
google | android | sfinae44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae44.C | 525 | utf_8 | f5feed020fb18d32cecaad1d344c52bd | // PR c++/56913
// { dg-do compile { target c++11 } }
template<typename T>
T &&declval();
template<typename T, typename U,
typename = decltype((declval<T>().*declval<U>())())>
constexpr bool test(int)
{
return true;
}
template<typename T, typename U>
constexpr bool test(...)
{
return false;
}
struct S
... |
google | android | constexpr-static5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C | 208 | utf_8 | b85cc1e2ac10a39a2a536c6337275651 | // { dg-do compile { target c++11 } }
template <class T>
struct A
{
constexpr static T t = T(); // { dg-error "literal" }
};
template <class T>
constexpr T A<T>::t;
struct B
{
~B();
};
B b = A<B>::t;
|
google | android | initlist53 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist53.C | 389 | utf_8 | 5ea7fac5f64593df1c05fa9edb561d6f | // PR c++/49216
// { dg-do run { target c++11 } }
#include <initializer_list>
extern "C" void abort();
void * operator new[] (__SIZE_TYPE__, void *p) { return p; }
bool constructed;
struct A
{
A(std::initializer_list<int>) { constructed = true; }
};
int main() {
new A[1]{};
int space[1] = { 42 };
int *p = n... |
google | android | initlist67 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist67.C | 461 | utf_8 | 6650a9c1344eadc6fe089c86a5926e66 | // PR c++/50478
// { dg-do compile { target c++11 } }
#include <initializer_list>
namespace std
{
template<typename _Key>
struct set
{
void insert(const _Key&);
void insert(initializer_list<_Key>);
};
struct string
{
string(const string&, __SIZE_TYPE__, __SIZE_TYPE__ = -1);
stri... |
google | android | variadic-lambda | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-lambda.C | 1,837 | utf_8 | f64443a27f946984ec474714387b99a8 | // { dg-do compile { target c++11 } }
struct int_placeholder;
template<typename T>
struct do_replace
{
typedef T type;
};
template<>
struct do_replace<int_placeholder>
{
typedef int type;
};
template<typename T> struct lambdalike
{
typedef T type;
};
template<template<typename...> class TT, typename... Args>... |
google | android | variadic92 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic92.C | 1,364 | utf_8 | b6b37d0cd3dea81ed66112dbc1aa23a9 | // Various tests for variadic templates and partial specialization.
// { dg-do compile { target c++11 } }
// PR c++/36846
template<typename A, typename B>
struct pair;
template<typename... T>
struct pairs;
template<typename... AS, typename... BS>
struct pairs<pair<AS, BS>...> {
struct mismatched_packs {};
};
temp... |
google | android | vt-40092 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-40092.C | 431 | utf_8 | 36dec98ef708150f68fb0f12e669300e | // { dg-do compile { target c++11 } }
template <typename... Types> struct package {};
template <int ArgGen> struct wrapper_gen {};
template <int ArgNest> struct wrapper_nest
{
typedef wrapper_gen<ArgNest> type_nest;
};
template <int... ArgPack>
struct wrapper_pack
{
typedef package<wrapper_gen <ArgPack>...> typ... |
google | android | constexpr-diag3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C | 1,209 | utf_8 | 89ecc4f77b13ca5d593de0a5e9ca90b6 | // PR c++/45923
// { dg-do compile { target c++11 } }
int f(int);
template <class T>
constexpr T g(T t) { return f(t); } // { dg-error "f.int" }
int main()
{
constexpr int i = g(1); // { dg-error "g.T" }
}
// --------------------
struct complex // { dg-message "no constexpr constructor" }
{
complex(double r... |
google | android | variadic-ex14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C | 707 | utf_8 | da95b54b81a9dcfddff5c3438dea3142 | // { dg-do compile { target c++11 } }
template<class T> class A { /* ... */ };
template<class T, class U = T> class B { /* ... */ };
template<class... Types> class C { /* ... */ };
template<template<class> class P> class X { /* ... */ };
template<template<class...> class Q> class Y { /* ... */ };
X<A> xA; // okay
X<... |
google | android | initlist44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist44.C | 120 | utf_8 | 7c4d059ba7a6e5f0ea6b9b994758d68d | // { dg-do compile { target c++11 } }
#include <initializer_list>
auto value = std::initializer_list<int>{ 1, 2, 3 };
|
google | android | pr58080 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58080.C | 289 | utf_8 | 66a132ab0a4f16eb332c03fd38067a1c | // PR c++/58080
// { dg-do compile { target c++11 } }
template<class A, class B>
struct Eval
{
void foo(A a, B b) { bar(a,b, 0); }
auto bar(A a, B b, decltype(a+b)* _) -> decltype(a+b) { return a+b; } // { dg-error "pointer" }
};
int main()
{
Eval<int,void*> eiv; eiv.foo(0,0);
}
|
google | android | alignof | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alignof.C | 152 | utf_8 | dad14da1d0b01a33c9cdabaaf609eb0a | // { dg-do compile { target c++11 } }
int main(void)
{
static_assert(alignof(int) == __alignof(int), "alignof(int) does not equal __alignof(int)");
}
|
google | android | collapse | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/collapse.C | 960 | utf_8 | 00e99c6cae64f722f78b0f72a5209b78 | // { dg-do compile { target c++11 } }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
typedef int & lref;
typedef int const & clref;
typedef int && rref;
typedef int const && crref;
template<typename T>
struct S
{
typedef T & lref;
typedef T const & clref;
type... |
google | android | scoped_enum_examples | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/scoped_enum_examples.C | 661 | utf_8 | 6685ec50d52d3887bdc0a886cae9ec64 | // { dg-do compile { target c++11 } }
enum class Col { red, yellow, green };
int x = Col::red; // { dg-error "cannot convert" }
Col y = Col::red;
void f()
{
if (y) { } // { dg-error "could not convert" }
}
enum direction { left='l', right='r' };
void ... |
google | android | initlist13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist13.C | 124 | utf_8 | a5e64985a46db12492fa03d5e7dfd347 | // PR c++/39056
// { dg-do compile { target c++11 } }
#include <complex>
__complex__ int i {0};
std::complex<int> i2 {0};
|
google | android | range-for15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for15.C | 746 | utf_8 | 6744db312d947b21c87f772cadc96f8a | // Test for range-based for loop with templates
// and begin/end as member (non-)virtual functions
// { dg-do run { target c++11 } }
unsigned int g;
struct A
{
virtual int *begin()
{
g |= 1;
return 0;
}
int *end()
{
g |= 2;
return 0;
}
};
struct B : A
{
vi... |
google | android | dc4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/dc4.C | 139 | utf_8 | 86a73804c5d75cd770c1b8d72949a84b | // { dg-do compile }
// { dg-options "--std=c++98" }
struct X {
X() {}
X(int) : X() {} // { dg-warning "delegating constructors" }
};
|
google | android | decltype30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype30.C | 295 | utf_8 | 3ffe9a4bd265e99a11cdc602b9903250 | // PR c++/49369
// { dg-do compile { target c++11 } }
template <class,class> struct assert_same;
template <class T> struct assert_same<T,T> {};
struct B {
int member;
};
struct C: B {
void method() const;
};
void C::method() const {
assert_same<decltype((B::member)), const int&> a;
}
|
google | android | syntax-err1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/syntax-err1.C | 172 | utf_8 | 1045190e7a2a2af12d9111218b20eb11 | // PR c++/47198
// { dg-do compile { target c++11 } }
struct S
{
template < int > sometype foo (); // { dg-error "sometype. does not name a type" }
S () = default;
};
|
google | android | initlist62 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist62.C | 187 | utf_8 | 6bc68dc1b3a96627ce0fcec30064e1d7 | // PR c++/51399
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct A
{
std::initializer_list<int> x[1] = { 0 }; // { dg-error "could not convert" }
A() {}
};
|
google | android | variadic12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic12.C | 1,149 | utf_8 | e740a8cae9b06f80189c35aaf8763565 | // { dg-do compile { target c++11 } }
// A tuple type
template<typename... Args> struct tuple { };
// Determine if two types are the same
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;
};
// Append ... |
google | android | explicit3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit3.C | 749 | utf_8 | f5b332af02446b84b82fe67845506f10 | // Test for "contextually converted to bool"
// { dg-do compile { target c++11 } }
struct A
{
explicit operator bool();
};
void f (bool);
struct B
{
bool b;
};
struct C
{
operator int();
};
struct D
{
operator int();
};
int main()
{
A a; C c; D d;
// These contexts use an explicit bool conversion.
i... |
google | android | defaulted41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted41.C | 170 | utf_8 | ac76d900f119c9ca0e7c93a364ec9ca8 | // PR c++/56343
// { dg-do compile { target c++11 } }
class B
{
public:
virtual ~B() noexcept(false) { }
};
class D : public B
{
public:
virtual ~D() = default;
};
|
google | android | forw_enum5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum5.C | 1,577 | utf_8 | 0eae8ea24cb913ed66dd5ba47a37964b | // { dg-do compile { target c++11 } }
namespace one
{
struct S
{
enum { A = 1, B = 2 };
struct T
{
enum { B = 102 };
enum class E1;
enum E2 : int;
};
};
enum class S::T::E1 { A1 = A, B1 = B, C1 };
enum S::T::E2 : int { A1 = A, B1... |
google | android | constexpr-ctor3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor3.C | 114 | utf_8 | 6149d79aef3c5dc04bce76d97b8072e3 | // PR c++/46348
// { dg-do compile { target c++11 } }
struct A
{
int arr[1];
constexpr A()
: arr() { }
};
|
google | android | gen-attrs-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-6.C | 347 | utf_8 | d1722efa262e03d4b29a04648feeaa80 | //
// Test that the nothrow attribute is working correctly.
//
// Written by Richard Henderson, 26 May 2002.
// { dg-do link { target c++11} }
extern void foo [[gnu::nothrow]] ();
extern void link_error();
int main()
{
try {
foo();
} catch (...) {
link_error();
}
}
void foo() { } |
google | android | initlist75 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist75.C | 147 | utf_8 | febd377c53dada8e2c9fee93f0520448 | // PR c++/59080
// { dg-require-effective-target c++11 }
#include <initializer_list>
auto foo[] = {}; // { dg-error "auto|unable to deduce" }
|
google | android | defaulted45 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted45.C | 282 | utf_8 | bf3070d396c7bb7e08191019deb59497 | // { dg-do run }
// { dg-require-effective-target c++11 }
struct A
{
int i;
A() = default;
A(int i): i{i} { }
~A() {}
};
int main(int argc, char **argv)
{
{ int i[4] = { 42, 42, 42, 42 }; }
{
A a[4] = { argc };
if (a[1].i != 0)
__builtin_abort ();
}
}
|
google | android | constexpr-ellipsis | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis.C | 186 | utf_8 | df8026b0f85dbf1a32a645a96eaee562 | // { dg-do compile { target c++11 } }
constexpr int ellipsis(...) { return 1; }
constexpr int ellipsis_c = ellipsis(); // OK
constexpr int ellipsis_c2 = ellipsis(42); // Internal error
|
google | android | range-for8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C | 269 | utf_8 | 52e4fd10daa41fb157218e52014c09f1 | // Test for range-based for loop when the declarator declares
// a new type
// { dg-do compile { target c++11 } }
#include <initializer_list>
void test()
{
for (struct S { } *x : { (S*)0, (S*)0 } )
;
for (struct S { } x : { S(), S() } )
;
}
|
google | android | auto38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto38.C | 223 | utf_8 | 901c3113c76d7a71ea7d860f910010af | // PR c++/57183
// { dg-do compile { target c++11 } }
// { dg-options "-Wunused-variable" }
constexpr float PI_0 = 3.1415926F;
constexpr auto PI_1 = 3.1415926F;
const float PI_2 = 3.1415926F;
const auto PI_3 = 3.1415926F;
|
google | android | pr32127 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32127.C | 176 | utf_8 | 82195bee4e1b19569b2d7009bb7a4d80 | // { dg-do compile { target c++11 } }
template<typename...T> struct A
{
static T i; // { dg-error "parameter packs|T" }
};
int j = A<int>::i; // { dg-error "not a member" }
|
google | android | decltype25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype25.C | 451 | utf_8 | 679f4dc14d1bcb999519310083db1f7a | // PR c++/47851
// { dg-do compile { target c++11 } }
struct Type {
void display_type();
void display_type() const { }
};
typedef Type const ConstType;
struct ConvertibleToType {
operator Type&() { return *reinterpret_cast<Type*>(this); }
};
int main ()
{
// Both lines should call the const variant.
(tr... |
google | android | initlist25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist25.C | 236 | utf_8 | e9d4087118231da3d279e1d516576092 | // PR c++/41754
// { dg-do run { target c++11 } }
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main()
{
map<string, string> m;
m.insert({{"t", "t"}, {"y", "y"}});
return 0;
}
|
google | android | defaulted10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted10.C | 277 | utf_8 | ed0b7799626b31c5a32ff2aa85aca02b | // PR c++/40381
// { dg-do compile { target c++11 } }
struct A
{
template<typename T> void foo(T) = delete; // { dg-error "previously|declared" }
};
template<typename T> void A::foo(T) {} // { dg-error "redefinition" }
void bar()
{
A().foo(0); // { dg-error "use" }
}
|
google | android | udlit-template | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-template.C | 828 | utf_8 | 117eb1a5d0b43e757e32af6c01bcf93f | // { dg-do run { target c++11 } }
// Test user-defined literals.
// Test template operator declaration and definition.
#include <cassert>
template<char...>
int operator"" _abc();
template<>
int
operator"" _abc<>()
{ return -1; }
template<>
int
operator"" _abc<'L','U','E'>()
{ return 42; }
template<>... |
google | android | trailing2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing2.C | 552 | utf_8 | 4cac586735889de82b22991e886a8b3e | // PR c++/37967
// Negative test for auto
// { dg-do compile { target c++11 } }
auto f1 () -> int;
auto f2 (); // { dg-error "without trailing return type" "" { target { ! c++1y } } }
int f3 () -> int; // { dg-error "trailing return type" }
auto *f4 () -> int; // { dg-error "trailing return type" }
struct A
{
auto... |
google | android | nsdmi8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi8.C | 157 | utf_8 | f6b13d6e4f8551af6696e76147a52fb9 | // PR c++/55670
// { dg-do compile { target c++11 } }
template <class T> using F = T;
struct X {
F<void ()>* fp = nullptr;
};
int main () { return 0; }
|
google | android | nullptr28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr28.C | 225 | utf_8 | ed0b1bea17f3a01fbdad8b158e308421 | // { dg-do run { target c++11 } }
typedef decltype(nullptr) nullptr_t;
int i;
nullptr_t n;
const nullptr_t& f() { ++i; return n; }
nullptr_t g() { return f(); }
int main()
{
g();
if (i != 1)
__builtin_abort ();
}
|
google | android | variadic145 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic145.C | 365 | utf_8 | 6b91136ea42e52059454c7003332f69e | // PR c++/59730
// { dg-do compile { target c++11 } }
template <typename> void declval();
template <typename> void forward();
template <typename> class D;
template <typename _Functor, typename... _Bound_args>
class D <_Functor(_Bound_args...)> {
template <typename... _Args, decltype(declval<_Functor>)>
void operat... |
google | android | temp-va-arg-bug | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/temp-va-arg-bug.C | 189 | utf_8 | 97ab61118de35ac65f81fc7075a15809 | // { dg-do compile { target c++11 } }
// { dg-options "-Wno-abi" { target arm_eabi } }
#include <stdarg.h>
struct S { };
void f(S const &);
void g(va_list args)
{
f(va_arg(args, S));
}
|
google | android | variadic35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic35.C | 267 | utf_8 | 6489a8d10da4de0eed472ee88c0f4ab4 | // { dg-do compile { target c++11 } }
template<int I, typename... Args>
void get_ith(const Args&... args); // { dg-message "note" }
void f()
{
get_ith<1, float>(1, 2.0, 'x');
get_ith<1, int, double, char, int>(1, 2.0, 'x'); // { dg-error "too few arguments" }
}
|
google | android | constexpr-ref4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ref4.C | 377 | utf_8 | 4a419e5c6ce47dccd964e56d5fc66865 | // PR c++/54777
// { dg-do compile { target c++11 } }
struct S
{
int s[1];
constexpr const int &foo (unsigned i) { return (i < 1 ? 0 : throw 1), s[i]; }
constexpr const int &bar (unsigned i) { return i < 1 ? s[i] : (throw 0, s[i]); }
};
int
main ()
{
constexpr S a {};
constexpr int i = a.foo (0);
constexp... |
google | android | initlist-array2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-array2.C | 150 | utf_8 | 09f09079c354ad93c3844a14549e0854 | // { dg-do compile { target c++11 } }
typedef int IA[2];
typedef double DA[2];
void f(const IA&) { }
void f(const DA&);
int main()
{
f({1,2});
}
|
google | android | pr33839 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr33839.C | 204 | utf_8 | be18d05a4a250bf242ba8f7cef911418 | // { dg-do compile { target c++11 } }
template<int> struct A;
void foo()
{
__decltype A<0>; // { dg-error "invalid declarator|expected" }
__decltype (A<0>); // { dg-error "must be an expression" }
}
|
google | android | nsdmi-defer4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C | 213 | utf_8 | 038b57fc82284f2499013b6711bc0a8e | // { dg-do run { target c++11 } }
struct A
{
int i = 42;
int j = f();
int k = this->f();
int f() { return i++; }
};
A a;
int main()
{
if (a.j != 42 || a.k != 43 || a.i != 44)
__builtin_abort();
}
|
google | android | initlist52 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist52.C | 118 | utf_8 | e1a1ac5d906a6e7358e62d1a8a2ff538 | // PR c++/45378
// { dg-do compile { target c++11 } }
int main()
{
int x { 22.2 }; // { dg-error "narrowing" }
}
|
google | android | pr59641 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr59641.C | 210 | utf_8 | 97725be33d84460ca43942d2adc95953 | // { dg-do compile { target c++11 } }
typedef int T __attribute__((vector_size(2*sizeof(int))));
void foo(T& r, const T& a, const T& b)
{
constexpr T c = a < b; // { dg-error "constant" }
r = c ? a : b;
}
|
google | android | rv-reinterpret | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C | 157 | utf_8 | 2a81ce678792db63349c1f40f691b226 | // { dg-do run { target c++11 } }
void f(int &);
void f(int &&ir) { ir = 42; }
int main()
{
int x;
f(reinterpret_cast<int&&>(x));
return (x != 42);
}
|
google | android | variadic-crash1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-crash1.C | 1,269 | utf_8 | 5b99491b1ddd285caf57c8d9cc3a52aa | // { dg-do compile { target c++11 } }
#define ONE
#define TWO
#define THREE
struct Something {};
Something ___;
template <class F>
struct Trial
{
F f;
public:
Trial() : f() {}
Trial( const F& ff ) : f(ff) { }
template <typename... Args>
struct Sig { typedef int ResultType; };
template <typename... Args>
stru... |
google | android | constexpr-complex | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C | 396 | utf_8 | 80367967b9445fd60f61c8e306a887c1 | // Make sure C99 complex works with constexpr
// { dg-do compile { target c++11 } }
// { dg-options "" }
struct complex
{
typedef float value_type;
typedef __complex__ float _ComplexT;
constexpr complex(_ComplexT __z) : _M_value(__z) { }
constexpr complex(float __r = 0.0f, float __i = 0.0f)
: _M_value(__r ... |
google | android | nullptr03 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr03.C | 221 | utf_8 | 8c580eb6e0700da9be9e44c2e2030a91 | // { dg-do compile { target c++11 } }
// Test assignment to int
const int n1 = nullptr; // { dg-error "cannot convert " }
decltype(nullptr) mynull = 0;
const int n2 = mynull; // { dg-error "cannot convert " }
|
google | android | constexpr-virtual3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual3.C | 602 | utf_8 | 44969c53d3baefced39237dffe84c4e6 | // PR c++/54253
// { dg-do compile { target c++11 } }
namespace A {
class Base {
int x;
public:
constexpr Base(int x) : x(x) {}
};
class Base2 {
public:
virtual void fun() {}
};
class Derived : public Base2, public Base {
public:
constexpr Derived() : Base2(), Base(5) {}
};
const... |
google | android | auto32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto32.C | 182 | utf_8 | 2cbc64372a2839e349e2ff9492fea8c2 | // { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_Z1fIiEDTnw_Dapifp_EET_" } }
template <class T> auto f(T t) -> decltype (new auto(t));
int main()
{
f(1);
}
|
google | android | auto23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto23.C | 93 | utf_8 | e96a936d84bcdee82b6373ca3666d8e3 | // PR c++/46245
// { dg-do compile { target c++11 } }
template<auto f()->int> struct A { };
|
google | android | gen-attrs-10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-10.C | 184 | utf_8 | cb97cb3c29926aede38017aa01da015d | // PR c++/12795
// { dg-do compile { target c++11 } }
// { dg-require-alias "" }
void foo()
{
extern void bar [[gnu::__alias__ ("BAR")]] (); // { dg-warning "ignored" }
bar ();
}
|
google | android | vt-35147 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-35147.C | 351 | utf_8 | 74966226b2cca7fcf8e082657ab469d9 | // { dg-do compile { target c++11 } }
template<typename _Tp>
_Tp&& forward(_Tp&& __t) { return __t; } // { dg-message "note" }
void f(...);
template<typename... Args>
void g(Args&&... args)
{
f(forward<Args...>(args...)); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-*... |
google | android | decltype44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype44.C | 855 | utf_8 | 30af567d196c3316244215ca2ff212d7 | // PR c++/53307
// { dg-do compile { target c++11 } }
template <class...Ts> struct tuple{};
struct funct
{
template <class T, class...argTs>
T operator()(T arg1, argTs...)
{
return arg1;
}
};
template <class...>class test;
template < template <class...> class tp,
class...arg1Ts,
class...arg2Ts> ... |
google | android | initlist72 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist72.C | 428 | utf_8 | a92c5fb6a84d2db86bc3c1e4b73d2393 | // DR 1589
// { dg-require-effective-target c++11 }
#include <initializer_list>
struct Pair
{
Pair(const char *, const char *);
};
struct String
{
String(const char *);
};
void f1(int); // #1
int f1(std::initializer_list<long>); // #2
int g1() { return f1({42}); } // chooses #2
void f2(Pair); ... |
google | android | variadic148 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic148.C | 219 | utf_8 | 8d874e8495457ec0384a91c3b91e03a5 | // PR c++/59989
// { dg-require-effective-target c++11 }
template<typename T> struct X {};
template<template<typename...> class D, typename ...U> int test(D<U...>*);
int n = test<X, int>(0); // { dg-error "no match" }
|
google | android | variadic85 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic85.C | 294 | utf_8 | 793009938d69b542db9432a7cdac06f2 | // PR c++/32565
// { dg-do compile { target c++11 } }
template<typename...> struct A1;
template<template<int, int...> class T> struct A1<T<0, 1> > {};
template<int, int, int...> struct B1 {};
A1<B1<0, 1> > a1;
template<int...> struct B2 {};
A1<B2<0, 1> > a2; // { dg-error "incomplete type" }
|
google | android | vt-35331 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-35331.C | 166 | utf_8 | e3e82a31ef89508e7025df3539121b77 | // { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
{
friend void foo();
};
|
google | android | alias-decl-13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-13.C | 436 | utf_8 | e03936252459ddf6c4b90fd566a2462b | // Origin PR c++/51191
// { dg-do compile { target c++11 } }
template< class T >
class ClassTemplate {};
template< class T >
struct Metafunction {
typedef T type;
};
template< class T >
using TemplateAlias = ClassTemplate< typename Metafunction<T>::type >;
using Alias = TemplateAlias<int>;
template< class T >
vo... |
google | android | initlist11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist11.C | 210 | utf_8 | f787403dc64b99be9c0c9b763121c4d7 | // PR c++/38684
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct Y {};
struct X : Y {
X(std::initializer_list<int>) {}
};
struct A {
X v;
};
int main() {
A a{ {1,2,3} };
}
|
google | android | rv7n | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv7n.C | 3,626 | utf_8 | 7bce8052f934119289e8bf2b450da744 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test overload resolution among reference types
// { dg-do compile { target c++11 } }
// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
struct one {char x[1];};
struct two {char x[2];};
struct three {char x[3];};
... |
google | android | fntmpdefarg5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg5.C | 433 | utf_8 | addea0686f679f28f9e10317665cb558 | // Only print template subst context when it isn't redundant.
// { dg-require-effective-target c++11 }
// { dg-prune-output "error" }
template<class T> struct A { typedef typename T::type type; };
template <class T, class U = typename A<T>::type>
void f(T);
template <class T, class U = typename T::type>
void g(T);
... |
google | android | union1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/union1.C | 720 | utf_8 | 334c8dcebc42b37885e8f695c3285534 | // Negative test for C++11 unrestricted unions
// { dg-do compile { target c++11 } }
// { dg-prune-output "implicitly deleted because" }
struct A
{
A();
A(const A&);
~A();
};
union B
{
A a; // { dg-error "union member" }
};
B b; // { dg-error "B::B\\(\\)" "B::B" }
B b2(b); // { dg-error "B::B\\(const B&... |
google | android | variadic117 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic117.C | 204 | utf_8 | 523979f9335472cb7431b7565fc31f64 | // { dg-do compile { target c++11 } }
template <class T> struct A { typedef T type; };
template <template <class...> class T, class... U>
void f(typename T<U...>::type);
int main()
{
f<A,int>(42);
}
|
google | android | constexpr-targ | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C | 211 | utf_8 | a7f4af1fe8847d9c43e0d0d6095088b5 | // { dg-do compile { target c++11 } }
struct A
{
constexpr operator double() { return 1.0; }
};
template <int I>
struct B
{ };
constexpr A a { };
B<a> b; // { dg-error "template argument|invalid type" }
|
google | android | pr58155 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C | 99 | utf_8 | 10115e7416304bd9586633e7a175c150 | // { dg-do compile { target c++11 } }
#define BAZ "baz"
#if 0
"bar"BAZ
R"(
bar
)"BAZ
#endif
|
google | android | constexpr-empty5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-empty5.C | 109 | utf_8 | cf5dbf6e27520dc069362029f5cb0540 | // { dg-do compile { target c++11 } }
struct A { };
struct B: A { };
constexpr B b { };
constexpr A a = b;
|
google | android | noexcept21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept21.C | 1,030 | utf_8 | 2b6c095cbaee8a1afa6ee4b8efb3eca6 | // PR c++/57645
// { dg-do compile { target c++11 } }
struct Thrower
{
~Thrower() noexcept(false) { throw 1; }
};
struct ExplicitA
{
~ExplicitA() {}
Thrower t;
};
struct ExplicitB
{
~ExplicitB();
Thrower t;
};
ExplicitB::~ExplicitB() {}
struct ExplicitC
{
~ExplicitC() = default;
Thrower t;
};
str... |
google | android | constexpr-static6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C | 255 | utf_8 | 42418b7d4fc3d0403836f30dcf28c762 | // { dg-do compile { target c++11 } }
struct B
{
constexpr operator int() { return 4; }
};
template <int I>
struct C;
template<>
struct C<4> { typedef int TP; };
template <class T>
struct A
{
constexpr static B t = B();
C<t>::TP tp;
};
A<B> a;
|
google | android | constexpr-virtual4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual4.C | 230 | utf_8 | f3a7fc3332c19e012de9958a5131ac30 | // PR c++/56291
// { dg-do compile { target c++11 } }
class Base
{
public:
constexpr Base() : v(1) {};
int v;
};
class Derived : public Base
{
public:
constexpr Derived() : Base() {};
virtual void function();
};
Derived d;
|
google | android | defaulted14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted14.C | 471 | utf_8 | 1fe1d202d10e929f1013c9c6ed12d4c9 | // PR c++/39866
// { dg-do compile { target c++11 } }
struct A {
A& operator=(const A&) = delete; // { dg-bogus "" }
void operator=(int) {} // { dg-message "" }
void operator=(char) {} // { dg-message "" }
};
struct B {};
int main()
{
A a;
a = B(); // { dg-error "no match" }
// { dg-message "candidate"... |
google | android | decltype-38655 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C | 101 | utf_8 | 51bee11248b9515ebb07cbd465c4fc47 | // PR c++/38655
// { dg-options "" }
__decltype(0r)* p = 1; // { dg-error "not supported|invalid" }
|
google | android | enum18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum18.C | 156 | utf_8 | 2385f2d89aa76808f9f39a25dbe3f34d | // PR c++/47277
// { dg-do compile { target c++11 } }
int main(void) {
enum e {};
e ev;
ev.e::~e_u(); // { dg-error "e_u. has not been declared" }
}
|
google | android | pr59111 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr59111.C | 190 | utf_8 | 91fd57600ae1f1e9e0fb675962816f3e | // PR c++/59111
// { dg-do compile { target c++11 } }
auto& foo(); // { dg-error "type specifier without trailing return type" "" { target { ! c++1y } } }
int i = foo(); // { dg-error "" }
|
google | android | constexpr-ex4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ex4.C | 207 | utf_8 | de9e38fddd0b0bbca44b6fb966270607 | // { dg-do compile { target c++11 } }
struct A
{
constexpr A(int) { }
constexpr operator int() { return 1; };
};
template <class T>
struct B
{
static constexpr A a = A(1);
int ar[a];
};
B<int> b;
|
google | android | explicit4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit4.C | 325 | utf_8 | 78a870d7c119678bc51bd737c08f8f2d | // Negative explicit conv test.
// { dg-do compile { target c++11 } }
struct A {
A(const A&, int = 0); // { dg-message "note" }
};
struct B
{
explicit operator A();
};
int main()
{
B b;
(A(b)); // OK
(A(b,1)); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16... |
google | android | constexpr-56302 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-56302.C | 210 | utf_8 | 8e53de6c9b1d404bae439167b0aedfa6 | // PR c++/56302
// { dg-do compile { target c++11 } }
// { dg-options "-O0" }
constexpr int foo () { return 42; }
constexpr int x = foo () + 2;
void
bar ()
{
__asm ("" : : "n" (x), "n" (foo () * 7 + x));
}
|
google | android | initlist79 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist79.C | 145 | utf_8 | 11f7b1bf623dafb7980bb254a51eb178 | // PR c++/59646
// { dg-require-effective-target c++11 }
#include <initializer_list>
struct A {};
std::initializer_list<volatile A> x = {{}};
|
google | android | initlist-ctor1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-ctor1.C | 246 | utf_8 | 994605127bf908d7a5b9745b9991101e | // PR c++/52905
// { dg-do compile { target c++11 } }
#include <initializer_list>
enum E { e1, e2 };
struct A
{
A(std::initializer_list<E>); // { dg-message "A::A" }
A(int, E); // { dg-message "A::A" }
};
A a{e1,2}; // { dg-error "" }
|
google | android | initlist80 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist80.C | 124 | utf_8 | f4e51372ebce70d4e70fe4c30c9c5df3 | // PR c++/60051
// { dg-require-effective-target c++11 }
#include <initializer_list>
auto x[2] = {}; // { dg-error "" }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.