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 | pr54323 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr54323.C | 665 | utf_8 | 6eb4712996c5c48893b31133038f46f0 | // PR c++/54323
// { dg-do compile { target c++11 } }
template<bool, typename T = void>
struct enable_if { };
template<typename T>
struct enable_if<true, T>
{ typedef T type; };
template<template<typename> class CRTP, typename T>
class Base
{
public:
template<template<typename> class CRTP0, typename T0, class>
f... |
google | android | auto3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto3.C | 608 | utf_8 | 18caee8da77e38e6a7b6c33a6d1f9313 | // Negative test for auto
// { dg-do compile { target c++11 } }
#include <initializer_list>
auto x; // { dg-error "auto" }
// If the type deduced for the template parameter U is not the same in each
// deduction, the program is ill-formed.
auto i = 42, j = 42.0; // { dg-error "auto" }
// New CWG issue
auto a[2]... |
google | android | variadic97 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic97.C | 702 | utf_8 | 499f5fa9105857e2d0b1ac67e1a15abf | // PR c++/42266
// { dg-do compile { target c++11 } }
template<typename... _Elements>
class tuple;
template<typename _Arg>
class _Mu;
template<typename _Signature>
struct _Bind;
template<typename _Functor, typename... _Bound_args>
class _Bind<_Functor(_Bound_args...)>
{
template<typename... _Args, typ... |
google | android | constexpr-access | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-access.C | 134 | utf_8 | 7d8afd8896f969ba303cb470f166dc1a | // { dg-do compile { target c++11 } }
class base
{
protected:
constexpr base() { }
};
struct A : base { };
int main()
{
A a;
}
|
google | android | auto42 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto42.C | 159 | utf_8 | fd70def1cb3bc4ef08b2f4df1a5980d4 | // PR c++/60628
// { dg-do compile { target c++11 } }
#include <initializer_list>
void foo(int i)
{
auto x[1] = { 0 }; // { dg-error "array of .auto" }
}
|
google | android | constexpr-invisiref1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-invisiref1.C | 692 | utf_8 | 683db5db98fc74d6eadc7aa9954bdb28 | // PR c++/55879
// { dg-do compile { target c++11 } }
class CAddress
{
public:
constexpr CAddress(unsigned long begin) : m_Begin(begin) {}
constexpr CAddress(const CAddress &other) : m_Begin(other.m_Begin) {}
private:
unsigned long m_Begin;
};
extern "C" char _lnkDDRRAM;
/* internal compiler error on gcc 4.6.3... |
google | android | gen-attrs-37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-37.C | 353 | utf_8 | 85bf99aa780605a6fd86e7a4cf6e5e8a | // PR c++/43093
// { dg-options "-pedantic" }
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } }
// { dg-require-effective-target c++11 }
// c++11 attributes that apply to types are ignored for now
struct S {
int x;
S(const S &s) {}
};
S getS() [[gnu::__stdcall__]]; // { dg-warning "ignored" }
... |
google | android | sfinae5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae5.C | 258 | utf_8 | d5e6c1bb41ba570249eba838c6885b91 | // { dg-do compile { target c++11 } }
template<class T>
T&& create();
template <class T, class U,
class = decltype(create<T>() = create<U>())
>
char test(int);
template <class, class>
double test(...);
int main() {
test<int[], int[]>(0); // #1
}
|
google | android | constexpr-auto | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-auto.C | 64 | utf_8 | a38638e5f2e5311e8f06a790b3745aa9 | // { dg-do compile { target c++11 } }
constexpr auto value = 0;
|
google | android | constexpr-array7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array7.C | 206 | utf_8 | b61d9249e720e8298080c0003dd18f1d | // PR c++/61994
// { dg-do compile { target c++11 } }
struct A { int i,j; };
struct X {
A a = {1,1};
};
constexpr X table[1][1] = {{ {} }};
#define SA(X) static_assert(X,#X)
SA(table[0][0].a.i == 1);
|
google | android | variadic26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic26.C | 660 | utf_8 | 007fa055b4c72f835c7945d7bd2adb58 | // { dg-do compile { target c++11 } }
template<template<int, int> class Meta, int Initial, int... Values>
struct accumulate {
static const int value = Initial;
};
template<template<int, int> class Meta, int Initial, int Value, int... Rest>
struct accumulate<Meta, Initial, Value, Rest...> {
static const int value =... |
google | android | constexpr-52672 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-52672.C | 327 | utf_8 | d55311e37ed0d20d2c44697761f33eca | // PR c++/52672
// { dg-do compile { target c++11 } }
__extension__ typedef __SIZE_TYPE__ * ul_ptr;
constexpr unsigned long a = *((ul_ptr)0x0); // { dg-error "" }
constexpr unsigned long b = *((ul_ptr)(*((ul_ptr)0x0))); // { dg-error "" }
constexpr unsigned long c = *((ul_ptr)*((ul_ptr)(*((ul_ptr)0x0)))); // { dg-erro... |
google | android | initlist3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist3.C | 150 | utf_8 | ee2417eea379565b56e2d87788fa6673 | // { dg-do compile { target c++11 } }
#include <initializer_list>
template <class T> void f(std::initializer_list<T>);
void g()
{
f({1,2,3});
}
|
google | android | variadic90 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic90.C | 157 | utf_8 | 8c2ef68a2aaef62304a9ff86cdb3f6b2 | // { dg-do compile { target c++11 } }
template<template<typename...> class TT>
struct X { };
template<typename T, typename U> struct pair { };
X<pair> x;
|
google | android | nsdmi-defer3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C | 270 | utf_8 | 1090d38c6d41caae2a45643a1fdb45f5 | // Do NSDMI get deferred instantiation?
// { dg-do compile { target c++11 } }
template <class T>
struct A
{
T t = T(42);
constexpr A() { }
A(T t): t(t) { }
};
struct B { };
#define SA(X) static_assert(X,#X)
constexpr A<int> a1;
SA(a1.t == 42);
A<B> a2 {B()};
|
google | android | constexpr-template2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template2.C | 193 | utf_8 | f98c98ebe90dfc39170c4a4f40861306 | // { dg-do compile { target c++11 } }
template <class T> struct A
{
T t;
constexpr A() { } // { dg-error "uninitialized" }
};
int main()
{
constexpr A<int> a; // { dg-error "A()" }
}
|
google | android | nsdmi-list1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-list1.C | 184 | utf_8 | b8706c4b353788bfe037cbbf67877a76 | // PR c++/50563
// { dg-do compile { target c++11 } }
struct S1 {
int a{10}, b{20}; // OK
};
struct S2 {
int a, b = 20; // OK
};
struct S3 {
int a = 10, b = 20;
};
|
google | android | sfinae33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae33.C | 414 | utf_8 | aee7eb3fb7d7c373475666f84b6f3b44 | // PR c++/52422
// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref
{
typedef T&& type;
};
template<>
struct add_rval_ref<void>
{
typedef void type;
};
template<class T>
typename add_rval_ref<T>::type create();
template<class T,
class = decltype(create<T>()())
>
auto f(int) -> char(&)... |
google | android | gen-attrs-7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-7.C | 116 | utf_8 | f55fa66c82d267feca5db82dc835210a | // { dg-do compile { target c++11 } }
// { dg-options "-Wunused-parameter" }
void f (int i [[gnu::__unused__]]) {}
|
google | android | nullptr17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr17.C | 512 | utf_8 | 6849ca5ac9446131028b75f9346f1d24 | // { dg-do compile { target c++11 } }
// Test that bool is a better overload match than 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) { }
int i( ... |
google | android | sfinae19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae19.C | 276 | utf_8 | bb3e33a1c80f4fabdd9ee180fa7c15ac | // PR c++/48737
// { dg-do compile { target c++11 } }
template<class T>
T&& create();
template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);
template<class, class...>
char (&f(...))[2];
static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
|
google | android | variadic-ex3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C | 478 | utf_8 | 86cc534895fa79d4badf42d58ffdeea9 | // { dg-do compile { target c++11 } }
template<class X, class Y, class... Z> X f(Y); // { dg-message "note" }
void g()
{
int i = f<int>(5.6);
int j = f(5.6); // { dg-error "no matching" }
// { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 }
f<void>(f<int, bool>... |
google | android | constexpr-ice2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice2.C | 68 | utf_8 | b9f6048a90a69c192d74f1909302134b | // { dg-do compile { target c++11 } }
int x;
constexpr int& rx = x;
|
google | android | sfinae43 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae43.C | 590 | utf_8 | 9665957a3e41e7ebf520837fa68427ed | // PR c++/56208
// { dg-do compile { target c++11 } }
struct ostream {
ostream& operator<<(int);
};
struct sfinae_base {
typedef char one;
typedef char (&two)[2];
template<class T>
static T make();
template<unsigned> struct ok { typedef int type; };
template<class U, class T>
static one test(declt... |
google | android | error3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error3.C | 269 | utf_8 | f62a97fe793cbb758f511e602db308aa | // PR c++/47336
// { dg-do compile { target c++11 } }
template <typename T>
void g(T t)
{
t+1; // { dg-error "no match" }
}
template <typename S>
class C
{
struct D {} d;
public:
decltype(g(d)) h()
{
return g(d);
}
};
int main()
{
C<int>().h();
}
|
google | android | constexpr-noexcept3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept3.C | 161 | utf_8 | 7d96e9cf889d6d2bbc772d2f2a7b25c0 | // { dg-do compile { target c++11 } }
constexpr int f(int i) { return i; }
#define SA(X) static_assert (X, #X)
SA(noexcept(f(42)));
int j;
SA(!noexcept(f(j)));
|
google | android | auto4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto4.C | 516 | utf_8 | 71c45e682fd4110207b00eebaee3cab9 | // Testcase for deduction of std::initializer_list for auto.
// { dg-do run { target c++11 } }
#include <typeinfo>
#include <initializer_list>
extern "C" void abort();
template <class T>
void f (T t)
{
auto ilt = { &t, &t };
if (typeid(ilt) != typeid(std::initializer_list<T*>))
abort();
auto il = { 1, 2, 3... |
google | android | alias-decl-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-3.C | 561 | utf_8 | 09c3824474e6f110812a19020059637b | // { dg-do compile { target c++11 } }
// Exercise some member alias templates ...
template<class T, class U> class A0 {};
template<class T>
struct A1 {
template<class U> struct S {};
template<class U> using AA0 = A0<T, U>;
void f(A0<T, int>);
void
foo()
{
AA0<int> a;
const AA0<int> b;
f... |
google | android | implicit12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit12.C | 774 | utf_8 | bba825da84a7cef5052a899c9f1158f3 | // PR c++/50500
// { dg-do compile { target c++11 } }
// If a class declares move operations, the implicitly declared copy
// operations are deleted.
struct A
{
A();
A(A&&);
A& operator=(A&&);
};
// But they can still be explicitly defaulted.
struct B
{
B();
B(B&&);
B(const B&) = default;
B& operator=(B&&... |
google | android | variadic41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic41.C | 287 | utf_8 | f7856585614c4f53f28eabe56bef46a1 | // A function parameter pack is only deduced if it's at the end
// { dg-do compile { target c++11 } }
template<typename... Args>
void f(const Args&... args, int oops);
int main()
{
f<>(1);
f(1);
f<int>(1,2);
f(1,2); // { dg-error "no match" }
}
// { dg-prune-output "note" }
|
google | android | ref-qual12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual12.C | 290 | utf_8 | 0a0c7a2db84d28ba649ea53e136a1d9c | // PR c++/57254
// { dg-require-effective-target c++11 }
struct foo {
template<typename T>
void bar(T) &;
template<typename T>
void bar(T) &&;
};
template<typename T>
void foo::bar(T) & {}
template<typename T>
void foo::bar(T) && {}
int main()
{
foo f;
f.bar(0);
}
|
google | android | pr31993 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr31993.C | 169 | utf_8 | b5e21986baa18b3812cba3a24cd09cd4 | // { dg-do compile { target c++11 } }
template<typename...> struct A;
template<template<int> class... T> struct A<T<0>...>
{
template<int> struct B {};
B<0> b;
};
|
google | android | constexpr-46336 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-46336.C | 361 | utf_8 | 3e4cac522763806230540d3da6cc5ee1 | // PR c++/46336
// { dg-do compile { target c++11 } }
extern "C" {
enum A { };
inline constexpr A
f(A a, A b) // { dg-message "previous declaration" }
{ return A(static_cast<int>(a) & static_cast<int>(b)); }
enum B { };
inline constexpr B
f(B a, B b) // { dg-error "C function" }
{ return B(static_c... |
google | android | alias-decl-28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-28.C | 179 | utf_8 | 5f77ef04194d7e6abc6bb4e13b0828e4 | // Origin: PR c++/54401
// { dg-do compile { target c++11 } }
template<typename>
struct X {
using type = T; // { dg-error "expected type-specifier|does not name a type" }
};
|
google | android | constexpr-generated1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-generated1.C | 329 | utf_8 | 726026758db1a8482393c7ab18852b04 | // { dg-do compile { target c++11 } }
template <class T> struct A
{
constexpr T f ();
};
int g();
// We should complain about this.
template<> constexpr int A<int>::f()
{ return g(); } // { dg-error "non-constexpr" }
// But not about this.
struct B
{
int i;
constexpr B(int i = g()):i(i) { }
};
struct C: B {... |
google | android | constexpr-bitfield3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C | 679 | utf_8 | 271aba96fb8bf37bed15d4848cc13f01 | // PR c++/49136
// { dg-do compile { target c++11 } }
struct S
{
unsigned : 1; unsigned s : 27; unsigned : 4;
constexpr S (unsigned int x) : s(x) {}
};
template <typename S>
struct T
{
unsigned int t;
constexpr T (S s) : t(s.s != 7 ? 0 : s.s) {}
constexpr T (S s, S s2) : t(s.s != s2.s ? 0 : s.s) {}
};
cons... |
google | android | enum17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum17.C | 454 | utf_8 | ae5050f808215ad0bc3a23021ec8e8d8 | // PR c++/48536
// { dg-do compile { target c++11 } }
#include <climits>
// According to C++11 / Clause 7.2/5 the following enumeration is
// well-formed. It is also well-formed in C++03 if UINT_MAX < ULONG_MAX,
// but C++11 adds long long.
enum Enum_Inc { EI_1=UINT_MAX, EI_2 }; // #1
// It is not equivalent to t... |
google | android | initlist64 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist64.C | 304 | utf_8 | aa2ae58d6dec43d7b085b1c3f56c8a6b | // PR c++/51553
// { dg-do compile { target c++11 } }
struct X
{
X();
};
struct Y
{
operator X() const;
};
struct Z
{
explicit operator X() const;
};
X a = { Y() };
X aa = Y();
X b{ Y() };
X bb(Y());
X c = { Z() }; // { dg-error "" }
X cc = Z(); // { dg-error "" }
X d{ Z() };
X dd( Z() );
|
google | android | variadic110 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic110.C | 229 | utf_8 | 51e8cb51cb161e95dbc3a9580cf5bf1e | // PR c++/45698
// { dg-do compile { target c++11 } }
template <class... Ts> struct tuple { };
template<class... Ts>
struct A {
template<typename T> struct N { };
tuple<N<Ts>...> tup;
};
int main()
{
A<int, double> a;
}
|
google | android | constexpr-non-const-arg2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg2.C | 377 | utf_8 | d1ec0d16df219b4574614b6f4fa3b9b6 | // PR c++/47200
// { dg-do compile { target c++11 } }
// { dg-options "-w" }
template < int > struct duration
{
constexpr int count ();
static constexpr duration min ();
};
constexpr int
f (duration < 0 > d, duration < 0 > )
{
return d.count ();
}
static_assert (f (duration < 0 >::min (), duration < 0 > ()), "... |
google | android | nullptr07 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr07.C | 408 | utf_8 | c1eb4016685cdf315801aa4137a02728 | // { dg-do compile { target c++11 } }
// Test compare to int
void fun()
{
int n = 0;
if( n == nullptr ); // { dg-error "invalid operands of types " }
const int m = 1;
if( m == nullptr ); // { dg-error "invalid operands of types " }
decltype(nullptr) mynull = 0;
if( n == mynull ); // { dg-error "invalid op... |
google | android | variadic112 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic112.C | 344 | utf_8 | 290a38244de57f600be52a5f3feed7a6 | // PR c++/49420
// { dg-do compile { target c++11 } }
struct A { };
template <class T> struct B
{
typedef typename T::type type ; // { dg-error "no type" }
};
template <typename Array, typename... Args>
typename B<Array>::type
get(const Array& a, Args... args);
int main()
{
A a;
int x = get(a, 1, 2, 3); // { ... |
google | android | range-for18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for18.C | 201 | utf_8 | fefa8333291f79eeb5c459271d00207d | // PR c++/48994
// { dg-do compile { target c++11 } }
template <typename T>
struct myvec
{
T* begin() const;
T* end() const;
};
void f(const myvec<int>& v)
{
for (int i : v)
;
}
|
google | android | sfinae34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae34.C | 452 | utf_8 | 880d6da2a745c7d82bda4720d1361822 | // PR c++/52422
// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref
{
typedef T&& type;
};
template<>
struct add_rval_ref<void>
{
typedef void type;
};
template<class T>
typename add_rval_ref<T>::type create();
template<class T, class U,
class = decltype( (create<T>().*create<U>())() )... |
google | android | constexpr-incomplete2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C | 394 | utf_8 | b1ca54a833e99909323572bbe2ac4c22 | // A constructor that might or might not be constexpr still makes
// its class literal.
// { dg-do compile { target c++11 } }
template <class T>
struct B
{
constexpr B(T) { }
constexpr B() {}
};
struct A
{
B<A> b;
};
constexpr A a {};
template <class T>
struct C
{
constexpr C(T) { }
C() {}
};
struct D
{
... |
google | android | sfinae39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae39.C | 3,323 | utf_8 | df4b8c3a52c1091071aae51a9baba3a2 | // PR c++/54191
// { dg-do compile { target c++11 } }
struct B
{};
struct D
: private B
{};
template<typename T>
T &&declval();
template<typename From, typename = decltype(B{declval<From>()})>
constexpr bool test_braced_cast_to_base(int)
{ return true; }
template<typename>
constexpr bool test_braced_cast_to_bas... |
google | android | friend2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/friend2.C | 554 | utf_8 | d4322d3a60ab9276cc1264c288db974f | // PR c++/47721
// { dg-do compile { target c++11 } }
// template type parameter friend:
template<class W>
class Q
{
static const int I = 2;
public:
friend W;
};
struct B
{
int ar[Q<B>::I];
};
// bonus template template parameter friend:
template <class T> struct A;
template<template <class> class W>
class ... |
google | android | overload | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/overload.C | 11,390 | utf_8 | e1598f2c9f261104495d9e7d921f8264 | // { dg-do link { target c++11 } }
// 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; } // rvalue (r)
S cons... |
google | android | gen-attrs-36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-36.C | 712 | utf_8 | 6546f08ad4e30f185ee3c2438c478b88 | // PR c++/43031
// { dg-options "-pedantic" }
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } }
// { dg-require-effective-target c++11 }
// c++11 attributes that apply to types are ignored for now
class T;
class L { };
class P : public L
{
typedef void (T::* [[gnu::__stdcall__]] F2) (L*); // { dg-... |
google | android | pr32125 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr32125.C | 160 | utf_8 | 7c387346390cc9ff37ab87b732639db8 | // { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
{
A();
A(T);
};
|
google | android | variadic130 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic130.C | 196 | utf_8 | bde938be4f9c615f5e3f5636753fa008 | // PR c++/52008
// { dg-do compile { target c++11 } }
template <int I, typename T, typename... Ts>
struct A;
template<typename... Ts>
struct A<0, Ts...>; // { dg-error "not more specialized" }
|
google | android | auto22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto22.C | 347 | utf_8 | 833e733e541c0f1404c9bebc10fc45b7 | // PR c++/47999
// { dg-do compile { target c++11 } }
int& identity(int& i)
{
return i;
}
// In a function template, auto type deduction works incorrectly.
template <typename = void>
void f()
{
int i = 0;
auto&& x = identity(i); // Type of x should be `int&`, but it is `int&&`.
}
int main (int argc, char* argv... |
google | android | dependent1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/dependent1.C | 600 | utf_8 | ca26ad5278a2ac2347db2c2a451bdddf | // PR c++/48319
// { dg-do compile { target c++11 } }
// We were failing to recognize declval<_Args1> as dependent.
template<typename Tp> Tp declval() noexcept;
template<typename _Tp>
class __is_constructible_helper
{
typedef char __one;
typedef struct { char __arr[2]; } __two;
template<typename _Tp1, typename... |
google | android | constexpr-noexcept6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept6.C | 149 | utf_8 | b00aa1d604c54fb26fa3692e40dd73cf | // PR c++/51305
// { dg-do compile { target c++11 } }
constexpr bool ok() noexcept
{
typedef int type;
return true;
}
constexpr auto x = ok();
|
google | android | alias-decl-36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C | 149 | utf_8 | df6c6965559c800818f324a4eae16c6a | // PR c++/53658
// { dg-do compile { target c++11 } }
struct A;
template <typename> using Foo = const A;
template <typename Item> Foo <Item> bar();
|
google | android | nullptr27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr27.C | 230 | utf_8 | d2714b84a7ddd1b97c94b10d19385468 | // PR c++/52706
// { dg-do compile { target c++11 } }
// { dg-options "-fabi-version=0" }
// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } }
template<class T, decltype(nullptr) = nullptr>
int f(T);
int i2 = f(nullptr); // 17
|
google | android | constexpr-static2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static2.C | 274 | utf_8 | 797b8689368a7682042cd629a45f6125 | // { dg-do compile { target c++11 } }
struct IsLiteral {};
struct ShouldBeLiteral {
constexpr ShouldBeLiteral(int){}
};
struct StaticDataMember {
static constexpr IsLiteral one = IsLiteral(); // #1
static constexpr ShouldBeLiteral two= ShouldBeLiteral(-1); // #2
};
|
google | android | range-for13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for13.C | 1,664 | utf_8 | e27469a4866bb583cc7a08a0d11edcbd | // Test for errors in range-based for loops
// with member begin/end
// { dg-do compile { target c++11 } }
//These should not be used
template<typename T> int *begin(T &t)
{
T::fail;
}
template<typename T> int *end(T &t)
{
T::fail;
}
struct container1
{
int *begin();
//no end
};
struct container2
{
... |
google | android | overload-conv-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/overload-conv-2.C | 146 | utf_8 | 5ca00ae02aa7919e0b3d9730fa9f9ac5 | // { dg-do link { target c++11 } }
struct T {};
struct S
{
S(T const &) {}
};
void f(const S&);
void f(S&&) {}
int main()
{
T t;
f(t);
}
|
google | android | elision | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/elision.C | 1,018 | utf_8 | 66b2af972cbee8009e3e5f9895cb0a1a | // I, Howard Hinnant, hereby place this code in the public domain.
// Test: Implicit cast to rvalue when eliding copy
// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
struct one {char x[1];};
struct two {char x[2];};
class move_only
{
move_only(const move_onl... |
google | android | variadic149 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic149.C | 186 | utf_8 | c01ea9247dcab398195eab1c4689e13a | // PR c++/60248
// { dg-do compile { target c++11 } }
// { dg-options "-g -fabi-version=2" }
template<int...> struct A {};
template<> struct A<0>
{
typedef enum { e } B;
};
A<0> a;
|
google | android | alias-decl-44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-44.C | 873 | utf_8 | 3438514f63b7f3fb597fcddca16cd9fc | // PR c++/63849
// { dg-do compile { target c++11 } }
template <class _T, class...>
using First = _T; // we should not use this
// alias with only
// one pack parameter (?)
template <template <class...> class _Successor,
int,
cla... |
google | android | fntmpdefarg3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg3.C | 612 | utf_8 | 4a25a54dc5d1035f1472ee5c71a8292c | // { dg-do compile { target c++11 } }
template <class T, class = typename T::I> void f(T) {}
template <class T, class = typename T::I> void g(T) {}
template <class T, class = typename T::I> void h(T) {}
template <class T, class = typename T::I> void i(T) {}
template <class T, class = typename T::I> void j(T) {} // { d... |
google | android | initlist24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist24.C | 191 | utf_8 | ab7e6d43c7b15b554e82bf9c1cb322da | // PR c++/39923
// { dg-do compile { target c++11 } }
#include <initializer_list>
void test3()
{
std::initializer_list<int> list{move}; // { dg-error "not declared|could not convert" }
}
|
google | android | initlist16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist16.C | 142 | utf_8 | 0cbd5b9635cd71f3d6738db34fe5f5b4 | // { dg-do run { target c++11 } }
extern "C" void abort();
void f(int i) { if (i != 42) abort(); }
int main()
{
f({42});
return {0};
}
|
google | android | variadic57 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic57.C | 280 | utf_8 | 633b1508d94129309321ab40c30919d3 | // { dg-do compile { target c++11 } }
template<typename T, int... Dims>
struct array {
int foo();
};
template<typename T>
struct array<T, 0> {
int bar();
};
template<typename T, int... Dims>
int array<T, Dims...>::foo() { }
template<typename T>
int array<T, 0>::bar() { }
|
google | android | variadic118 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic118.C | 240 | utf_8 | 679e9ef507a15616472cc32c508f0617 | // This should fail deduction, before it produces a candidate.
// { dg-do compile { target c++11 } }
template <class... T>
void f(T... ts); // { dg-message "deduction" }
struct B { };
int main()
{
f<int>(B(), 1); // { dg-error "" }
}
|
google | android | range-for17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for17.C | 306 | utf_8 | 0e454e1ec2555139c4421d867fea9ce8 | // { dg-do compile { target c++11 } }
extern "C" int printf (const char *, ...);
enum E { e1, e2, e3, X };
E operator*(E e) { return e; }
E begin(E e) { return e; }
E end(E e) { return X; }
E operator++(E& e) { return e = E(e+1); }
int main()
{
for (auto e: e1)
{
printf ("%d ", e);
}
}
|
google | android | constexpr-ex1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C | 2,656 | utf_8 | 3f41b42bda4e73aeff58684ec5f655b6 | // { dg-do compile { target c++11 } }
// From N2235
// 4.1 constant-expression functions
// 1 examples
// 2 defined before first use
// NOTE: this is only needed in contexts that require a constant-expression
struct S {
constexpr int twice();
constexpr int t(); // { dg-message "used but never defined" }... |
google | android | variadic27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic27.C | 625 | utf_8 | 4ebaffc12510aa95c947d617df03243f | // { 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 T, typename U>
struct same_type {
static const bool value = false;
};
template<typename T>
str... |
google | android | alias-decl-enum-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-enum-1.C | 1,188 | utf_8 | 830a80101d211b99c4fce4c743aa6771 | // PR c++/57734
// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct same_type { static const bool value = false; };
template<typename T>
struct same_type<T, T> { static const bool value = true; };
enum e { zero };
enum class eclass { one };
template<typename T>
using enum_alias = e;
templ... |
google | android | override4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/override4.C | 742 | utf_8 | ec3fccada021f17376f5255d71d5545b | // { dg-do compile { target c++11 } }
// { dg-prune-output "expected ';'" }
// { dg-prune-output "expected unqualified-id" }
// { dg-prune-output "declaration does not declare anything" }
struct B
{
virtual auto f() -> void final;
virtual auto g() -> void;
};
struct B2
{
virtual auto f() -> void final {}
};
st... |
google | android | variadic40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic40.C | 127 | utf_8 | c53a35f9899d608765949100d15dd281 | // { dg-do compile { target c++11 } }
template<typename... Values, typename T>
struct backward_tuple {}; // { dg-error "end" }
|
google | android | constexpr-missing | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-missing.C | 690 | utf_8 | 211c953e7e3e1153239acc0f3fee4960 | // PR c++/48911
// { dg-do compile { target c++11 } }
#define SA(X) static_assert((X),#X)
struct A
{
constexpr A () : a (6) {}
int a;
};
int
main ()
{
constexpr int a[2] = { 42 };
constexpr int i = a[1];
SA(i==0);
constexpr int b[1] = { };
constexpr int j = b[0];
SA(j==0);
constexpr char c[2] = "a"... |
google | android | extern_template-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/extern_template-2.C | 131 | utf_8 | 4c3a1b08c781a6bc64801d804be82d89 | // { dg-do compile { target c++11 } }
// { dg-options "-pedantic" }
template <typename> class S {};
extern template class S<int>;
|
google | android | auto20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto20.C | 388 | utf_8 | 7aef3687fe07f4e8e9048f15e1fd1da8 | // Test for proper non-deduced context handling of the initializer
// for an auto declaration/new.
// { dg-do compile { target c++11 } }
struct with_apply
{
template <unsigned>
void apply(const double&){}
};
auto p = &with_apply::apply<0>;
auto pp = new auto(&with_apply::apply<0>);
template <class T>
void f()
{
... |
google | android | udlit-tmpl-parms-neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-tmpl-parms-neg.C | 408 | utf_8 | da66e92075834f212c03ede552d0eb4d | // { dg-do compile { target c++11 } }
class Foo { };
template<wchar_t...>
Foo operator"" _Foo(); // { dg-error "literal operator template|has invalid parameter list" }
template<char>
Foo operator"" _Bar(); // { dg-error "literal operator template|has invalid parameter list" }
template<typename... Type>
Foo op... |
google | android | initlist68 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist68.C | 299 | utf_8 | 320891e66b5f1bd721aa9516c0049cf3 | // PR c++/56772
// { dg-require-effective-target c++11 }
typedef __SIZE_TYPE__ size_t;
void* operator new[](size_t, void *p) { return p; }
template <typename T = size_t>
void f ()
{
size_t coord [2][2];
new (&coord) size_t [2][2]
{
{0,0},
{0,0},
};
}
int main ()
{
f<>();
}
|
google | android | variadic8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic8.C | 456 | utf_8 | 177aa023f255669c0edb663aaae30988 | // { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple_base {
static const int value = 0;
};
template<>
struct tuple_base<int*>
{
static const int value = 1;
};
template<typename T>
struct tuple_base<T*>
{
static const int value = 2;
};
template<typename... Args>
struct tuple_of_pointers... |
google | android | initlist-lifetime2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-lifetime2.C | 1,026 | utf_8 | 79e5fc1be034c72ec356fd6ac8a58173 | // Test that we properly extend the lifetime of the initializer_list
// array even if the initializer_list is a subobject.
// { dg-do run { target c++11 } }
#include <initializer_list>
extern "C" void abort();
bool ok;
bool do_throw;
struct A {
A(int) { if (do_throw) throw 42; }
~A() { if (!ok) abort(); }
};
t... |
google | android | sfinae21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae21.C | 282 | utf_8 | 21a6ed613d83cf1492fe8351d094d779 | // PR c++/48735
// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T{})
>
char f(int);
template<class>
char (&f(...))[2];
struct ND {
// Make ND() non-aggregate.
virtual void f();
ND() = delete;
};
static_assert(sizeof(f<ND[1]>(0)) != 1, "Error");
|
google | android | access01 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/access01.C | 189 | utf_8 | 044001b13dc877ab537bdf972c319071 | // PR c++/49042
// { dg-do compile { target c++11 } }
template <class T>
class A
{
T p;
public:
template <class U> auto f() -> decltype(+p) { }
};
int main()
{
A<int>().f<int>();
}
|
google | android | constexpr-diag5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-diag5.C | 624 | utf_8 | 035f8fb82538ac268ce8e8e910832e86 | // Origin: PR c++/51633
// { dg-do compile { target c++11 } }
struct A
{
constexpr A() {}
~A();
};
struct B
{
A a;
A b;
A c;
constexpr B() {}
};
struct C
{
A a;
constexpr C() {}
};
struct D
{
constexpr D() { return;} // { dg-error "does not have empty body" }
};
struct D1
{
... |
google | android | named | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/named.C | 843 | utf_8 | e2a2d13a6043d589d665cbb45ea56db8 | // { dg-do link { target c++11 } }
template<typename _Tp>
inline _Tp&&
movel(_Tp& __t)
{ return static_cast<_Tp&&>(__t); }
struct S {};
struct T
{
T(S && s_) : s(movel(s_)) {}
S && get() { return movel(s); }
operator S&&() { return movel(s); }
S && s;
S s2;
};
void named(S const &) {}
void named(S&&);
voi... |
google | android | nsdmi-template11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C | 209 | utf_8 | c56f71db72e83d4f4135a61f033eddbb | // PR c++/58930
// { dg-do compile { target c++11 } }
struct SampleModule
{
explicit SampleModule (int);
};
template < typename >
struct BaseHandler
{
SampleModule module_ { 0 };
};
BaseHandler<int> a;
|
google | android | constexpr-non-const-arg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg.C | 727 | utf_8 | 4dec992762a16ac945ed3fd43b28a340 | // Example from issue 1125 drafting; D() and v were well-formed with the
// wording approved in Rapperswil, now seems they should be ill-formed.
// { dg-do compile { target c++11 } }
struct B {
constexpr B(int x) : i(0) { } // "x" is unused
int i;
};
int global; // { dg-message "not const" }
struct D : B {
... |
google | android | alias-decl-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-6.C | 311 | utf_8 | a16b0e12dce894e9bc097e3fbad8787d | // { dg-do compile { target c++11 } }
// Alias template of non-class types.
template <class T, class U> struct same;
template <class T> struct same<T,T> {};
template <class T> using Ptr = T*;
template <template <class> class T> struct A {
template <class U> using X = T<U>;
};
same<A<Ptr>::X<int>,int*> s;
|
google | android | decltype38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype38.C | 238 | utf_8 | a3ba35bd21a746eed5c781d96b7ac1b4 | // PR c++/53498
// { dg-do compile { target c++11 } }
template<typename... Args>
struct B
{
template<typename U>
static
void b(const U& u, const Args&... args,
decltype(u.f(args...)) dummy)
{
}
};
int main() {
B<int> b;
}
|
google | android | defaulted28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted28.C | 287 | utf_8 | de236a8986412e3ffac2d1a20d0883e1 | // PR c++/49102
// PR c++/50034
// { dg-do compile { target c++11 } }
struct A {
A() = default;
private:
A(A const&) = default; // { dg-error "private" }
};
int f(...) { }
int main() {
A a;
f(a); // { dg-error "this context" }
sizeof(f(a)); // OK because unevaluated
}
|
google | android | initlist14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist14.C | 393 | utf_8 | 3071307e831ae441c218cbab9dbc1d8f | // Bug: We weren't doing the normal replacement of array with pointer
// for deduction in the context of a call because of the initializer list.
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct string
{
string (const char *);
};
template <class T>
struct vector
{
template <class U>
vect... |
google | android | decltype23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype23.C | 196 | utf_8 | 573a2c4ad64a6d9d841a27282038a4bb | // { dg-do compile { target c++11 } }
int x, &&y = static_cast<int &&>(x);
typedef decltype((y)) myInt; // `y' is a parenthesized id-expression of type int that is an lvalue
typedef int &myInt;
|
google | android | udlit-declare-neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-declare-neg.C | 920 | utf_8 | 53dab2ff8dcc1fa019d70a9f304b2c55 | // { dg-do compile { target c++11 } }
// Check that undeclared literal operator calls and literals give appropriate errors.
int i = operator"" _Bar('x'); // { dg-error "was not declared in this scope" }
int j = 'x'_Bar; // { dg-error "unable to find character literal operator|with|argument" }
int ii = operator"" ... |
google | android | rv6n | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv6n.C | 14,017 | utf_8 | 1589da3343417de5bfcb57460ebc9067 | // 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 | nullptr04 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr04.C | 690 | utf_8 | 41a8752eaf8bea288958b279ecabaacd | // { dg-do compile { target c++11 } }
// Test cast to int
__extension__ typedef __INTPTR_TYPE__ intptr_t;
const int n4 = static_cast<const int>(nullptr); // { dg-error "invalid static_cast " }
const short int n5 = reinterpret_cast<short int>(nullptr); // { dg-error "loses precision" }
const intptr_t n6 = reinterpret... |
google | android | constexpr-static11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static11.C | 221 | utf_8 | 7431d68cb7a29a352611ab8a7cdad67b | // PR c++/54532
// { dg-do compile { target c++11 } }
#define SA(X) static_assert(X,#X)
struct A {
int i;
constexpr static int A::*p = &A::i;
};
constexpr A a = { 42 };
SA(a.*A::p == 42);
constexpr int A::* A::p;
|
google | android | variadic49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic49.C | 139 | utf_8 | ce914ac895543ad3d1bc26fc63f63d70 | // { dg-do compile { target c++11 } }
int& f(...);
template<typename... Args>
float& f(Args...);
float& g() {
return f(17, 3.14159);
}
|
google | android | constexpr-noexcept4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept4.C | 342 | utf_8 | 39c884231de4c13223e51257dcd4bf47 | // { dg-do compile { target c++11 } }
// A call is noexcept if it is a valid subexpression of a constant
// expression, even if it is not itself a constant expression.
#define SA(X) static_assert(X,#X)
constexpr const int* f(const int *p) { return p; }
int main()
{
constexpr int i = 42;
SA(noexcept(*f(&i)));
S... |
google | android | constexpr-ellipsis2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis2.C | 229 | utf_8 | 3c17c7f8cedb94085b94ea1b911036e0 | // { dg-do compile { target c++11 } }
struct A
{
A();
A(const A&);
bool empty();
};
constexpr int ellipsis(...) { return 1; }
static_assert(ellipsis(A().empty()), "Error"); // { dg-error "non-constant condition|empty" }
|
google | android | variadic152 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic152.C | 245 | utf_8 | 7846bfdcab99ef2126eabcf458f3897c | // PR c++/54440
// { dg-do compile { target c++11 } }
template <class...T> struct A
{
template <template <T> class... TP, class U> struct B { };
};
template <int I> struct C { };
template <char C> struct D { };
A<int,char>::B<C,D,float> b;
|
google | android | sfinae50 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C | 826 | utf_8 | e658abe19e3f9090108ecdee6c7ff751 | // PR c++/61083
// { dg-do compile { target c++11 } }
template<typename T> T declval();
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;
};
struct true_type {};
struct false_type {};
template <typen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.