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 | chromium | variadic89 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic89.C | 263 | utf_8 | e952de5f557b560e0101fa0341bf7576 | // { dg-options "-std=c++0x" }
// Contributed by Eric Niebler
template<typename T, typename U>
struct pair
{};
template<typename T>
struct test;
template<template<typename...> class T, typename... Args>
struct test<T<Args...> >
{};
test<pair<int, double> > t;
|
google | chromium | variadic69 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic69.C | 674 | utf_8 | 665d96dfa136ff270f42ff15c4021491 | // { dg-options "-std=gnu++0x" }
template<typename T>
struct stored_value
{
explicit stored_value() : value() { }
explicit stored_value(const T& value) : value(value) { }
stored_value(int, const T& value) : value(value) { }
T value;
};
template<typename... Values>
struct myclass : public stored_value<Values... |
google | chromium | inline-ns1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/inline-ns1.C | 235 | utf_8 | 42dda7ee38ea7ff6645882f3f9a6eaa0 | // { dg-options -std=c++0x }
// { dg-final { scan-assembler "_ZN1Q2V11fEv" } }
// { dg-final { scan-assembler "_ZN1Q2V11iE" } }
namespace Q {
inline namespace V1 {
extern int i;
void f();
}
}
int Q::i = 1;
void Q::f() { }
|
google | chromium | variadic24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic24.C | 158 | utf_8 | 7ee5e10d775f659b178e9e2605776202 | // { dg-options "-std=gnu++0x" }
template<typename T, T... Values>
struct vector_c { };
vector_c<int, 17, 42> intvec;
vector_c<char, 'a', 'b', 'c'> charvec;
|
google | chromium | constexpr-47570 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-47570.C | 637 | utf_8 | 74a06f703b7ba2281124727e56df9417 | // PR c++/47570
// { dg-options -std=c++0x }
unsigned int constexpr one()
{ return 1; }
int constexpr one_B()
{ return 1; }
int main()
{
// FAIL TO COMPILE:
static bool constexpr SC_huh1 = ((unsigned int)one()) >= ((unsigned int)0);
static bool constexpr SC_huh2 = one() >= ((unsigned int)0);
static bool cons... |
google | chromium | variadic35 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic35.C | 333 | utf_8 | c349c0d2ffaa2cc1e53502a9c7b06159 | // { dg-options "-std=gnu++0x" }
template<int I, typename... Args>
void get_ith(const Args&... args); // { dg-message "note" }
void f()
{
get_ith<1, float>(1, 2.0, 'x');
get_ith<1, int, double, char, int>(1, 2.0, 'x'); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *... |
google | chromium | noexcept14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept14.C | 101 | utf_8 | a5c672bc03f870a600eeea5d5341666e | // PR c++/50309
// { dg-options -std=c++0x }
void foo () noexcept () { } // { dg-error "expected" }
|
google | chromium | decltype-33837 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype-33837.C | 182 | utf_8 | 9a0ace8a7ebbf5d7255b172011b808ca | // { dg-options -std=c++0x }
// PR c++/33837
void foo()
{
__decltype (A::foo()); // { dg-error "was not declared|expected" }
__decltype (B); // { dg-error "was not declared" }
}
|
google | chromium | variadic3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic3.C | 142 | utf_8 | a0fc4b5dd9895b5fe6a68628d4db6380 | // { dg-options "-std=gnu++0x" }
template<typename... Args>
class tuple {};
void f()
{
tuple<> x;
tuple<int> y;
tuple<int, float> z;
}
|
google | chromium | initlist25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist25.C | 248 | utf_8 | 5673b623874e372b643d0dac08b0caa4 | // PR c++/41754
// { dg-options -std=c++0x }
// { dg-do run }
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main()
{
map<string, string> m;
m.insert({{"t", "t"}, {"y", "y"}});
return 0;
}
|
google | chromium | constexpr-ptrmem | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem.C | 480 | utf_8 | eda4b62c9724e8778fe6183ee0352351 | // { dg-options -std=c++0x }
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->*pm)(); } /... |
google | chromium | constexpr-noexcept3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept3.C | 152 | utf_8 | f002ff2a43ccb5d4c585585c9a07bc06 | // { dg-options -std=c++0x }
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 | chromium | initlist54 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist54.C | 139 | utf_8 | 007b58d8351fd150489aa9178e600f74 | // PR c++/49355
// { dg-options -std=c++0x }
#include <string>
struct T {
std::string foobar;
};
int main()
{
T* x = new T({""});
}
|
google | chromium | constexpr-46336 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-46336.C | 350 | utf_8 | db6c8715fba011a5ced47ca1680fbd25 | // PR c++/46336
// { dg-options -std=c++0x }
extern "C" {
enum A { };
inline constexpr A
f(A a, A b) // { dg-error "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_cast<int>(a)... |
google | chromium | constexpr-98 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-98.C | 140 | utf_8 | 2487c5d7e1bc3d844b8e2e8d0988b4c8 | // { dg-options "-std=c++98" }
constexpr int i = 42; // { dg-message "std=c\\+\\+0x" }
// { dg-error "constexpr" "" { target *-*-* } 3 }
|
google | chromium | constexpr-bitfield2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield2.C | 333 | utf_8 | f3a8f831c847ad3fceac01f82a21a879 | // PR c++/49136
// { dg-do compile }
// { dg-options "-std=c++0x" }
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 == ... |
google | chromium | variadic67 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic67.C | 516 | utf_8 | 73d538726d20c793ad5bb11ff74edfb9 | // { dg-options "-std=gnu++0x" }
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>
{
static co... |
google | chromium | initlist58 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist58.C | 167 | utf_8 | beff6d7eaa0b46ec867e1ef610104128 | // PR c++/50209
// { dg-options -std=c++0x }
struct S { int i,j; };
struct A
{
static void f (S = {1,2});
};
void f (S = {3,4});
int main()
{
A::f();
f();
}
|
google | chromium | variadic50 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic50.C | 150 | utf_8 | b2b9d3b9454eacd2fabfc51ba4493191 | // { dg-options "-std=gnu++0x" }
int& f(int, double, ...);
template<typename... Args>
float& f(Args...);
float& g() {
return f(17, 3.14159, 3);
}
|
google | chromium | rv5n | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv5n.C | 30,881 | utf_8 | aadf854e9457e7a741755277b858bb7b | // I, Howard Hinnant, hereby place this code in the public domain.
// Test overload resolution among reference types
// { dg-do compile }
// { dg-options "-std=c++0x" }
template <bool> struct sa;
template <> struct sa<true> {};
struct one {char x[1];};
struct two {char x[2];};
struct three {char x[3];};
struct ... |
google | chromium | nullptr01 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr01.C | 214 | utf_8 | df7390e08ffa68c7677abb541132fcc1 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test assignment to pointer
char* const cp1 = nullptr;
char* const cp2 = __null;
char* const cp3 = 0;
decltype(nullptr) mynull = 0;
char* const cp4 = mynull;
|
google | chromium | variadic11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic11.C | 494 | utf_8 | fd232fd0f9ee4ead299f8f5377eacce2 | // { dg-options "-std=gnu++0x" }
template<typename...> struct count;
template<>
struct count<> {
static const int value = 0;
};
template<typename T, typename... Args>
struct count<T, Args...> {
static const int value = 1 + count<Args...>::value;
};
int a0[count<>::value == 0? 1 : -1];
int a1[count<char>::value =... |
google | chromium | pr31444 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31444.C | 216 | utf_8 | ccea62e27b41f0e0b3068f61e335c3dd | // { dg-options "-std=gnu++0x" }
template<typename... T> struct A
{
template<int> void foo(A<T>); // { dg-error "not expanded|T" }
};
void bar()
{
A<int>().foo<0>(A<int>()); // { dg-error "no member named" }
};
|
google | chromium | auto25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto25.C | 206 | utf_8 | 1b4d411e0873628f284a469bff8a5357 | // PR c++/42056
// { dg-options -std=c++0x }
template<int> struct A
{
int a[auto(1)]; // { dg-error "invalid use of" }
};
template<int> void foo()
{
int a[auto(1)]; // { dg-error "invalid use of" }
}
|
google | chromium | sfinae6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae6.C | 554 | utf_8 | 7907c8aaa5fcdd95b8e28f7b36c484c3 | // PR c++/48113
// { dg-options -std=c++0x }
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple, int);
};
typedef void (*F2)(tuple, int);
template<typename F, typename T>
struct Bind
{
template<typename A,
typename R = decltype( F()(declval<T&>(), A()) )>
... |
google | chromium | variadic22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic22.C | 653 | utf_8 | 3154647a4e099200d85e6844bce83814 | // { dg-options "-std=gnu++0x" }
template<typename R, typename... ArgTypes>
struct make_function_type
{
typedef R type(ArgTypes... args);
};
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;
};
int a... |
google | chromium | constexpr-auto | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-auto.C | 55 | utf_8 | 9e93d0f870ae3baf869dba4392527e07 | // { dg-options -std=c++0x }
constexpr auto value = 0;
|
google | chromium | noexcept10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept10.C | 779 | utf_8 | 4acfc9c98359f7a2c7143d7b972feeb1 | // PR c++/49082
// { dg-options -std=c++0x }
namespace std { template <class T> T&& declval() noexcept; }
struct Base
{
Base(const Base&) noexcept(false);
Base(Base&&) noexcept(false);
~Base() noexcept(false);
};
struct Derived
: Base
{
// Derived(const Derived&) = default;
// Derived(Derived&&) = default;
... |
google | chromium | decltype24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype24.C | 145 | utf_8 | 334f46b8deea685fcfa11ad093f3e293 | // PR c++/47068
// { dg-options -std=c++0x }
template <class T> struct broken {
int member;
typedef decltype(~ member) gcc_crashes_here;
};
|
google | chromium | initlist51 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist51.C | 123 | utf_8 | 8b982dae3079700b67aa9c8d922c1ba6 | // PR c++/47184
// { dg-options -std=c++0x }
struct S
{
int a;
};
struct T
{
T(S s) {}
};
int main()
{
T t(S{1});
}
|
google | chromium | nullptr08 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr08.C | 270 | utf_8 | 2ef238631e5ceff6076573ffea954f55 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test conversion to bool
#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
void fun()
{
assert_true(nullptr ? false : true);
decltype(nullptr) mynull = 0;
assert_true(mynull ? false : true);
}
|
google | chromium | static_assert3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert3.C | 235 | utf_8 | 39aac1aa4533674e2379b90b1c0ffd39 | // { dg-options "-std=c++0x" }
static_assert(7 / 0, "X"); // { dg-error "non-constant condition" }
// { dg-warning "division by zero" "" { target *-*-* } 2 }
// { dg-error "7 / 0.. is not a constant expression" "" { target *-*-* } 2 }
|
google | chromium | override2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/override2.C | 1,451 | utf_8 | ba134d988930ffb34cefee425471e8b9 | // { dg-do compile }
// { dg-options "--std=c++0x" }
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... |
google | chromium | constexpr-pure | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-pure.C | 107 | utf_8 | 9d861584f527e8491e79f1252428d170 | // { dg-options -std=c++0x }
struct A
{
virtual void f() = 0;
};
struct B: A
{
void f() { }
};
B b;
|
google | chromium | variadic16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic16.C | 682 | utf_8 | 5e1e29412f063305c242c74862e86181 | // { dg-options "-std=gnu++0x" }
template<typename R, typename... ArgTypes>
struct make_function_type
{
typedef R type(const ArgTypes&... args);
};
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;
};... |
google | chromium | nullptr19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr19.C | 562 | utf_8 | 1c4862396eed5e8cd94f78552b2c2157 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test overload of pointer versus nullptr_t when applied on a literal 0/__null
typedef decltype(nullptr) nullptr_t;
char* k( char* ); /* { dg-message "note" } { dg-message "note" } */
nullptr_t k( nullptr_t ); /* { dg-message "note" } { dg-message "note" } */
voi... |
google | chromium | template_deduction | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/template_deduction.C | 1,909 | utf_8 | e8d578309780ddc5af6d9210b37bb985 | // 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 }
// { dg-options "-std=c++0x" }
template <bool> struct sa;
template <> struct sa<true> {};
template <class T, T v>
struct integral... |
google | chromium | variadic59 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic59.C | 194 | utf_8 | 0cb58621c4a73b547de0ab5d24561cf5 | // { dg-options "-std=gnu++0x" }
template<class T, typename... VarArgs>
void print(T t, VarArgs args); // { dg-error "packs not expanded" }
// { dg-message "VarArgs" "note" { target *-*-* } 3 }
|
google | chromium | range-for1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for1.C | 271 | utf_8 | edffb4150e3adee1e7286e8172cde88a | // Test for range-based for loop
// Test the loop with an array
// { dg-do run }
// { dg-options "-std=c++0x" }
extern "C" void abort();
int main()
{
int a[] = {1,2,3,4};
int sum = 0;
for (int x : a)
sum += x;
if (sum != 10)
abort();
}
|
google | chromium | pr32253 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32253.C | 146 | utf_8 | 631cf47a14c5117c15a4729a3a035270 | // { dg-options "-std=c++0x" }
template<void (*... fp)()> struct A
{
A() { fp(); } // { dg-error "not expanded|fp" }
};
void foo();
A<foo> a;
|
google | chromium | vt-34052 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34052.C | 310 | utf_8 | f4757749a592f130d579f6b7e524b3ac | // { dg-options "-std=c++0x" }
template<typename... T, typename = T> struct A {}; // { dg-error "must be at the end" }
template<template<typename... T, typename = T> class U> struct B // { dg-error "must be at the end" }
{
template<int> U<int> foo(); // { dg-error "mismatch|constant|invalid|invalid" }
};
|
google | chromium | decltype25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype25.C | 442 | utf_8 | a6abf5662acc84062e82eb56907ef0fe | // PR c++/47851
// { dg-options -std=c++0x }
struct Type {
void display_type();
void display_type() const { }
};
typedef Type const ConstType;
struct ConvertibleToType {
operator Type&() { return *reinterpret_cast<Type*>(this); }
};
int main ()
{
// Both lines should call the const variant.
(true ? Conv... |
google | chromium | defaulted16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted16.C | 211 | utf_8 | 11478a6c72233b1dacef61b97f5b22b5 | // Test that non-inline default causes the function to be defined even if
// it isn't used.
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "_ZN1AC1Ev" } }
struct A
{
A();
};
A::A() = default;
|
google | chromium | nullptr05 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr05.C | 258 | utf_8 | fbe05e0ff591ef5a22ab5bf5c60b1719 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test assignment to method pointer
class F { };
typedef void (F::*pmf)();
const pmf pmf1 = nullptr;
const pmf pmf2 = __null;
const pmf pmf3 = 0;
decltype(nullptr) mynull = 0;
const pmf pmf4 = mynull;
|
google | chromium | constexpr-ellipsis | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis.C | 177 | utf_8 | e2f337595fe7ae26ef6d4de30ca7c6df | // { dg-options -std=c++0x }
constexpr int ellipsis(...) { return 1; }
constexpr int ellipsis_c = ellipsis(); // OK
constexpr int ellipsis_c2 = ellipsis(42); // Internal error
|
google | chromium | range-for11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for11.C | 744 | utf_8 | a43a2150a453437cee0ac6cce7297b02 | // Test for range-based for loop
// Test the loop with a custom iterator
// with begin/end as member functions
// { dg-do compile }
// { dg-options "-std=c++0x" }
struct iterator
{
int x;
explicit iterator(int v) :x(v) {}
iterator &operator ++() { ++x; return *this; }
int operator *() { return x; }
... |
google | chromium | variadic29 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic29.C | 1,042 | utf_8 | c7c53f1a850486e6679090c2406b30b6 | // { dg-options "-std=gnu++0x" }
template<typename Signature>
struct function_traits;
template<typename R, typename... ArgTypes>
struct function_traits<R(ArgTypes...)> {
typedef R result_type;
};
template<typename R, typename Class, typename... ArgTypes>
struct function_traits<R (Class::*)(ArgTypes...)> {
typedef... |
google | chromium | variadic31 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic31.C | 162 | utf_8 | a0cb6e68b1cfeaadc0b19b00952e76cb | // { dg-options "-std=gnu++0x -g" }
template<typename... T>
void eat(T...) { }
void f()
{
eat();
eat(1);
eat(1, 2);
eat(17, 3.14159, "Hello, World!");
}
|
google | chromium | enum12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum12.C | 341 | utf_8 | 33527222e2a50ff406930713f995ad72 | // PR c++/48780
// { dg-options "-std=c++0x -fabi-version=0" }
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
enum struct A : short { X };
void foo(int x, ...) {
va_list vl;
__builtin_va_start(vl, x);
enum A t = __builtin_va_arg(vl, enum A);
__builtin_va_end(vl);
}
int main() ... |
google | chromium | vt-34919 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34919.C | 171 | utf_8 | 183cc4d67f7796c4c307c41f08be2743 | // { dg-options "-std=c++0x" }
template<int... N> struct A
{
static void foo()
{
int i = N; // { dg-error "not expanded|N" }
}
};
void bar()
{
A<0>::foo();
}
|
google | chromium | defaulted10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted10.C | 272 | utf_8 | db2dbc4e9f3a2de5270ea2c8f43ce4dc | // PR c++/40381
// { dg-options "-std=gnu++0x" }
struct A
{
template<typename T> void foo(T) = delete; // { dg-error "previously|declared" }
};
template<typename T> void A::foo(T) {} // { dg-error "redefinition" }
void bar()
{
A().foo(0); // { dg-error "use" }
}
|
google | chromium | unnamed_refs | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/unnamed_refs.C | 632 | utf_8 | e5dcb7c6e84b72d8ab922243c5aba4a1 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test: Unamed rvalue references are treated as lvalues.
// { dg-do compile }
// { dg-options "-std=c++0x" }
template <bool> struct sa;
template <> struct sa<true> {};
struct one {long x[1];};
struct two {long x[2];};
struct A {};
one foo(con... |
google | chromium | constexpr-access | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-access.C | 125 | utf_8 | 4cb951c081437722059f146e60b61e87 | // { dg-options -std=c++0x }
class base
{
protected:
constexpr base() { }
};
struct A : base { };
int main()
{
A a;
}
|
google | chromium | sfinae10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae10.C | 466 | utf_8 | 1505df4f7642b3f99d75bbddaed8bb82 | // PR c++/48452
// { dg-options -std=c++0x }
namespace std {
template <class T> T&& declval();
}
template<class T, class... Args>
decltype(T(std::declval<Args>()...), char()) f(int);
template<class, class...>
char (&f(...))[2];
struct A { virtual ~A() = 0; };
struct B {};
static_assert(sizeof(f<A, int, int>(0)) !... |
google | chromium | constexpr-empty2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-empty2.C | 173 | utf_8 | 1bb1dc580fdf99a367fb5fc78c58f4fc | // { dg-options -std=c++0x }
struct IsLiteral {};
constexpr IsLiteral bar(IsLiteral x) { return x; }
constexpr auto xy = bar(IsLiteral()); // #1 Error, but should be OK
|
google | chromium | noexcept06 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept06.C | 422 | utf_8 | 0d04bd28bf8368f7d59ed778cb841156 | // Test that checking of a nothrow specification uses the one on the
// definition.
// { dg-options "-std=c++0x" }
// { dg-do run }
#include <exception>
#include <cstdlib>
void my_unexpected ()
{
std::abort ();
}
void my_terminate ()
{
std::exit (0);
}
void f() throw();
void f() noexcept
{
throw 1;
}
int main... |
google | chromium | variadic94 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic94.C | 411 | utf_8 | 102cfb8090ee7187ab5a236addf1729f | // PR c++/40595
// { dg-options "-std=c++0x" }
template<int N>
struct S
{
typedef int type;
};
template<typename T>
struct Get
{
static T get();
};
template<typename F>
struct B
{
template<typename ... Args>
typename S<sizeof( Get<F>::get() (Get<Args>::get() ...) )>::type
f(Args&& ... a);... |
google | chromium | decltype18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype18.C | 103 | utf_8 | 5619cfac0fb1689f9ed6c8d79af2b5ef | // PR c++/37875
// { dg-options "-std=c++0x" }
template <typename> struct X {};
X<decltype(1 > 2)> x;
|
google | chromium | pr47416 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr47416.C | 6,654 | utf_8 | f8501576adbf12fdc30727f9c7555548 | // PR c++/47416
// { dg-do compile }
// { dg-options "-std=c++0x" }
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... |
google | chromium | auto1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto1.C | 201 | utf_8 | 41dfdfa19c5e84ceb06e83606870ff86 | // { dg-options "-std=c++98 -Wc++0x-compat" }
// Test warning for use of auto in C++98 mode with C++0x
// compatibility warnings
void f()
{
auto int x = 5; // { dg-warning "will change meaning" }
}
|
google | chromium | enum2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum2.C | 142 | utf_8 | a8073df4790689eb8b20d4a6f09abde1 | // PR c++/38637
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<int> enum E : int { e }; // { dg-error "declaration|expected" }
|
google | chromium | initlist17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist17.C | 169 | utf_8 | 004e7811473ceaa407f8771893e5bf26 | // { dg-options "-std=c++0x -pedantic-errors" }
void f(int i);
int main()
{
f({42.0}); // { dg-error "narrowing" }
return {1.0}; // { dg-error "narrowing" }
}
|
google | chromium | pr32126 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32126.C | 233 | utf_8 | 17104ea84b98016b8357de7549d60372 | // { dg-options "-std=c++0x" }
template<typename...> struct A;
template<typename...T> struct A<T> // { dg-error "not expanded|T|" }
{
static int i;
};
A<char> a; // { dg-error "incomplete" }
A<int> b; // { dg-error "incomplete" }
|
google | chromium | variadic99 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic99.C | 389 | utf_8 | 470db33a4456887435103b14a30791ec | // PR c++/43054
// { dg-options "-std=c++0x" }
template<typename R> struct future { };
template<typename Fn, typename... Args>
auto
async(Fn&& fn, Args&&... args)
-> future<decltype(fn(args...))>;
template<typename Fn, typename... Args>
auto
async(Fn&& fn, Args&&... args)
-> future<decltype(fn(args...))>;
int... |
google | chromium | array1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/array1.C | 214 | utf_8 | 856b860dd19d706d19e674559f8d904a | // PR c++/47808
// { dg-options -std=c++0x }
template <typename T>
inline T abs (T const & x) { return x; }
template <typename T>
void f (T)
{
typedef int ai[(abs(0.1) > 0) ? 1 : -1];
}
int main()
{
f(1);
}
|
google | chromium | abi-empty7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/abi-empty7.C | 531 | utf_8 | e10b8d7abe2cf26f4ef135bb96da2634 | // Copy of abi/empty7.C.
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-require-effective-target ilp32 }
// { dg-options "-fabi-version=0 -std=c++0x" }
struct S1 {};
struct S2 { virtual void f () {} S1 s1[4]; };
struct S3 : virtual public S2 {};
struct S4 : virtual public S2 { int i; };
struct S5 : public S3,... |
google | chromium | ctor1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/ctor1.C | 198 | utf_8 | 5dcc9ba1eda77af2ea4304c7ea0400e2 | // PR c++/49569
// { dg-options -std=c++0x }
struct A
{
virtual void f() = 0;
};
struct B: A
{
int i;
virtual void f() { }
};
struct C
{
B b;
C(): b() { }
C(const B& b): b(b) { }
};
|
google | chromium | isnan | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C | 124 | utf_8 | 1bb5909249def6c2e93803055f5f9a18 | // PR c++/48369
// { dg-options -std=gnu++0x }
extern "C" int isnan (double);
void f(double d)
{
bool b = isnan(d);
}
|
google | chromium | regress5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress5.C | 131 | utf_8 | 2c4203c3adeb82876bf1e147b6749fe3 | // { dg-options -std=c++0x }
struct A
{
int i;
A(int);
};
struct B
{
virtual void f();
A ar[3];
};
extern B b;
B b2(b);
|
google | chromium | template-function1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/template-function1.C | 896 | utf_8 | 5e54749e6f262c628ce03df0d95f44b3 | // PR c++/38647
// { dg-do compile }
// { dg-options "-std=c++0x" }
// { dg-prune-output "note" }
template<const char *, int> struct A {};
const char func[] = "abc";
template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" }
char a1[1];
A<a1, 0> a;
template<const... |
google | chromium | debug-debug7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/debug-debug7.C | 313 | utf_8 | 8d5e44c8f1e0021dd48a579a9b338864 | // { dg-do compile }
// { dg-options -std=c++0x }
void f (int);
int
main() {
int a = 4;
int b = 5; // { dg-message "not const" }
int (*x)[b] = new int[a][b]; // { dg-error "not usable" }
x[2][1] = 7;
for (int i = 0; i < a; ++i)
for (int j = 0; j < b; ++j)
f (x[i][j]);
delete [] x;
}
|
google | chromium | value-dep1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/value-dep1.C | 109 | utf_8 | d880abf23fe0f8b1ab0c8d585c1eabd6 | // PR c++/48265
// { dg-options -std=c++0x }
template < int > struct S
{
S () { const int i = i; i; };
};
|
google | chromium | ext-cond1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/ext-cond1.C | 107 | utf_8 | d95b2a2af55954793b549a4d00240a9b | // PR c++/12515
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<int> void foo() { 0 ?: 0; }
|
google | chromium | call1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/call1.C | 323 | utf_8 | efac571fbbd72c7eedc3215dc2610ddc | // PR c++/48500
// { dg-options -std=c++0x }
struct linked_ptr {
};
template <typename T> linked_ptr make_linked_ptr(T* ptr);
struct Concrete;
struct NewedClass {
NewedClass(const Concrete& req){}
};
template<typename ArgT> void AddObjToChange(const ArgT& req) {
linked_ptr p = make_linked_ptr(new NewedClass(req));... |
google | chromium | bitfield-err1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/bitfield-err1.C | 118 | utf_8 | 16e0a97296cbb2c3604a02cbd6d4c1cc | // PR c++/46282
// { dg-options -std=c++0x }
template<int>
class A
{
A : i() {} // { dg-message "" }
int i;
};
|
google | chromium | ext-label10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/ext-label10.C | 327 | utf_8 | 4426dd1674bbe6783ce96905d0d7fb18 | // PR c++/33836
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<int N> struct A
{
enum { M = && N }; // { dg-error "referenced outside|cannot appear in|not an integer constant" }
};
A<0> a;
void foo ()
{
__label__ P;
enum { O = && P }; // { dg-error "cannot appear in|not an integer constant" }
... |
google | chromium | regress1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress1.C | 210 | utf_8 | 9743e4cc1871fcdb27d4b36cc33a7692 | // PR c++/46903
// This isn't C++0x code, but it was breaking in C++0x mode.
// { dg-options -std=c++0x }
struct A {};
struct B {
void *(*a)();
};
template <typename T> void *CreateA() {}
B b = {CreateA<A>};
|
google | chromium | regress4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress4.C | 887 | utf_8 | fc2d828002f3cb434b92d6999093bcaa | // PR c++/49663
// { dg-options -std=c++0x }
struct Nosm
{
int m_R;
};
namespace dx {
struct onc
{
typedef void(*Cb)();
onc(Cb cb);
};
struct grac
{
template<class Derived> static void once();
};
template<class Derived>
struct tonc : onc
{
... |
google | chromium | error-recovery1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C | 225 | utf_8 | e4856a0acc422ab95c1762e3c584e040 | // PR c++/48212
// { dg-options -std=c++0x }
template < bool > void
foo ()
{
const bool b =; // { dg-error "" }
foo < b > (); // { dg-error "constant expression" }
};
// { dg-error "no match" "" { target *-*-* } 8 }
|
google | chromium | ptrmem1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/ptrmem1.C | 147 | utf_8 | 66de7d1cc98f329f0b205efae01b8fb9 | // PR c++/49298
// { dg-options -std=c++0x }
template <class T, int T::*> struct B { };
template <class T> struct A
{
int i;
B<A,&A::i> b;
};
|
google | chromium | regress3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress3.C | 210 | utf_8 | c1fd509e03391eadcb0ef7187eea46a2 | // PR c++/47511
// { dg-options -std=c++0x }
namespace N {
template <typename T> bool g( T ) {
return true;
}
struct A { };
}
template <class T> void f(const T&) {
N::A x;
g(x) ;
}
|
google | chromium | no-elide1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/no-elide1.C | 150 | utf_8 | 3137780cc5862b21db3ef77df7035aee | // PR c++/47503
// { dg-options "-std=c++0x -fno-elide-constructors" }
struct A
{
int i;
A ();
};
struct B
{
A a;
B (A &aa) : a (aa) { }
};
|
google | chromium | condition1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/condition1.C | 1,707 | utf_8 | 3baff7365db545d4656c58bbfd4a6075 | // PR c++/47950
// { dg-options -std=c++0x }
template <typename T> struct empty
{
// allow success case to build (not relevant to bug)
operator bool() { return true; }
};
template <typename T> struct from_int
{
from_int(int) {}
// allow success case to build (not relevant to bug)
operator bool() { ret... |
google | chromium | regress2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress2.C | 124 | utf_8 | b463fb2bda36791e4ba8c73fe3672a4d | // PR c++/46552
// { dg-options -std=c++0x }
struct S
{
int x;
};
template < typename >
void f( void )
{
&S::x;
}
|
google | chromium | template-const2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/template-const2.C | 190 | utf_8 | cc7ce767124c4feb9f89cd36abd864bb | // PR c++/48707
// { dg-options -std=c++0x }
struct A {
static int a();
};
template<typename X>
struct B: A {
static int const b;
};
template<typename X>
int const B<X>::b=B<X>::a();
|
google | chromium | enum1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/enum1.C | 110 | utf_8 | 7446cf50692efcd9ead395daf97e7a21 | // PR c++/47482
// { dg-options -std=c++0x }
template<class>
struct K
{
enum { A = sizeof"A", B = +A };
};
|
google | chromium | regress6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/regress6.C | 125 | utf_8 | 3e2558d5f2ec920f2dd79565b9419a4f | // PR c++/49691
// { dg-options -std=c++0x }
struct A { int x; };
A* f();
struct B {
void g()
{
int(f()->x);
}
};
|
google | chromium | non-const1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/non-const1.C | 151 | utf_8 | 1032fded885a55c363b6f98c07fb2252 | // PR c++/48015
// { dg-options -std=c++0x }
template <typename T> T f(T);
template <typename T> void g()
{
int const c = f (1);
int i = c - 0;
}
|
google | chromium | parse-ambig5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/parse-ambig5.C | 145 | utf_8 | 475c7301acea31119470ef0084b6a2d7 | // PR c++/41786
// { dg-options -std=c++0x }
struct A { A(int, char const*); };
int main() {
int i = 0, *b = &i;
A a(int(b[i]), "hello");
}
|
google | chromium | template-const1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/regress/template-const1.C | 155 | utf_8 | e5e170663432c0a1b2e253fbc6c724e4 | // PR c++/47897
// { dg-options -std=c++0x }
template < typename T, T N >
struct S
{
static const T value = N;
typedef S< T, value + 1 > next;
};
|
google | chromium | lambda-ref-default | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C | 207 | utf_8 | 1c8ff3c470a354b483ecd257a3ce332b | // { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
int main() {
int i = 1;
float j = 2.0;
[&] () -> void { i = 3; j = 4.0; } ();
assert(i == 3);
assert(j == 4.0);
return 0;
}
|
google | chromium | lambda-conv | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C | 308 | utf_8 | 4597babb4f0ac0bfbeb695817891b020 | // Test for conversion from stateless lambda to function pointer.
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZZ1fvENKUlvE_cvPFvvEEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin *-*-hpux10* } } } } }
inline void f()
{
void (*pfn)() = []{};
}
int main()
{
f();
}
|
google | chromium | lambda-const | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C | 446 | utf_8 | 10a07890295f88529ef6d9d5c0733160 | // { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
template<typename F>
void call(const F& f) { f(); }
int main() {
call([] () -> void {});
//call([] () mutable -> void {}); // { dg-error: "`f' does not have const `operator()'" }
int i = -1;
call([&i] () -> void { i = 0; });
assert(i == 0)... |
google | chromium | lambda-nested3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested3.C | 127 | utf_8 | fc8b20e80b7a3acae5bba366690c4d56 | // PR c++/41896
// { dg-options "-std=c++0x" }
void nested_lambda()
{
float val;
[val]()
{
[val](){};
};
}
|
google | chromium | lambda-deduce-ext | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce-ext.C | 428 | utf_8 | 385bcf6a13e8ad52b68b6b9a7b4ef2b6 | // Testcase for an extension to allow return type deduction when the lambda
// contains more than just a single return-statement.
// { dg-options -std=c++0x }
// { dg-do run }
bool b;
template <class T>
T f (T t)
{
return [=] {
auto i = t+1;
if (b)
return i+1;
else
return i+1;
}();
}
int ... |
google | chromium | lambda-warn1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-warn1.C | 134 | utf_8 | e5d9bc4382de815656e63a304d1fec6c | // PR c++/41920
// { dg-options "-std=c++0x -Wall -Wextra" }
int foo(int i)
{
auto bar = [=](){ return i; };
return bar();
}
|
google | chromium | lambda-switch | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-switch.C | 354 | utf_8 | 56bd211474cf91f523f453555f6eb049 | // PR c++/49867
// { dg-options -std=c++0x }
int
main ()
{
void (*l)();
while (true)
{
switch (3)
{
struct A {
void f()
{
case 4: // { dg-error "case" }
break; // { dg-error "break" }
}
};
l = []()
{
case 3: // { dg-error "case" }
break; // { dg-e... |
google | chromium | lambda-copy-neg | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-neg.C | 252 | utf_8 | 8484c1d108792ca45278c563b7ee4ce4 | // { dg-options "-std=c++0x" }
int main() {
int i;
const char* s;
[i, s] () -> void { i; s; } ();
[] () -> void { i; } (); // { dg-error "" "`i' is not captured" }
[1] () -> void {} (); // { dg-error "expected identifier" }
return 0;
}
|
google | chromium | lambda-pass | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C | 418 | utf_8 | 80c65dd7b2e3c9f25b1983ac66332449 | // { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
#include <algorithm>
template <typename F, typename A1>
void call(F f, const A1& arg1) {
f(arg1);
}
int main() {
int i = 1;
call(
[&i] (int j) -> void { i = j; },
2
);
assert(i == 2);
int A[] = {1, 2, 3, 4};
int sum = 0;
... |
google | chromium | lambda-mangle | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C | 3,460 | utf_8 | 558c31d302dbde20ef0062655103ef9f | // Test lambda mangling
// { dg-require-weak "" }
// { dg-options "-std=c++0x -fno-inline" }
template<typename F> int algo(F fn) { return fn(); }
inline void g(int n) {
int bef(int i = []{ return 1; }());
// Default arguments of block-extern function declarations
// remain in the context of the encloding functio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.