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 | auto34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto34.C | 244 | utf_8 | 170d773a2ded01dcfd6ac34e6d0f7227 | // PR c++/51421
// { dg-do compile { target c++11 } }
int foo1(int);
void bar1()
{
auto i = foo1(i); // { dg-error "before deduction" }
}
struct A {};
A foo2(A);
void bar2()
{
auto a = foo2(a); // { dg-error "before deduction" }
}
|
google | android | constexpr-throw | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-throw.C | 238 | utf_8 | 53ba7c64d852ccf921166074b871f796 | // { dg-do compile { target c++11 } }
constexpr int may_throw(bool decide) {
return decide ? 42 : throw -1; // { dg-error "throw" }
}
constexpr int x = may_throw(false); // { dg-message "may_throw" }
constexpr int y = may_throw(true);
|
google | android | udlit-args2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-args2.C | 308 | utf_8 | 04115b45331d4f8a8814aa835cc97319 | // PR c++/52521
// { dg-do compile { target c++11 } }
#include <cstddef>
int operator "" _a (const char *);
int operator "" _a (const char *, std::size_t);
int a = 123_a;
int a2 = "abc"_a;
int operator "" _b (const char *, std::size_t);
int operator "" _b (const char *);
int b = 123_b;
int b2 = "abc"_b;
|
google | android | constexpr-noexcept7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept7.C | 203 | utf_8 | 886e5cb86674ee37e869f08fd2b2878b | // PR c++/53473
// { dg-do compile { target c++11 } }
template<typename T> struct A
{
static constexpr T foo() noexcept { return 0; }
};
template<> constexpr int A<int>::foo() noexcept { return 0; }
|
google | android | variadic54 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic54.C | 232 | utf_8 | d8b97750712e10c76c87f95f2605c4e2 | // { dg-do compile { target c++11 } }
template<typename F, typename... BoundArgs>
class bound_functor
{
public:
bound_functor();
};
template<typename F, typename... BoundArgs>
bound_functor<F, BoundArgs...>::bound_functor()
{
}
|
google | android | enum27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum27.C | 122 | utf_8 | debb7cdd47e6b29dab60a0c1c616a2a9 | // PR c++/53745
// { dg-do compile { target c++11 } }
enum E : unsigned { e = -1 }; // { dg-error "outside the range" }
|
google | android | constexpr-static10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-static10.C | 297 | utf_8 | 6750ddb6d120c8e7368eaae5150e78c1 | // PR c++/55944
// { dg-do compile { target c++11 } }
template<class T>
struct Test
{
constexpr Test(T val) : value(val) {}
static void test()
{
static constexpr Test<int> x(42); // ICE
}
T value;
};
int main()
{
static constexpr Test<int> x(42); // OK
Test<double>::test();
}
|
google | android | pr45908 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr45908.C | 339 | utf_8 | aa52ef81c64f86ab036596abd37f9763 | // PR c++/45908
// { dg-do compile { target c++11 } }
struct vector {
struct iterator { };
struct const_iterator { };
iterator begin();
const_iterator begin() const;
};
class block {
vector v;
auto end() const -> decltype(v.begin())
{ return v.begin(); }
}; |
google | android | variadic122 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic122.C | 430 | utf_8 | 7e036ff9a98eedd89ee36cec9f3ccbcc | // PR c++/52043
// { dg-do compile { target c++11 } }
// { dg-options "-Wreturn-type" }
template < class T > struct Container
{
T f ();
};
template < class T >
T deref (T)
{} // { dg-warning "no return" }
template < class T, class ... Args >
auto deref (T u, int, Args ... args)->decltype (deref (u.f (), args ..... |
google | android | variadic78 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic78.C | 371 | utf_8 | fa8cb5f8a621d6d204f557668f4edb0b | // PR c++/33496
// { dg-do compile { target c++11 } }
template<int M, int N> struct pair
{
int i, j;
pair () : i (M), j (N) {}
};
template<int... M> struct S
{
template<int... N> static int *foo ()
{
static int x[] = { (M + N)... }; // { dg-error "mismatched argument pack lengths" }
return x;
}
};
... |
google | android | stdint | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/stdint.C | 2,550 | utf_8 | fc17a9680f82bb981810a82defa7cf33 | // PR c++/52764
// { dg-require-effective-target stdint_types }
// { dg-do compile { target c++11 } }
#include <stdint.h>
#ifdef __INT8_TYPE__
# if (!defined INT8_MAX \
|| !defined INT8_MIN)
# error
# endif
#endif
#ifdef __UINT8_TYPE__
# if !defined UINT8_MAX
# error
# endif
#endif
#ifdef __INT16_TYPE__
# if (!... |
google | android | auto33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/auto33.C | 246 | utf_8 | ec3eeecf3c40bd05749940632684e2c4 | // PR c++/53484
// { dg-do compile { target c++11 } }
template<class T,class U> struct ST;
template<class T> struct ST<T,T> {};
template <class T>
void f(T x){
[&]{
auto y = x;
ST<decltype(y),int>();
}();
}
int main(){ f(0); }
|
google | android | gen-attrs-36-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-36-1.C | 346 | utf_8 | cd13c1f0861e1edd6e1895dc518d8d9a | // { dg-do compile { target c++11 } }
struct S;
typedef int (*F [[gnu::warn_unused_result]]) (int);
typedef int (*F2 [[gnu::warn_unused_result]]) (int);
typedef int (S::*F3 [[gnu::warn_unused_result]]) (int); // { dg-warning "only applies to function types" }
typedef int [[gnu::warn_unused_result]] (*F5) (int); //... |
google | android | variadic107 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic107.C | 319 | utf_8 | 06886fc75d2f17e53471a5d398aa1830 | // PR c++/48451
// { dg-do compile { target c++11 } }
namespace std {
template <class T> T&& declval();
}
template<class T, class... Args,
class = decltype(T(std::declval<Args>()...))
>
char f(int);
struct From2Ints { From2Ints(int, int); };
static_assert(sizeof(f<From2Ints, int, int>(0)) == 1, "Error"); // b
|
google | android | vt-37737-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C | 332 | utf_8 | 6fb5753379af2480e86e48990b0d1379 | // { dg-do compile { target c++11 } }
template<class U, class... T>
void f() // { dg-message "note" }
{
f<T...>(); // { dg-error "no matching" }
// { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 }
}
template<>
void f() { } // { dg-error "template-id" }
int main()
{
f... |
google | android | defaulted9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted9.C | 311 | utf_8 | 23094958b5ceda3fdf1d62176d94aabe | // PR c++/39153
// { dg-do compile { target c++11 } }
// { dg-options "-fno-inline" }
struct _Impl_base
{
_Impl_base() = default;
virtual ~_Impl_base();
};
inline _Impl_base::~_Impl_base() = default;
template<typename _Tp>
class _Impl : public _Impl_base
{ };
int main()
{
_Impl<int> i;
return 0;
}
|
google | android | gen-attrs-23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-23.C | 575 | utf_8 | ec3da2b5b326b8e77d52b18452c4db5c | // PR c++/28112
// { dg-do compile { target c++11 } }
int i [[gnu::init_priority(;)]]; // { dg-error "before" }
int j [[gnu::vector_size(;)]]; // { dg-error "before" }
int k [[gnu::visibility(;)]]; // { dg-error "before" }
struct A {} [[gnu::aligned(;)]]; // { dg-error "before" }
struc... |
google | android | rv3p | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv3p.C | 34,354 | utf_8 | f270bd56f7e949e1d547e8da3bcb5428 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test overload resolution among reference types
// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
template <> struct sa<tr... |
google | android | inh-ctor10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor10.C | 179 | utf_8 | 819a3d27d7dd2b39e739084265950567 | // { dg-do compile { target c++11 } }
// { dg-options "-g" }
struct A
{
template <class... Ts> A(Ts...);
};
struct B: A
{
using A::A;
};
B b1(42);
B b2(1.0, 42, (void*)0);
|
google | android | range-for2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for2.C | 734 | utf_8 | b3f22dfc51eac328e62e1c71d0450302 | // Test for range-based for loop
// Test the loop with a custom iterator
// with begin/end in an associated namespace
// { dg-do compile { target c++11 } }
struct iterator
{
int x;
explicit iterator(int v) :x(v) {}
iterator &operator ++() { ++x; return *this; }
int operator *() { return x; }
bool ... |
google | android | sfinae38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae38.C | 235 | utf_8 | 170c0a00eb3f33ad1955cde8ce81c0d8 | // { dg-do compile { target c++11 } }
template<class T, unsigned = sizeof(T)>
auto f(int) -> char;
template<class>
auto f(...) -> char(&)[2];
static_assert(sizeof(f<void>(0)) != 1, "");
static_assert(sizeof(f<void()>(0)) != 1, "");
|
google | android | vt-34399 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34399.C | 181 | utf_8 | 439fdbdf3020584ecd29d79b9d1c3017 | // { dg-do compile { target c++11 } }
template<int...> struct A
{
void foo();
};
struct B
{
template<int N> friend void A<N>::A::foo(); // { dg-error "declared as friend" }
};
|
google | android | alias-decl-dr1286a | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-dr1286a.C | 1,268 | utf_8 | e2071d46036912555df15661828c4105 | // DR 1286
// { dg-do compile { target c++11 } }
template <class,class> struct same;
template <class T> struct same<T,T> {};
template <class,class> struct different {};
template <class T> struct different<T,T>;
template<typename T, typename U = T> struct A;
template<template <class...> class> struct X;
// equivalen... |
google | android | constexpr-value2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-value2.C | 519 | utf_8 | 763f98f880a2e67d6551007e7ce2883d | // { dg-do compile { target c++11 } }
template<class T>
constexpr T value_init() { return T(); }
template<class T>
constexpr inline T bar(T x) { return x; }
union EmptyUnion {};
union Union1 { int i; };
union Union3 { double d; int i; char* c; };
constexpr auto u1 = value_init<EmptyUnion>();
constexpr auto u2 = val... |
google | android | gnu_fext-numeric-literals | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C | 4,369 | utf_8 | cccfb274675e49b52431558eb1db75ae | // { dg-do compile { target c++11 } }
// { dg-options "" }
// Integer imaginary...
constexpr unsigned long long
operator"" i(unsigned long long n) // { dg-warning "shadowed by implementation" }
{ return 4 * n + 0; }
constexpr unsigned long long
operator"" I(unsigned long long n) // { dg-warning "shadowed by impleme... |
google | android | initlist61 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist61.C | 120 | utf_8 | c1efa91a2b634e23787c9a3ae4b0401c | // { dg-do compile { target c++11 } }
struct N { N(int); };
struct A { N i,j; };
int main()
{
A* ap = new A{1,2};
}
|
google | android | enum5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/enum5.C | 306 | utf_8 | 771003df84c0886c950718b7f6d81033 | // PR c++/40639
// { dg-do compile { target c++11 } }
template< typename T >
struct wrap {
enum E : T { val };
};
template< typename T >
struct dependant {
enum E : typename T::type { val };
};
template<typename T>
struct identity {
typedef T type;
};
wrap<int> x;
dependant<identity<int>> y;
|
google | android | vt-34219 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34219.C | 418 | utf_8 | 702b037f4b469e426938436c9814f05f | // { dg-do compile { target c++11 } }
template<typename T, T a, T... Params>
struct max
{
static const T value = a > max<T, Params>::value ? a : max<T, Params>::value; // { dg-error "not expanded|Params" }
};
template<typename T, T a, T b>
struct max<T, a, b>
{
static const T value = a > b ? a : b;
};
stati... |
google | android | Wzero-as-null-pointer-constant-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C | 363 | utf_8 | 1821a76c969bbe9fe98225106370d360 | // PR c++/56373
// { dg-do compile { target c++11 } }
// { dg-options "-Wzero-as-null-pointer-constant" }
struct shared_ptr
{
shared_ptr(decltype(nullptr));
};
void f()
{
shared_ptr a = 0; // { dg-warning "zero as null pointer" }
shared_ptr b(0); // { dg-warning "zero as null pointer" }
shared_ptr c{0}; ... |
google | android | constexpr-ctor6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C | 135 | utf_8 | 62820899e6279dfd377a6a3087142f68 | // PR c++/47041
// { dg-do compile { target c++11 } }
// { dg-options "-fno-elide-constructors" }
struct S
{
int i;
};
S s = S ();
|
google | android | pr51420 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr51420.C | 213 | utf_8 | 2c2fcb86bacf2403d6f3b5ff6a5bea0f | // { dg-do compile { target c++11 } }
void
foo()
{
float x = operator"" _F(); // { dg-error "was not declared in this scope" }
float y = 0_F; // { dg-error "unable to find numeric literal operator" }
}
|
google | android | vt-34102 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/vt-34102.C | 192 | utf_8 | f7319a26887a2ba156ff389654598514 | // { dg-do compile { target c++11 } }
// PR c++/34102
struct A {};
template<typename> struct B : virtual A {};
template<typename...T> struct C : B<T> {}; // { dg-error "parameter packs|T" }
|
google | android | rv4n | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/rv4n.C | 41,262 | utf_8 | a62edc9c1a131e3b238d52fd55502e46 | // 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 | variadic161 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic161.C | 1,007 | utf_8 | 50631678d1b06531a77d9034af0b9e0e | // PR c++/63139
// { dg-do compile { target c++11 } }
template<typename ...T>
struct type_list {};
template<typename ...T>
struct make_type_list
{
using type = type_list<T...>;
};
// The bug disappears if you use make_type_list directly.
template<typename ...T>
using make_type_list_t = typename make_type_list<T.... |
google | android | Wliteral-suffix | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wliteral-suffix.C | 450 | utf_8 | c47fe308b23c471e712a22bd21a1aac9 | // { dg-do run { target c++11 } }
// Make sure -Wliteral-suffix is enabled by default and
// triggers as expected.
#define BAR "bar"
#define PLUS_ONE + 1
#include <cstdint>
#include <cassert>
void
test()
{
char c = '3'PLUS_ONE; // { dg-warning "invalid suffix on literal" }
char s[] = "foo"BAR; // { dg-warn... |
google | android | constexpr-compound | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-compound.C | 133 | utf_8 | 58c6933f831d08c0381b587067ce6eb4 | // { dg-do compile { target c++11 } }
constexpr int f()
{
{ // { dg-error "" }
return 1;
}
{ } // { dg-error "" }
}
|
google | android | nolinkage1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nolinkage1.C | 370 | utf_8 | 9a44c4b3694c2695584bf19a10b2844f | // DR 757 allows using types without linkage in declarations with linkage.
// Test that this doesn't lead to link-time collisions.
// { dg-additional-sources "nolinkage1a.cc" }
// { dg-do link { target c++11 } }
#include "nolinkage1.h"
typedef struct { int i; } *AP;
void f(AP) { }
A<AP> a;
static void g()
{
str... |
google | android | pr50025 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr50025.C | 373 | utf_8 | 1f40e4b181608b5b64a0a72112394d6f | // { dg-do compile { target c++11 } }
#include <utility>
class A
{
public:
A(int a, int& b, int&& c)
: m_a{a},
m_b{b},
{}
private:
int m_a;
int& m_b;
int&& m_c;
};
struct X {};
class B
{
public:
B(X& q, X&& r, const X& s)
: m_q{q},
m_r{std::move(r)},
m_s{s}
{}
private:
X& m_q;
X&& m_r;... |
google | android | sfinae12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae12.C | 467 | utf_8 | 95a40b067cf4b2b73a7238f12661f263 | // PR c++/48535
// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T{})
>
char f(int);
template<class>
char (&f(...))[2];
struct A { virtual ~A() = 0; };
static_assert(sizeof(f<A>(0)) != 1, "Error"); // (a)
static_assert(sizeof(f<void()>(0)) != 1, "Error"); // (b)
static_assert(sizeof(f<int&>... |
google | android | new1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/new1.C | 141 | utf_8 | 4c9fa986dc7f6deef6a257359aa5e2ca | // PR c++/52216
// { dg-require-effective-target c++11 }
#include <new>
int n;
static_assert(!noexcept(::new (std::nothrow) int[n]), "");
|
google | android | decltype54 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype54.C | 575 | utf_8 | 414c8d1047f4e63f080c9effebf6da89 | // PR c++/51908
// { dg-do compile { target c++11 } }
struct foo1
{
template <typename Ret, typename... Args>
operator decltype(static_cast<Ret (*)(Args...)>(nullptr)) () const;
};
struct foo2
{
template <typename Ret, typename... Args>
operator decltype(static_cast<Ret (*)(Args... args)>(nullptr)) () const;
... |
google | android | constexpr-bitfield2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield2.C | 319 | utf_8 | 18b0f5c8eeb4a3196bc623c2fd1205ee | // PR c++/49136
// { dg-do compile { target c++11 } }
struct day
{
unsigned d : 5;
unsigned n : 3;
constexpr explicit day (int dd) : d(dd), n(7) {}
};
struct date {
int d;
constexpr date (day dd) : d(dd.n != 7 ? 7 : dd.d) {}
};
constexpr day d(0);
constexpr date dt(d);
static_assert (dt.d == 0, "Error");
|
google | android | ref-qual8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual8.C | 170 | utf_8 | 9352f10d371ed23cd75d2c19a1426a76 | // { dg-require-effective-target c++11 }
struct A
{
virtual void f() & = 0;
};
struct B: A
{
void f(); // doesn't override
};
B b; // { dg-error "abstract" }
|
google | android | pr58781 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C | 256 | utf_8 | c2caeb92016de47392b35fa937c864f8 | // PR c++/58781
// { dg-do compile { target c++11 } }
#include <cstddef>
int
operator""_s(const char32_t *a, size_t b)
{
return 0;
}
int
f()
{
using a = decltype(U"\x1181"_s);
using b = decltype(U"\x8111"_s);
using c = decltype(U" \x1181"_s);
}
|
google | android | initlist51 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist51.C | 132 | utf_8 | abd2d26d4b777b0c8e12c00766e69a53 | // PR c++/47184
// { dg-do compile { target c++11 } }
struct S
{
int a;
};
struct T
{
T(S s) {}
};
int main()
{
T t(S{1});
}
|
google | android | variadic-tuple | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C | 7,375 | utf_8 | afebb5cb3a55d32fcecd85587b287bd9 | // { dg-do run { target c++11 } }
// An implementation of TR1's <tuple> using variadic teplates
#include <string>
#include <cassert>
#include <cstring>
// Trivial reference_wrapper
template<typename T>
struct reference_wrapper
{
reference_wrapper(T& x) : ptr(&x) { }
operator T&() const { return *ptr; }
T* ptr;
};... |
google | android | constexpr-friend | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-friend.C | 652 | utf_8 | 8e9af9db3cb15de807816da0495f52c7 | // PR c++/48948
// { dg-do compile { target c++11 } }
struct A { A(); };
struct B {
friend constexpr int f(B) { return 0; } // OK
friend constexpr int f(A) { return 0; } // { dg-error "constexpr" }
};
template <class T>
struct C
{
constexpr int m(A) { return 0; } // { dg-error "double" }
};
constexpr int i = f(C<... |
google | android | initlist4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist4.C | 654 | utf_8 | 996a335929e01e19d11ef6037175bada | // Test for initializer-list 'explicit' rule
// { dg-do compile { target c++11 } }
struct A
{
explicit A(int,int);
operator bool();
};
A f(A)
{
A{1,2};
A a1{1,2};
new A{1,2};
if (A a5{1,2});
A({1,2}); // { dg-error "explicit" }
A a2({1,2}); // { dg-error "explicit" }
A a3 = {1,2}; // { dg-err... |
google | android | alias-decl-21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/alias-decl-21.C | 637 | utf_8 | 0d22c6328955844b4a0abc74fa6980c0 | // PR c++/54575
// { dg-do compile { target c++11 } }
template<typename _From, typename _To>
struct is_convertible { static const bool value = true; };
template<bool> struct enable_if { };
template<> struct enable_if<true> { typedef int type; };
template<typename _InIter>
using _RequireInputIter
= typename... |
google | android | constexpr-ref3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ref3.C | 164 | utf_8 | 52e47448fe1ed73156ebb657652051d7 | // PR c++/50298
// { dg-do compile { target c++11 } }
int global_variable;
template <class T> struct X {
static constexpr T r = global_variable;
};
X<int&> x;
|
google | android | variadic-ex11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-ex11.C | 267 | utf_8 | 331d7c95c5740090d7cb92978b8aaa2b | // { dg-do compile { target c++11 } }
template<typename... Types>
void f(Types... args);
void g() {
f(); // okay: args contains no arguments
f(1); // okay: args contains one int argument
(2, 1.0); // okay: args contains two arguments, an int and a double
}
|
google | android | variadic95 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic95.C | 269 | utf_8 | 6e58380176a6436d1efd8ba69f04b70f | // PR c++/39863
// { dg-do compile { target c++11 } }
template <typename... T>
struct A {};
template <typename T, typename U>
struct S {};
template <typename... T, typename... U>
A< S<T, U>... > f(U... u)
{ return A< S<T, U>... >(); }
int main()
{
f<int>(0.0);
}
|
google | android | inh-ctor4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor4.C | 224 | utf_8 | 071eafda7f7d2d4bff42921fbd048a45 | // From N3337
// { dg-do compile { target c++11 } }
struct B1 {
B1(int);
};
struct B2 {
B2(int = 13, int = 42);
};
struct D1 : B1 {
using B1::B1;
};
struct D2 : B2 {
using B2::B2;
};
D1 d1(1);
D2 d2a(2), d2b(3,4);
|
google | android | udlit-tmpl-parms | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-tmpl-parms.C | 98 | utf_8 | ce9cf1b6176245da0b5eaeddad6f4ec7 | // { dg-do compile { target c++11 } }
class Foo { };
template<char...>
Foo operator"" _Foo();
|
google | android | nsdmi-defer1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C | 208 | utf_8 | 8d47330d250732b4512c767f7e3de3c4 | // { dg-do compile { target c++11 } }
#define SA(X) static_assert(X,#X)
struct A
{
int i = f();
int j { f() };
static constexpr int f() { return 42; }
};
constexpr A a;
SA(a.i == 42);
SA(a.j == 42);
|
google | android | udlit-args | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-args.C | 521 | utf_8 | 9ef0b4dd1199c1515523a2bf4787c7c2 | // { dg-do compile { target c++11 } }
#include <cstddef>
class Foo { };
Foo
operator"" _Foo(const char *);
Foo
operator"" _Foo(unsigned long long int);
Foo
operator"" _Foo(long double);
Foo
operator"" _Foo(char);
Foo
operator"" _Foo(wchar_t);
Foo
operator"" _Foo(char16_t);
Foo
operator"" _Foo(char32_t);
Foo
o... |
google | android | constexpr-attribute | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-attribute.C | 1,181 | utf_8 | 0054ee3f75e70491b1d3ca96c22b785d | // { dg-do compile { target c++11 } }
//A few constexpr's
constexpr int foo() { return __alignof__(int); }
template<typename T>
constexpr int fooT() { return __alignof__(T); }
template<int N>
constexpr int fooN() { return N; }
//Now the attributes
//with normal variables,
int a __attribute__((aligned(foo())));
int... |
google | android | parse2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/parse2.C | 155 | utf_8 | a174690fe306aaf345b02df91c3ddebe | // PR c++/54526
// { dg-do compile { target c++11 } }
template <class T>
struct X { };
struct A { };
int main()
{
X<::A> x;
}
int a;
bool b = 0<::a;
|
google | android | nullptr09 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr09.C | 159 | utf_8 | ba23888c33f468a020c07f0681e9620a | // { dg-do compile { target c++11 } }
// Test compare to literal 0
void fun()
{
if( nullptr == 0 );
decltype(nullptr) mynull = 0;
if( mynull == 0 );
}
|
google | android | variadic100 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic100.C | 239 | utf_8 | 96b880605040024fe863103abac1fa81 | // PR c++/43143
// { dg-do compile { target c++11 } }
template<typename T>
T&& declval();
template<class T, class... Args>
void test() {
T t(declval<Args>()...);
}
int main() {
test<const int>(); // OK
test<int[23]>(); // Error
}
|
google | android | ref-qual-multi-neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual-multi-neg.C | 136 | utf_8 | af4673410b97bcc5393dd82a2599c2d1 | // { dg-require-effective-target c++11 }
class Foo
{
public:
void bar() const && & { } // { dg-error "multiple ref-qualifiers" }
};
|
google | android | variadic81 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic81.C | 226 | utf_8 | 8de5967c1eb71111071ca456e5d4ef90 | // PR c++/33461
// { dg-do compile { target c++11 } }
template<typename> struct A;
template<typename... T> struct A<T*> // { dg-error "not expanded|T|not used|T" }
{
struct B;
};
A<void*> a; // { dg-error "incomplete" }
|
google | android | decltype52 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype52.C | 460 | utf_8 | 93d62035309e5a9b0197c32f19717624 | // PR c++/56450
// { dg-do compile { target c++11 } }
template<typename T>
T&& declval();
template<typename, typename>
struct is_same
{ static constexpr bool value = false; };
template<typename T>
struct is_same<T, T>
{ static constexpr bool value = true; };
struct A { static const int dummy = 0; };
static_assert(... |
google | android | trailing7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/trailing7.C | 135 | utf_8 | 9905affdadeb6d7631a01a291484c542 | // PR c++/50365
// { dg-do compile { target c++11 } }
struct A { int i; };
struct B {
B();
A* f();
};
B::B()
{
int(f()->i);
}
|
google | android | defaulted16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted16.C | 220 | utf_8 | 8d364de9c1fc13848d0cb11fd0c219bf | // Test that non-inline default causes the function to be defined even if
// it isn't used.
// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZN1AC1Ev" } }
struct A
{
A();
};
A::A() = default;
|
google | android | explicit2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/explicit2.C | 499 | utf_8 | fec28f5357647ffbc93c027ac0fbf703 | // Test for explicit conversion ops in various conversion situations.
// { dg-do compile { target c++11 } }
typedef void (*pfn)();
struct A
{
explicit operator int() const;
explicit operator pfn() const;
};
int main()
{
A a;
int i = a; // { dg-error "" }
const int &ir = a; // { dg-error "" }
a(); /... |
google | android | initlist-arrray1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist-arrray1.C | 86 | utf_8 | 75dbdd73972da9a369980925ff477d9d | // { dg-do compile { target c++11 } }
typedef int IRT[2];
const IRT& ir = IRT{1,2};
|
google | android | inh-ctor2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/inh-ctor2.C | 245 | utf_8 | 69ee4b066e7054d7163a882761fcc7c7 | // { dg-do compile { target c++11 } }
struct A
{
int i;
constexpr A(int, int i = num): i(i) {}
private:
static const int num = 42;
};
struct B: A
{
using A::A;
};
constexpr B b(24);
#define SA(X) static_assert((X),#X)
SA(b.i == 42);
|
google | android | gen-attrs-25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-25.C | 214 | utf_8 | b71b52bfcd7a69c6c39dc260a3f9a222 | // PR c++/28559
// { dg-do compile { target c++11 } }
template<typename T> struct A
{
struct B;
};
struct C
{
template<typename T> friend struct [[gnu::packed]] A<T>::B; // { dg-warning "uninstantiated" }
};
|
google | android | range-for9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for9.C | 213 | utf_8 | 86400e6b8f3c57256537edf21adb96d2 | // Test for range-based for loop error in C++98 mode
// { dg-do compile }
// { dg-options "-std=c++98" }
void test()
{
int a[] = {0,1,2};
for (int x : a) // { dg-error "range-based 'for'" }
;
}
|
google | android | variadic7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic7.C | 763 | utf_8 | b57d433ff6861deeea42dc39e9d48cc2 | // { 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<>
struct tuple_base<int, float> {
static const int value = 2;
};
template<>
struct tuple_base<float, int> {
static co... |
google | android | constexpr-array2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-array2.C | 241 | utf_8 | 687c6e77d4af3cd918c0ff421773a66c | // PR c++/46348
// { dg-do compile { target c++11 } }
template<__SIZE_TYPE__ _Nw>
struct _Base
{
typedef unsigned long _WordT;
_WordT _M_w[_Nw];
constexpr
_Base()
: _M_w() { }
};
int main()
{
_Base<256> bs;
}
|
google | android | nullptr26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr26.C | 180 | utf_8 | 51ce829b6452ac82cbb285e8e4508b46 | // PR c++/51530
// { dg-do compile { target c++11 } }
template <class T, class U>
void f(T, U);
template <class T>
void f(T, decltype(nullptr));
int main()
{
f(1, nullptr);
}
|
google | android | decltype-refbug | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype-refbug.C | 324 | utf_8 | 61ab3fbe660abdfcfb4275658c81e532 | // { dg-do compile { target c++11 } }
// PR c++/33045
int && f ();
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;
};
static_assert(is_same<decltype(f()), int&&>::value, "decltype of rvalue reference... |
google | android | constexpr-eh-spec | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-eh-spec.C | 317 | utf_8 | 3b6a46c1a5699fddb411eb1188a5afbc | // { dg-do compile { target c++11 } }
template<class T> class my_limits {
public:
static constexpr T min() throw() { return T(); }
static constexpr T max() noexcept { return T(); }
};
constexpr double var_min = my_limits<double>::min(); // #1 OK
constexpr double var_max = my_limits<double>::max(); // #2 Error
|
google | android | constexpr-noexcept | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept.C | 295 | utf_8 | 6f7be3b3080e0dd97535cb517cf8b2fe | // { dg-do compile { target c++11 } }
template<class T>
struct is_funny {
static constexpr bool value = false;
};
template<class T>
constexpr T value(T t) noexcept(is_funny<T>::value) { return t; } // Line 7
constexpr bool ok = noexcept(value(42));
static_assert(ok, "Assertion failure");
|
google | android | implicit11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/implicit11.C | 420 | utf_8 | 2bbdbc1c9ea5f4a91659bc89f8ad6822 | // Test that we consider base dtors in determining whether
// a derived ctor is deleted even if the ctor is trivial.
// { dg-do compile { target c++11 } }
struct A
{
~A() = delete; // { dg-message "declared here" }
};
struct B: A { }; // { dg-error "deleted" }
extern B eb;
int main()
{
B* b1 = new B; // { dg-... |
google | android | defaulted3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted3.C | 297 | utf_8 | 5a8753b863f78415813bfe64bf544ebd | // PR c++/37006
// { dg-do compile { target c++11 } }
template<class T>
struct A {
template<class U>
bool operator==(const A<U>&) = delete; // { dg-message "declared" }
operator bool () { return true; }
};
int main()
{
A<int> a1;
A<void> a2;
if(a1 == a2) {} // { dg-error "use" }
}
|
google | android | forw_enum7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/forw_enum7.C | 503 | utf_8 | 48754cc55a4af947b24920104ba53fdf | // { dg-do compile { target c++11 } }
// { dg-options "" }
template<typename T> struct S1
{
enum E1 : int;
enum E1 : T;
enum class E2 : int;
enum class E2 : T;
};
template<typename T> enum S1<T>::E1 : int { e1 };
template<typename T> enum class S1<T>::E2 : T { e2 };
S1<int>::E1 x1 = S1<int>::e1;
S1<i... |
google | android | noexcept19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept19.C | 324 | utf_8 | 70287986d7bb5bb24bfb271fca50f6f3 | // PR c++/55652
// { dg-do compile { target c++11 } }
template <typename T>
struct A
{
static const bool a = false;
};
template <typename X, typename Y = A <X>>
struct B
{
B () noexcept (A <Y>::a) {}
};
template <typename X, typename Y>
struct C
{
X x;
Y y;
};
struct D
{
D () throw (int);
};
C <D, B <D>>... |
google | android | temp_default4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/temp_default4.C | 364 | utf_8 | 5d890c91dd1b1cce9f4ebf0285e6cc41 | // { dg-do compile { target c++11 } }
class X {
template<typename T = int> friend void f(X) { }
template<typename T> friend void g(X); // { dg-message "previously declared here" }
template<typename T = int> friend void h(X); // { dg-error "function template friend" }
};
template<typename T = int> void g(X) // {... |
google | android | range-for20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for20.C | 469 | utf_8 | fc5dc64698e20d2a9cebe70f9538336b | // PR c++/49834
// PR c++/50020
// { dg-do compile { target c++11 } }
struct A
{
template <typename T> T get_value() const;
};
struct B {
A first, second;
};
struct C
{
B* begin() const;
B* end() const;
};
template <typename Ret>
struct D
{
Ret f(const C &p)
{
for (const B &i: p) // OK
i.seco... |
google | android | sfinae14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae14.C | 437 | utf_8 | e5ffbe4ef8408755d32baa31b5db4b88 | // PR c++/48557
// { 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>())
>
ch... |
google | android | gen-attrs-2-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-2-1.C | 68 | utf_8 | 809be1d658bb584ee509c76f11dfc2d7 | // { dg-do compile { target c++11 } }
struct [[gnu::unused]] A {};
|
google | android | constexpr-decl | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C | 214 | utf_8 | a259b7f32c3d335c69d177ab19112031 | // PR c++/46930
// { dg-do compile { target c++11 } }
struct S {
static constexpr int size; // { dg-error "must have an initializer" "must have" }
};
const int limit = 2 * S::size;
constexpr int S::size = 256;
|
google | android | initlist7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist7.C | 262 | utf_8 | cbf2282d3c567b5a6052614b90bf5909 | // PR c++/37932
// { dg-do compile { target c++11 } }
typedef enum { AA=1, BB=2 } my_enum;
typedef struct { my_enum a:4 ; unsigned b:28; } stru;
void foo (char c, my_enum x, int i)
{
char arr[2] = {c+'0', 0}; // { dg-error "narrowing" }
stru s = {x,0};
}
|
google | android | initlist89 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist89.C | 85 | utf_8 | bd9a289d0125621da4bc499b31e3f4dc | // PR c++/64029
// { dg-do compile { target c++11 } }
const int (&in)[]{1,2,3,4,5};
|
google | android | udlit-overflow | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/udlit-overflow.C | 610 | utf_8 | 9c92e478321ba068f798c7804a1f8412 | // { dg-do compile { target c++11 } }
// PR c++/52654
int
operator"" _w(const char*)
{ return 0; }
template<char...>
int
operator"" _tw()
{ return 0; }
int i = 12345678901234567890123456789012345678901234567890_w;
int j = 12345678901234567890123456789.012345678901234567890e+1234567890_w;
int k = 1... |
google | android | variadic121 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic121.C | 222 | utf_8 | cd348652fa29dacb61ed968bb7390818 | // PR c++/51507
// { dg-do compile { target c++11 } }
template<typename ...>
struct foo { typedef void type; };
template<typename ...Ts>
auto g(Ts ...ts)->
typename foo<decltype(ts)...>::type
{}
int main() {
g(42);
}
|
google | android | fntmpdefarg4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg4.C | 161 | utf_8 | cf1da5498725899c52629122a71d79b9 | // PR c++/55724
// { dg-do compile { target c++11 } }
template<int N> struct S {};
template<typename T = int, T N> void f(S<N>) {}
int main() { S<1> s; f(s); }
|
google | android | static_assert10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert10.C | 187 | utf_8 | 992a322eb92eadd895a6c875f7926db6 | // PR c++/60254
// { dg-do compile { target c++11 } }
template<typename T> bool foo(T)
{
int i;
static_assert(foo(i), "Error"); // { dg-error "non-constant condition|not usable" }
}
|
google | android | constexpr-ptrmem | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem.C | 489 | utf_8 | fa7ac28bbeb7f5a520d7f5c5847dedff | // { dg-do compile { target c++11 } }
struct C { // literal type
int m;
int n;
constexpr C(int m) : m(m), n(-m) {}
constexpr bool is_neg() { return m < 0; }
};
constexpr bool check1(const C& c, int C:: *pm) { return c.*pm < 0; } // #1
constexpr bool check2(const C* pc, bool (C::*pm)() const) { return
(pc->*p... |
google | android | constexpr-data1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C | 595 | utf_8 | 427b583f9638c353d085962c8e10eac4 | // { dg-do compile { target c++11 } }
// From N2235
// 1
struct A2
{
static const int eights = 888;
static constexpr int nines = 999;
};
A2 a;
// 2
struct pixel
{
int x, y;
};
constexpr pixel ur = { 1294, 1024 }; // OK
// p4
struct Length
{
explicit constexpr Length(int i = 0) : val(i) { }
private:
int... |
google | android | gen-attrs-17.2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-17.2.C | 577 | utf_8 | 3d0e74994e5655dc1d4142a3c2938ea4 | // { dg-do compile { target c++11 } }
// Origin: Benjamin Kosnik <bkoz at gcc dot gnu dot org>
// PR c++/17743: Attributes applied to typedefs.
struct A {
typedef char layout_type[sizeof(double)]
[[gnu::aligned(alignof(double)]]); // { dg-error "expected" }
layout_type data;
};
struct B {
typedef char layout_... |
google | android | iop | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/iop.C | 1,082 | utf_8 | 21f4f71849033f886423eb33a84fe501 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test that the implicit object parameter is *not* an rvalue reference, but is instead
// identical to that specified in C++03. That is, the implicit object parameter is
// an lvalue reference that can bind to an rvalue. :-\
// See http://www.o... |
google | android | noexcept08 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/noexcept08.C | 1,051 | utf_8 | 1b515ddae33baabe404bd55c46188e82 | // { dg-do compile { target c++11 } }
// { dg-prune-output "overriding" }
struct A
{
virtual void f();
virtual void g() throw();
virtual void h() noexcept;
virtual void i() noexcept(false);
virtual void j() throw(int);
};
struct B: A
{
void f() noexcept;
void g() noexcept;
void h() noexcept;
void i(... |
google | android | sfinae23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae23.C | 582 | utf_8 | f4c9f00f2ed4be735a8e4865b41c1274 | // PR c++/48647
// { dg-do compile { target c++11 } }
template< class T >
T&& declval();
template< class T, class U >
decltype( true ? declval<T>() : declval<U>() ) test( int );
template< class T, class U >
void test( ... );
template< class T, class U >
struct is_same {
static const bool value = false;
};
templ... |
google | android | gen-attrs-13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/gen-attrs-13.C | 209 | utf_8 | 26cfeb86b211f4560fefec372d117218 | // { dg-do compile { target c++11 } }
// PR c++/13854
extern char *rindex [[gnu::__pure__]] (__const char *__s, int __c) throw ();
extern char *rindex [[gnu::__pure__]] (__const char *__s, int __c) throw ();
|
google | android | overflow1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/overflow1.C | 356 | utf_8 | 9ac544c85b4718bef7e0acbc03dd004f | // { dg-prune-output "-Woverflow" }
template <long long i>
struct Fib
{
static const long long value // { dg-error "overflow" }
= Fib<i-1>::value + Fib<i-2>::value;
};
template <>
struct Fib<0>
{
static const long long value = 0;
};
template <>
struct Fib<1>
{
static const long long value = 1;
};
int ... |
google | android | variadic-ex6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic-ex6.C | 505 | utf_8 | 0996ed5262194bcff1176ea88a7de061 | // { dg-do compile { target c++11 } }
template<class...> struct Tuple { };
template<class... Types> void f(Types&...);
template<class... Types1, class... Types2> void g(Tuple<Types1...>, Tuple<Types2...>);
void h(int x, float& y)
{
const int z = x;
f(x, y, z); // Types is deduced to int, const int, float
g(Tup... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.