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 | constexpr-ice11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice11.C | 147 | utf_8 | 6fb859413d652871f2a4863877abcab0 | // PR c++/58610
// { dg-do compile { target c++11 } }
struct A
{
template<typename> A();
};
constexpr A a; // { dg-error "literal|matching" }
|
google | android | initlist41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist41.C | 227 | utf_8 | d055d06050168ce8a453433e12edbe40 | // PR c++/44703
// { dg-do compile { target c++11 } }
#include <initializer_list>
typedef std::initializer_list<int> type ;
void f(type) {}
int main()
{
// error: could not convert '{1, 2, 3}' to 'type'
f({1,2,3}) ;
}
|
google | android | constexpr-static4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static4.C | 205 | utf_8 | c75a35a6482a003b532401a29c58bf6e | // { dg-do run { target c++11 } }
extern "C" void abort ();
extern int ar[2];
int f()
{
if (ar[0] != 42 || ar[1] != 0)
abort ();
return 1;
}
int i = f();
int ar[2] = { 42, i };
int main()
{
}
|
google | android | trailing9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing9.C | 144 | utf_8 | 5bd7d763156f09225be67ac942ecf179 | // PR c++/56646
// { dg-require-effective-target c++11 }
struct A {
void f();
};
void A::f() {
struct B {
auto g() -> void { }
};
}
|
google | android | udlit-namespace | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-namespace.C | 642 | utf_8 | b8dd562d9fa4097d45afc195d68afb59 | // { dg-do run { target c++11 } }
// Test user-defined literals.
// Test simple operator declaration and definition in namespaces.
#include <cmath>
#include <limits>
namespace Long
{
long double operator"" _LL(long double);
}
namespace Short
{
short
operator"" _SS(long double x)
{ return std::fmod(x, static... |
google | android | auto26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto26.C | 208 | utf_8 | 6a57404450d7c19ecf1c90ef718482e5 | // PR c++/43321
// { dg-do compile { target c++11 } }
template <class T>
void f(T t)
{
auto *p = t;
}
template <class T>
void g(const T& tr)
{
auto p = *tr;
}
int main()
{
int b;
f(&b);
g(&b);
}
|
google | android | gen-attrs-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C | 527 | utf_8 | 4be5538ac4364de53c2b5a38ab5c0137 | // { dg-options "-Wunused -pedantic-errors" }
// { dg-do compile { target c++11 } }
// Test for syntax support of various attribute permutations.
int
[[noreturn]] // { dg-warning "ignored" }
one
[[gnu::unused]]
(void);
int one_third [[noreturn]] [[gnu::unused]] (void);
int [[gnu::unused]] one_half(); // { dg-warning... |
google | android | nullptr14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr14.C | 522 | utf_8 | 212cc29fbbd45ba2d4e81e9958232cfc | // { dg-do compile { target c++11 } }
// Test overload preference char*/int
template <typename T, typename U> struct tType_equal;
template <typename T> struct tType_equal<T, T> { typedef void type; };
template <typename T, typename U>
inline typename tType_equal<T, U>::type
type_equal(U) { }
char* f( char* );
int f... |
google | android | variadic39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic39.C | 308 | utf_8 | 5b5e4cc3907d08ca4401fb9e0aef12a0 | // { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple {};
template<typename T, typename... Args>
struct tuple<Args..., T> { }; // { dg-error "end" }
template<int... Values>
struct int_vec { };
template<int I, int... Values>
struct int_vec<Values..., I> { }; // { dg-error "end" }
|
google | android | constexpr-function3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C | 541 | utf_8 | 9a0e6faefe14993813350141fd5d9051 | // { dg-do compile { target c++11 } }
// From N2235
// function template 1
template<typename T>
constexpr int bytesize(T t)
{ return sizeof (t); } // OK
char buf[bytesize(0)]; // OK -- not C99 VLA
// function template 2
template<typename _Tp>
constexpr _Tp
square(_Tp x) { return x; }
// Ex... |
google | android | udlit-string-length | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-string-length.C | 1,030 | utf_8 | 9c9fee688efa3e86728f22643211f65a | // { dg-do compile { target c++11 } }
// PR c++/50941
typedef decltype(sizeof(0)) size_type;
constexpr size_type
operator"" _len(const char*, size_type len)
{
return len;
}
constexpr size_type
operator"" _len(const wchar_t*, size_type len)
{
return len;
}
constexpr size_type
operator"" _len(const char16_t*, siz... |
google | android | nullptr02 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr02.C | 358 | utf_8 | fcc799cee7059e225863da99315d2210 | // { dg-do compile { target c++11 } }
// Test assignment to nullptr_t
typedef decltype(nullptr) nullptr_t;
const nullptr_t np1 = nullptr;
const nullptr_t np2 = __null;
const nullptr_t np3 = 0;
const nullptr_t np4 = np1;
const nullptr_t np5 = np2;
const nullptr_t np6 = np3;
const nullptr_t np7 = np4;
const nullptr_t ... |
google | android | decltype50 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype50.C | 550 | utf_8 | 8810f6bbc84341fd20f6e137874c4b1a | // PR c++/52597
// { dg-require-effective-target c++11 }
struct A {
int zip();
decltype(zip) bar0; // { dg-error "invalid use of non-static member function" }
void bar1() {
typedef decltype(this->A::zip) x; // { dg-error "invalid use of non-static member function" }
}
void bar2() {
typedef de... |
google | android | udlit-member-neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C | 417 | utf_8 | 276f0d44a9bde7760407a8ca569c5755 | // { dg-do compile { target c++11 } }
class Foo
{
public:
Foo() { }
int operator"" _Bar(char32_t); // { dg-error "must be a non-member function" }
};
int i = operator"" _Bar(U'x'); // { dg-error "was not declared in this scope" }
int j = U'x'_Bar; // { dg-error "unable to find character literal operator" }
in... |
google | android | constexpr-template1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template1.C | 472 | utf_8 | c715cc77c59c08b4178c8df94944f49a | // PR c++/50248, DR 1358
// { dg-do compile { target c++11 } }
template<class Elt, unsigned max>
struct earray
{
Elt elts[max];
earray() = default;
template<typename... Elt2>
constexpr earray(Elt2&& ... e): elts(0) { }
};
struct SessionData
{
SessionData(SessionData&) = delete;
SessionData() =... |
google | android | explicit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit1.C | 927 | utf_8 | 4832f2785046f753a4492ac893cbed61 | // Test for explicit conversion ops from N2437.
// { dg-do compile { target c++11 } }
class U; class V;
class T
{
public:
T( U const & );
//implicit converting ctor
explicit T( V const & );
// explicit ctor
};
class U
{
};
class V
{
};
class W
{
public:
operator T() const;
};
class X
{
public:
explicit ope... |
google | android | implicit5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit5.C | 384 | utf_8 | c6e522c14d7f62c7687265e903bda92e | // Test that the default B copy constructor calls the deleted A
// copy constructor.
// { dg-do compile { target c++11 } }
struct A // { dg-message "declares a move" }
{
A() = default;
A(A&&) = default;
template <class T>
A(const T& t) { t.i; }
};
struct B: A { }; // { dg-error "implicitly|use of deleted" ... |
google | android | defaulted23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted23.C | 408 | utf_8 | 6dbf09c3bc0f9455a25aadfc19770b3f | // Test for checking of exception specifications on defaulted fns
// { dg-do compile { target c++11 } }
struct A
{
A() noexcept = default;
};
A a;
struct B
{
B() throw (int) = default; // { dg-message "exception-specification" }
};
B b; // { dg-error "deleted" }
struct C
{
C() throw (int) { }
};
C c;
st... |
google | android | defaulted5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted5.C | 228 | utf_8 | f850ce13cb38dd65e14979303082c6cf | // PR c++/37234
// { dg-do link { target c++11 } }
template <typename T>
class foo {
public:
foo() =default;
~foo();
};
template <typename T>
foo<T>::~foo() =default;
int main() {
foo<int> fi;
return 0;
}
|
google | android | implicit-trivial1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C | 513 | utf_8 | 93f98598fdd0806e380633f9cfdb15e9 | // PR c++/46807
// { dg-do compile { target c++11 } }
// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
// even though doing overload resolution would mean calling the template
// constructor. In C++11, we do overload resolution to determine triviality.
struct A
{
A() {}
private:
templa... |
google | android | initlist-value2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-value2.C | 314 | utf_8 | fab23eb9efdcf1b8c0f8393aa5ad7913 | // Test that we properly value-initialize a class with a user-provided
// constructor but defaulted default constructor. The FDIS got this
// wrong; see c++std-core-19883.
// { dg-do run { target c++11 } }
struct A
{
int i;
A() = default;
A(int);
};
int main()
{
A a{};
if (a.i != 0)
return 1;
}
|
google | android | implicit7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit7.C | 580 | utf_8 | 7cb0b27f443e3579b5a06a7d2c6024ec | // PR c++/44909
// { dg-do compile { target c++11 } }
// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>,
// which means choosing a ctor for C<B<E>>, which meant considering
// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing
// a ctor for A<D<E>>. Cycle.
template<typen... |
google | android | error6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error6.C | 270 | utf_8 | 225f7337cc65089cb4dbd094cb84c9c2 | // PR c++/48284
// { dg-do compile { target c++11 } }
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-message "decltype .c\\.f" }
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-error "decltype .c\\.f" }
|
google | android | error1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error1.C | 243 | utf_8 | 690ef4d51c0bd47dc17b9270913d2838 | // PR c++/34395
// { dg-do compile { target c++11 } }
template<int... N> void foo (int... x[N]) // { dg-message "int \\\[N\\\]\\.\\.\\. x" }
{
struct A
{
A () { x; } // { dg-error "use of parameter from containing function" }
};
}
|
google | android | trailing1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing1.C | 2,175 | utf_8 | 1e260a414b39eb610b00bef01f161f8e | // Tests for late-specified return type.
// { dg-do compile { target c++11 } }
// { dg-options "-fabi-version=5" }
auto f() -> int
{
return 0;
}
template<class T, class U>
auto add(T t, U u) -> decltype (t+u)
{
return t+u;
}
template<class T, class U>
decltype(T()+U()) add2(T t, U u)
{
return t+u;
}
template ... |
google | android | gen-attrs-54 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-54.C | 423 | utf_8 | ca13ed21048782e55ad0ede2242369dc | // PR c++/56859
// { dg-require-effective-target c++11 }
template<unsigned size, unsigned alignment>
struct aligned_storage
{
using type = struct { alignas(alignment) unsigned char data[size]; };
};
#define SA(X) static_assert((X),#X)
SA(alignof(aligned_storage<8,1>::type) == 1);
SA(alignof(aligned_storage<8,2>::ty... |
google | android | alias-decl-29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-29.C | 152 | utf_8 | 5120e2fd361a42080484a502a94aaf1c | // Origin: PR c++/52343
// { dg-do compile { target c++11 } }
template<typename>
using A = int;
template<template<class> class>
struct B {};
B<A> b;
|
google | android | pr52440 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr52440.C | 352 | utf_8 | c547b0212a2847967a2e2169b6704dcb | // PR c++/52440
// { dg-do compile { target c++11 } }
template<bool>
struct V
{
typedef void type;
};
template<typename T>
struct X
{
template<typename>
static constexpr bool always_true()
{
return true;
}
template<typename U,
typename = typename V<always_true<U>()>::type>
X(U &&) {}
};
... |
google | android | initlist5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist5.C | 914 | utf_8 | 183e795572ccb885e18a0603b606b818 | // Test for narrowing diagnostics
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct A { int i; int j; };
A a2 { 1.2 }; // { dg-error "narrowing" }
A a1 { 1, 2 }; // aggregate initialization
struct B {
B(std::initializer_list<int>);
};
B b1 { 1, 2 }; // creates initializer_list<int> and calls... |
google | android | pr32252 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32252.C | 151 | utf_8 | fee88fa74a737885a8b333edaeadea5f | // { dg-do compile { target c++11 } }
int x[5];
template<int M, int N, int (&... p)[N]> struct A;
template<int M> struct A<M,5,x> {};
A<0,5,x> a;
|
google | android | pr47416 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr47416.C | 6,639 | utf_8 | de5bd9e7b6ec39ff73bf46962cdebe07 | // PR c++/47416
// { dg-do compile { target c++11 } }
namespace std
{
template < typename _Tp, _Tp __v > struct integral_constant
{
static const _Tp value = __v;
};
typedef integral_constant < bool, false > false_type;
template < typename > struct is_array:false_type
{
};
template < typename > ... |
google | android | constexpr-array-ptr6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr6.C | 500 | utf_8 | f31ece5b8af07663a50281d823199cdb | // { dg-do compile { target c++11 } }
typedef decltype(sizeof(char)) size_type;
template<class T, size_type N>
constexpr size_type size(T (&)[N]) { return N; }
double array_double[] = { 1.0, 2.0, 3.0 };
constexpr auto sz_d = size(array_double);
static_assert(sz_d == 3, "Array size failure");
void f(bool (¶m)[... |
google | android | deleted3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/deleted3.C | 149 | utf_8 | a9129f4cd34b93dbe745e3849ea1c38a | // PR c++/60216
// { dg-require-effective-target c++11 }
struct A
{
template<typename T> A(T) = delete;
};
template<> A::A<int>(int) {}
A a(0);
|
google | android | pr51786 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr51786.C | 230 | utf_8 | 006d87b23cd105761e4063f76e1d51c8 | // PR c++/51786
// { dg-do compile { target c++11 } }
enum E {};
struct A {};
void foo() { decltype(E{}); } // { dg-error "does not declare anything" }
void bar() { decltype(A{}); } // { dg-error "does not declare anything" }
|
google | android | inh-ctor19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor19.C | 211 | utf_8 | 9cc8ea19fcf452b5c5ba972b6d410b07 | // PR c++/60389
// { dg-do compile { target c++11 } }
struct A
{
template<typename...T> A(T...) {}
};
struct B : A
{
using A::A; // { dg-error "inherited" }
};
constexpr B b; // { dg-error "literal" }
|
google | android | alias-decl-38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-38.C | 1,960 | utf_8 | f975ac9998c2bbb6bd93859a77635b15 | // PR c++/58435
// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct same { static const bool value = false; };
template<typename T>
struct same<T, T> { static const bool value = true; };
template <template <typename> class F, typename T> struct apply
{ typedef F<T> type; };
template <templat... |
google | android | variadic63 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic63.C | 108 | utf_8 | 97a9704141740712fd031adf9ea4a9e2 | // { dg-options "-pedantic" }
// { dg-do compile { target c++11 } }
template<typename... Args> class tuple;
|
google | android | gen-attrs-47-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-47-1.C | 149 | utf_8 | 7b4e526ee8108f3100a358dd702343b1 | // { dg-do compile { target c++11 } }
int
foo ()
{
int i [[and, bitor, xor_eq, compl, bitand]]; // { dg-warning "ignored" }
i = 0;
return i;
}
|
google | android | variadic80 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic80.C | 499 | utf_8 | 778f1c35326931ee353b1fc4b16bd673 | // PR c++/31434
// { dg-do run { target c++11 } }
extern "C" void abort ();
template<typename... T> inline int foo (const T...) { return 1; }
template<typename... T> inline int foo (const T *...) { return 2; }
void
bar (int *a)
{
a[0] = foo (0);
a[1] = foo (*a);
a[2] = foo<int> (a);
a[3] = foo<int> (2, 3, 4,... |
google | android | constexpr-array-ptr8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr8.C | 1,092 | utf_8 | 2802ca42ee9d91cfb21c5e02dcf35ba4 | // PR c++/57047
// { dg-require-effective-target c++11 }
template <typename>
struct A;
template <typename T>
struct A <T &>
{
typedef T type;
};
template <typename T>
constexpr T && foo (typename A <T>::type & __t) noexcept
{
return static_cast <T &&>(__t);
}
template <class T1, class T2>
struct B
{
T1 t1;
T2 ... |
google | android | constexpr-initlist | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist.C | 1,335 | utf_8 | 54938bcbb9808e5e9cf6a19cfdf8ef6d | // { dg-do run { target c++11 } }
namespace xstd {
typedef decltype(sizeof(char)) size_t;
template<class E>
class initializer_list {
private:
size_t sz;
const E* start;
public:
typedef E value_type;
typedef const E& reference;
typedef const E& const_reference;
typedef size_t size_type;
typedef const E* i... |
google | android | range-for6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for6.C | 441 | utf_8 | bf09a13cfe61445a898ea383c44bc795 | // Test for range-based for loop
// Test the loop with an initializer_list
// { dg-do run { target c++11 } }
#include <initializer_list>
extern "C" void abort();
template<typename T> T foo()
{
T sum = 0;
for (T x : {T(1),T(2),T(3),T(4)})
sum += x;
if (sum != T(10))
abort();
}
int main()... |
google | android | enum10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum10.C | 131 | utf_8 | 239bcda977968c64660c02c29c92dd44 | // PR c++/48534
// { dg-do compile { target c++11 } }
enum class OpSE : bool;
int main()
{
return static_cast<bool>(OpSE());
}
|
google | android | udlit-raw-op-string-neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-raw-op-string-neg.C | 262 | utf_8 | c0bba2c546aa3f650d69e738211a7b4e | // { dg-do compile { target c++11 } }
// Make sure handing a string to a raw literal generates a sensible error message.
int operator"" _embedraw(const char*)
{ return 41; }
int k = "Boo!"_embedraw; // { dg-error "unable to find string literal operator" }
|
google | android | pr33996 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr33996.C | 629 | utf_8 | 71d9f5e83b8c5cb685bd17eef206a7b1 | // { dg-do compile { target c++11 } }
#define BUG
struct type
{
type() { }
type(const type&) { }
private:
type(type&&);
};
template<typename _Tp>
struct identity
{
typedef _Tp type;
};
template<typename _Tp>
inline _Tp&&
forward(typename identity<_Tp>::type&& __t)
{ return __t; }
struct vec
{
te... |
google | android | constexpr-pedantic | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-pedantic.C | 418 | utf_8 | 9b22329501cdc0c04eb177944b0b9482 | // The FCD doesn't allow typedefs and static_assert in constexpr functions,
// but it should.
// { dg-do compile { target c++11 } }
// { dg-options "-pedantic" }
template <class T>
constexpr T f(T t)
{
typedef T T2; // { dg-warning "constexpr" "" { xfail *-*-* } }
static_assert (T2(0) == T(0), ""); // { dg-... |
google | android | initlist28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist28.C | 123 | utf_8 | 409f1edeecc2d94cbbf54fc7a0255cd4 | // PR c++/42060
// { dg-do compile { target c++11 } }
void foo()
{
int a[1];
throw a = {}; // { dg-error "assign" }
}
|
google | android | sfinae49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae49.C | 517 | utf_8 | 07a6e388376959abb699902ddf79cfaa | // PR c++/58932
// { dg-do compile { target c++11 } }
using nullptr_t = decltype(nullptr);
template<typename T, typename Sfinae = nullptr_t>
struct B {
static float& int_if_addable();
};
template<typename T>
struct B<T, decltype( (T() + T()), nullptr )> {
static int& int_if_addable();
};
struct X { };
stru... |
google | android | variadic-unify-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-unify-2.C | 326 | utf_8 | 9cf2b1705ed83cc74a8a4b9eb2703186 | // Origin: PR c++/40155
// { dg-do compile { target c++11 } }
template <typename T> struct identity
{ typedef T type; };
template <typename RT, typename... A>
int forward_call(RT (*) (A...), typename identity<A>::type...);
int g (double);
int i = forward_call(&g, 0); |
google | android | decltype37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype37.C | 346 | utf_8 | 3869d95e391dba45b73631274c1ea985 | // PR c++/53651
// { dg-do compile { target c++11 } }
template<typename> struct wrap { void bar(); };
template<typename T> auto foo(T* t) -> wrap<T>* { return 0; }
template<typename T>
struct holder : decltype(*foo((T*)0)) // { dg-error "class type" }
{
using decltype(*foo((T*)0))::bar; // { dg-error "is not a b... |
google | android | decltype27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype27.C | 135 | utf_8 | 36fe3ea3f2239bc457e9ecfbbf2b8b79 | // PR c++/48617
// { dg-do compile { target c++11 } }
template<class T, decltype(T())> // #
struct A {};
A<int, 0> a;
int main() {}
|
google | android | forw_enum1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum1.C | 761 | utf_8 | 345ce7592fe1c32e330c2d3d26949440 | // { dg-do compile { target c++11 } }
// 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 : int;
enum class E3 : short;
enum E4 : int;
enum E5 : short;
// are complete so we can declare variables
E1 b1;... |
google | android | initlist1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist1.C | 1,015 | utf_8 | bc81668e2b4c77a6a8c52350eb5f9bc7 | // Basic uses of initializer lists
// { dg-do run { target c++11 } }
#include <initializer_list>
extern "C" void abort();
using namespace std;
struct A { int i,j; A(int _i,int _j): i(_i), j(_j) {} };
struct B { A a; B(A _a): a(_a) {} };
struct C { B b; C(B _b): b(_b) {} };
struct D
{
int ia[3];
D (initializer_... |
google | android | gnu_fno-ext-numeric-literals | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gnu_fno-ext-numeric-literals.C | 3,154 | utf_8 | 2e2788f974b88f56ceecc2b764d701db | // { dg-do compile { target c++11 } }
// { dg-options "-fno-ext-numeric-literals" }
// Integer imaginary...
constexpr unsigned long long
operator"" i(unsigned long long n)
{ return 4 * n + 0; }
constexpr unsigned long long
operator"" I(unsigned long long n)
{ return 4 * n + 1; }
constexpr unsigned long long
operat... |
google | android | initlist74 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist74.C | 140 | utf_8 | a24ee93bb483567fad2912fb15cba6a3 | // Core 1591
// { dg-require-effective-target c++11 }
template<class T, int N> void g(T const (&)[N]);
void f() {
g( { 1, 2, 3, 4 } );
}
|
google | android | dc3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/dc3.C | 883 | utf_8 | 6d0686aef8f8f3d43ec6437c137f6981 | // { dg-do compile { target c++11 } }
struct X {};
struct B {
int i;
B (int _i) : i(_i) { }
~B () { i = 0; }
};
template <typename T>
struct A : public B {
A () : B(-1) { }
~A () { }
};
template <typename T>
struct A<T*> : public B {
A () : B(-1) { }
A (int i) : A() { }
A (double b) : A(static_cast<int>(b))... |
google | android | vt-34314 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34314.C | 1,036 | utf_8 | a1d7f004c19aa3a12e38f5297813d69b | // { dg-do compile { target c++11 } }
template<typename Fun, typename... Args> // { dg-error "template parameter" }
struct call;
template<typename Fun, typename Arg0>
struct call // { dg-error "redeclared here" }
{
template<typename Sig>
struct result;
template<typename X, typename Y>
struct result<X... |
google | android | template_deduction | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/template_deduction.C | 1,897 | utf_8 | 3b5dc721d5f8945d257645537b85505e | // I, Howard Hinnant, hereby place this code in the public domain.
// Test the "Augmented" template argument deduction when binding an lvalue to an rvalue reference.
// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
template <class T, T v>
struct integral_constant
{
s... |
google | android | initlist58 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist58.C | 176 | utf_8 | 21abf49cfab42d1df0edb368b7c3e50b | // PR c++/50209
// { dg-do compile { target c++11 } }
struct S { int i,j; };
struct A
{
static void f (S = {1,2});
};
void f (S = {3,4});
int main()
{
A::f();
f();
}
|
google | android | vt-34055 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34055.C | 679 | utf_8 | 4a8e3b3c1d8bd7cd10c6f69585e8d8eb | // { dg-do compile { target c++11 } }
// PR c++/34055
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "parameter packs|T" }
{
void foo();
};
template<typename...T> void A<T*>::foo() {} // { dg-error "invalid declarator" }
template<typename...> struct B;
template<typename...T> s... |
google | android | dc2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/dc2.C | 463 | utf_8 | 2316af8e56dcf8aca79100a06b89fffa | // { dg-do compile { target c++11 } }
struct A {
int i, j;
A () : A(0), j(0) { } // { dg-error "constructor delegation" }
A (int _i) : i(_i) { }
};
struct B {
int i, j;
B () : i(0), B(0) { } // { dg-error "constructor delegation" }
B (int _j) : j(_j) { }
};
struct C {};
struct D : public C {
D () : C() { }
... |
google | android | pr31439 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31439.C | 269 | utf_8 | 0dbfedc985dcf70e6e880ca2fd977d00 | // { dg-do compile { target c++11 } }
template<typename...> struct A;
template<char> struct A<> {}; // { dg-error "not deducible|anonymous|declaration" }
template<typename T, typename... U> struct A<T, U...> : A<U...> {}; // { dg-error "incomplete type" }
A<int> a;
|
google | android | constexpr-ice5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice5.C | 173 | utf_8 | d5945150e3038eedad0a850dff4851e1 | // PR c++/51621
// { dg-do compile { target c++11 } }
struct A
{
A() {}
};
struct B
{
A a[1];
constexpr B() : a() {} // { dg-error "non-constant|non-constexpr" }
};
|
google | android | sfinae30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae30.C | 443 | utf_8 | 9acb42ea3f0f87eb29b3394b89b600d9 | // { dg-do compile { target c++11 } }
template <class... T> struct tuple;
template <class T> struct tuple<T> { T t; };
template <class T, class U> struct pair;
template<> struct pair<int,double> { };
template <class... Ts>
struct A
{
template <class... Us,
class V = tuple<pair<Ts,Us>...> >
static voi... |
google | android | enum14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum14.C | 151 | utf_8 | 79aba4eac5026d1a15e09c3559aaa681 | // PR c++/48106
// { dg-do compile { target c++11 } }
enum class E : char
{
e
};
bool operator&(E e, char m)
{
return static_cast<int>(e) & m;
}
|
google | android | constexpr-array-ptr | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr.C | 302 | utf_8 | d184daf58a1efefa9b5d9f2675332595 | // { dg-do compile { target c++11 } }
template<class T>
constexpr T do_get(T* x, int n) {
return x[n - 1];
}
template<class T, int N>
constexpr T get(T (&x)[N]) {
return do_get(x, N);
}
constexpr int arr_i[] = {1};
constexpr auto var = get(arr_i); // #2
static_assert(var == arr_i[0], "Error");
|
google | android | enum23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum23.C | 203 | utf_8 | 1fce61041d5fe27ecb76803d5fe4e086 | // PR c++/51242
// { dg-do compile { target c++11 } }
enum class MyEnum { A = 1 };
struct MyClass
{
MyEnum Field1 : 3; // { dg-bogus "warning: 'MyClass::Field1' is too small" "" { xfail *-*-* } }
};
|
google | android | decltype28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype28.C | 454 | utf_8 | 13eecdeee960674b7d00537b857a0a31 | // PR c++/44175
// { dg-do compile { target c++11 } }
template <bool, class T> struct enable_if { };
template <class T> struct enable_if <true, T> { typedef T type; };
template <class F, int N>
void ft (F f, typename enable_if<N!=0, int>::type) {}
template< class F, int N >
decltype(ft<F, N-1> (F(), 0)) // { dg-erro... |
google | android | constexpr-explicit-inst | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-explicit-inst.C | 299 | utf_8 | 54953d2c31360e2eeefa3305044bd360 | // { dg-do compile { target c++11 } }
template<class T> constexpr inline T bar(T x) { return x; }
template short bar(short x); // #EI
constexpr auto yz = bar(0); // OK
constexpr auto ab = bar(short()); // #1 Error, but should be OK
constexpr auto mn = bar(short{}); // #2 Error, but should be OK
|
google | android | variadic34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic34.C | 262 | utf_8 | d2e705d9f1219e15107bd104bcaed23f | // { dg-do compile { target c++11 } }
template<int I, typename... Args>
void get_ith(const Args&... args);
void f()
{
get_ith<1>(1, 2, 3);
get_ith<1, int>(1, 2.0, 'x');
get_ith<1, int, double>(1, 2.0, 'x');
get_ith<1, int, double, char>(1, 2.0, 'x');
}
|
google | android | inh-ctor9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C | 197 | utf_8 | ec9b8f74c4220a07771e91a84c8311aa | // { dg-do compile { target c++11 } }
class A
{
int i;
protected:
A(int i): i(i) {}
};
struct B: A
{
using A::A; // { dg-error "protected" }
};
B b(42); // { dg-error "this context" }
|
google | android | forw_enum2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum2.C | 899 | utf_8 | 88ce88296a2ec531e4cd30c6840d0e0b | // { dg-do compile { target c++11 } }
struct S1
{
struct 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 : int;
... |
google | android | auto15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto15.C | 248 | utf_8 | 2d114d946a7ebad1d7647106cb8403f6 | // { dg-do compile { target c++11 } }
template< typename Fn > struct function;
template< typename Result, typename ... ArgTypes >
struct function< auto (ArgTypes...)->Result > {
};
int main()
{
function< auto(double)->int > y;
return 0;
}
|
google | android | variadic102 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic102.C | 248 | utf_8 | 84aabd8e9e1df8f148f869596c49e721 | // { dg-do compile { target c++11 } }
struct nAny {
template<class... T>
nAny(T&&...);
};
template<class T>
T&& create();
template<class T, class... Args>
void test() {
T t(create<Args>()...);
(void) t;
}
int main() {
test<nAny>();
}
|
google | android | initlist84 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C | 215 | utf_8 | e19590cab587582486b601d5b4135a2e | // PR c++/61242
// { dg-do compile { target c++11 } }
struct Foo
{
struct A
{
const int &container;
const int &args;
};
static void Create (const A &);
};
int main ()
{
Foo::Create ({{}, {}});
}
|
google | android | variadic101 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic101.C | 381 | utf_8 | 9d9ee7aaa467f492c2292179fe2acd9a | // PR c++/43382
// { dg-do compile { target c++11 } }
template<class T>
struct Container
{ T f() const; };
template<class T>
T deref(const T& t)
{ return t; }
template <class T, class... Args>
auto
deref(const T& u, int r, Args... args)
-> decltype(deref(u.f(), args...))
{ return deref(u.f(), args...); }
int main(... |
google | android | pr60047 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60047.C | 215 | utf_8 | 3d0500d1d666af43dc6c0f875f02c205 | // PR c++/60047
// { dg-do compile { target c++11 } }
struct B { };
template<typename T> struct A : virtual B
{
A();
A(const A&);
};
template<typename T> A<T>::A(const A<T>&) = default;
A<int> a = A<int>();
|
google | android | constexpr-template7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C | 554 | utf_8 | fac54481719d52997e799f9f5944ce10 | // PR c++/61556
// { dg-do compile { target c++11 } }
class ValueType {
public:
constexpr operator int() const {return m_ID;};
constexpr ValueType(const int v)
: m_ID(v) {}
private:
int m_ID;
};
class ValueTypeEnum {
public:
static constexpr ValueType doubleval = ValueType(1);
};
template <in... |
google | android | gen-attrs-49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-49.C | 458 | utf_8 | af659da27b3437d4d48c98262c93429f | // { dg-do compile { target c++11 } }
typedef char layout_type;
template<class> struct A {
layout_type member alignas (double);
};
static_assert (alignof (A<int>) == alignof (double),
"alignment of struct A must be alignof (double)");
template<class> struct alignas (alignof (long double)) B {
layout_typ... |
google | android | variadic143 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic143.C | 1,220 | utf_8 | 493aa152178c6408c810da58cde4a4cd | // PR c++/56782
// { dg-do compile { target c++11 } }
template<class T>
T&& declval();
struct is_convertible_impl {
template<class T>
static void sink(T);
template<class T, class U, class = decltype(sink<U>(declval<T>()))>
static auto test(int) -> char;
template<class, class>
static auto test(...) -> ch... |
google | android | gen-attrs-38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-38.C | 193 | utf_8 | bb1fc6dd579b1a618936a4dadc14db97 | // { dg-do compile { target c++11 } }
// PR c++/36625
template <int N>
struct A {
struct S { short f[3]; } [[gnu::aligned (N)]]; // { dg-warning "ignored" }
};
int main ()
{
A<4>::S s;
}
|
google | android | constexpr-synth1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C | 145 | utf_8 | e5015fd9f0623f977ee75ae8cbde2169 | // PR c++/46472
// { dg-do compile { target c++11 } }
template<class T> struct A {
T t;
constexpr A(){}
};
struct B
{
A<int> a;
};
B b;
|
google | android | initlist81 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist81.C | 366 | utf_8 | 02ef88866a33af3b82367f920d4380ba | // PR c++/60713
// { dg-options "-O" }
// { dg-do compile { target c++11 } }
template < class x0, class x1, class x2, class x3, class x4 >
int *x5 (x0 *, x2 (x1::*)(x3, x4));
class x6
{
void x7 ();
struct x8
{
int *x9;
};
void x10 (x8);
void x11 (int *, int *);
};
void
x6::x7 ()
{
... |
google | android | sfinae11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae11.C | 1,198 | utf_8 | 8a46b9e2d8209e6ef46545bf5ca8ac92 | // PR c++/48468
// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
template<class T>
T&& declval() noexcept;
template< class T >
inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error "Z" }
{
x.foo();
}
template< class T,
bool Noexcept = noexcept( declval<T&>().foo() ) ... |
google | android | variadic144 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic144.C | 313 | utf_8 | f6a4eb51424f9635fa1af33258378276 | // PR c++/56060
// { dg-do compile { target c++11 } }
template<typename T> struct baz { };
template<typename T> T bar();
template<typename T, typename ... U>
baz<decltype(bar<T>()(bar<U> ...))> // { dg-error "cannot be used" }
foo();
int main()
{
foo<int>(); // { dg-error "no matching" }
return 0;
}
|
google | android | noexcept20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept20.C | 264 | utf_8 | ac7acbf5f862552298b34e84a650d5fa | // PR c++/56071
// { dg-do compile { target c++11 } }
class B
{
template <typename T> friend struct A;
B() {}
};
template <typename T>
struct A
{
A() noexcept(noexcept(B())) { }
};
struct C
{
C()
{
static_assert( !noexcept(A<int>()), "" );
}
};
|
google | android | constexpr-neg2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-neg2.C | 1,025 | utf_8 | e02963b07b48f6e88a5b755a616555ce | // PR c++/54020
// { dg-do compile { target c++11 } }
// Preliminaries.
extern int nonconst_func(int);
constexpr int identity(int x) { return x; }
constexpr int zero() { return identity(0); }
constexpr int one() { return identity(1); }
// Correctly accepted.
constexpr int three = one() ? 3 : nonconst_func(0);
// Inc... |
google | android | nsdmi-template13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C | 129 | utf_8 | b10aa26824c27a87b56ae1ff32b2a84b | // PR c++/58704
// { dg-do compile { target c++11 } }
struct A {};
template<typename> struct B
{
A a[1] = { };
};
B<int> b;
|
google | android | variadic67 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic67.C | 521 | utf_8 | 075eca9dd35fe91d9cca94cbab0d92a3 | // { dg-do compile { target c++11 } }
template<typename... Elements> struct tuple {};
template<typename... Args>
struct nested
{
typedef tuple<tuple<Args, Args...>...> type;
};
template<typename T, typename U>
struct is_same
{
static const bool value = false;
};
template<typename T>
struct is_same<T, T>
{
stat... |
google | android | override2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/override2.C | 1,495 | utf_8 | a950814416d6ad7c214b0f29a4e57f54 | // { dg-do compile { target c++11 } }
struct B1 {};
struct B2 final {};
struct D1 : B1 {};
struct D2 : B2 {}; // { dg-error "cannot derive from 'final' base" }
template<class T> struct D3 : T {};
template<class T> struct D4 : T {}; // { dg-error "cannot derive from 'final' base" }
template <class T> struct B3 {};... |
google | android | static_assert5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert5.C | 263 | utf_8 | b6e1adef2dde113019ef4fea0f82078b | // PR c++/50837
// { dg-do compile { target c++11 } }
template<class T>
struct z
{
static constexpr bool test_constexpr()
{
return true;
}
static void test()
{
static_assert(test_constexpr(), "test1");
}
};
int main()
{
z<int>::test();
}
|
google | android | gen-attrs-39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-39.C | 187 | utf_8 | 1e9f1592b1b32cddbd98886cee9b568e | // PR debug/43370
// { dg-do compile { target c++11 } }
// { dg-options "-g" }
int fragile_block(void) {
typedef struct [[gnu::aligned (16)]] {
int i;
} XmmUint16;
return 0;
}
|
google | android | sfinae3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae3.C | 1,421 | utf_8 | 684ba6205f16695fb2f402ff1efc2257 | // { dg-do compile { target c++11 } }
namespace std { template <class T> T&& declval(); }
template<typename _Tp, typename... _Args>
class is_constructible_mini
{
typedef char __one;
typedef struct { char __arr[2]; } __two;
template<typename _Tp1, typename... _Args1>
static decltype(::new _Tp1(s... |
google | android | alias-decl-16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-16.C | 598 | utf_8 | c747526d52aa9bf869b525c87736e63b | // Origin PR c++/51143
// { dg-do compile { target c++11 } }
using A0 = struct B0 { void f() {} };
template<int N>
using A1 =
struct B1 { // { dg-error "types may not be defined in alias template" }
static auto constexpr value = N;
};
A1<0> a1;
template<class T>
using A2 =
struct B2 { // { dg-e... |
google | android | ref-qual2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual2.C | 1,496 | utf_8 | 17d77d3ef6cc0e1cfd53228f15a40017 | // In a .* expression whose object expression is an rvalue, the program is
// ill-formed if the second operand is a pointer to member function with
// ref-qualifier &. In a .* expression whose object expression is an
// lvalue, the program is ill-formed if the second operand is a pointer to
// member function with ref-... |
google | android | reference_collapsing | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/reference_collapsing.C | 7,315 | utf_8 | 3d3c78a78484238b76f840d346c73307 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test the reference collapsing rules. Note that there are recent differences
// for how cv-qualifications are applied to reference types. 7.1.3, 14.3.1
// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true>... |
google | android | variadic153 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic153.C | 122 | utf_8 | dcf2e8b00c5683679b9562aeaff1d2f2 | // PR c++/58648
// { dg-require-effective-target c++11 }
template<int, typename...T, T...> int foo();
int i = foo<0>();
|
google | android | traits1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/traits1.C | 2,687 | utf_8 | d798a81aa9d4e9d94b49083c2c23c772 | // PR c++/57016
// { dg-require-effective-target c++11 }
template < typename _Tp, _Tp __v > struct integral_constant
{
static constexpr _Tp value = __v;
};
template < bool, typename, typename > struct conditional;
template < typename ... >struct __and_;
template
<
typename
_B1,
typename
_B2 > struct __and_... |
google | android | bracket1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/bracket1.C | 233 | utf_8 | 4c7deb0d2f60f646e961862aec91657e | // { dg-do compile { target c++11 } }
template<typename T>
struct list {};
template<typename T>
struct vector {
operator T() const;
};
void f()
{
vector<vector<int>> v;
const vector<int> vi = static_cast<vector<int>>(v);
}
|
google | android | constexpr-initlist3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist3.C | 231 | utf_8 | 48598c22d35f11dc1efcf1477695ef76 | // { dg-do compile { target c++11 } }
#include <initializer_list>
#define SA(X) static_assert(X,#X)
constexpr int f(std::initializer_list<int> l) { return l.begin()[0]; }
int main()
{
constexpr int i = f({42});
SA(i==42);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.