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 | initlist20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist20.C | 226 | utf_8 | f5ab523f7fe16d4a14ebcb230b425677 | // PR c++/40689
// { dg-options "-std=c++0x" }
class X
{
public:
X(): data {1,2,3,4,5} {}
private:
const short data[5];
};
int main()
{
const float * pData = new const float[4] { 1.5, 2.5, 3.5, 4.5 };
return 0;
}
|
google | chromium | constexpr-template2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-template2.C | 184 | utf_8 | 4bb3cfc75a235b33f98f8f995f9a11fd | // { dg-options -std=c++0x }
template <class T> struct A
{
T t;
constexpr A() { } // { dg-error "uninitialized" }
};
int main()
{
constexpr A<int> a; // { dg-error "A()" }
}
|
google | chromium | constexpr-decl | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-decl.C | 275 | utf_8 | 7b1de6080b411be7acbe074da724a67d | // PR c++/46930
// { dg-options -std=c++0x }
struct S {
static constexpr int size; // { dg-error "must have an initializer" }
// { dg-error "previous declaration" "" { target *-*-* } 5 }
};
const int limit = 2 * S::size;
constexpr int S::size = 256; // { dg-error "" }
|
google | chromium | enum3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum3.C | 415 | utf_8 | d18a2ee75ecb03343f31ac5c959cab8b | // PR c++/38064
// { dg-options "-std=c++0x" }
// { dg-do run }
enum class E { elem };
template <class T>
void f (T t);
bool f (bool b) { return b; }
int main()
{
E e = E::elem;
if (!f (e == E::elem))
return 1;
if (!f (e <= E::elem))
return 1;
if (!f (e >= E::elem))
return 1;
if (f (e < E::ele... |
google | chromium | variadic-ex2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ex2.C | 265 | utf_8 | 2ca8c6c22acd958766719aa6c0406373 | // { dg-options "-std=gnu++0x" }
template<class... Types> struct B { // { dg-error "declaration of" }
void f3();
void f4();
};
template<class... Types> void B<Types...>::f3() { } // OK
template<class... Types> void B<Types>::f4() { } // { dg-error "invalid" }
|
google | chromium | constexpr-48089 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C | 1,366 | utf_8 | 44671fd82bd0376039df1979646d917f | // PR c++/48089
// { dg-options -std=c++0x }
// bang is ill-formed (diagnostic required) because its initializer is
// non-constant, because it uses the value of an uninitialized object.
// s() is ill-formed (no diagnostic required) because there is no set of
// arguments that would produce a constant expression.
//... |
google | chromium | sfinae15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae15.C | 190 | utf_8 | c07c46fdb87a0aa518cee5260b079302 | // PR c++/48531
// { dg-options -std=c++0x }
template<class T,
class = decltype(T())
>
char f(int);
template<class>
char (&f(...))[2];
static_assert(sizeof(f<int[]>(0)) != 1, "Error");
|
google | chromium | variadic85 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic85.C | 308 | utf_8 | a59ffa4f8dc05fcd24d3389f80b307f6 | // PR c++/32565
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<typename...> struct A1;
template<template<int, int...> class T> struct A1<T<0, 1> > {};
template<int, int, int...> struct B1 {};
A1<B1<0, 1> > a1;
template<int...> struct B2 {};
A1<B2<0, 1> > a2; // { dg-error "incomplete type" }
|
google | chromium | constexpr-static4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static4.C | 217 | utf_8 | 37c75de93052b335724605cb1baeccbf | // { dg-options -std=c++0x }
// { dg-do run }
extern "C" void abort ();
extern int ar[2];
int f()
{
if (ar[0] != 42 || ar[1] != 0)
abort ();
return 1;
}
int i = f();
int ar[2] = { 42, i };
int main()
{
}
|
google | chromium | initlist35 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist35.C | 231 | utf_8 | 9017d741a2a3053aab3a63bdc3efb7ac | // PR c++/41510
// { dg-options "-std=c++0x" }
struct B
{
B(int, int);
};
struct A
{
A(int, int);
A(const B&);
};
void f()
{
A a = { 1, 2 };
};
template <class T> void g()
{
A a = { 1, 2 };
};
template void g<int>();
|
google | chromium | vt-34050 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34050.C | 117 | utf_8 | 13506aee1ac7be5174781e30985c4074 | // { dg-options "-std=c++0x" }
struct A {};
template<typename... T> struct B : T...
{
B() : T()... {}
};
B<A> b;
|
google | chromium | initlist34 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist34.C | 218 | utf_8 | 4fe14835cecc211f0680a8bbbf46f17d | // PR c++/44157
// { dg-options "-std=c++0x" }
#include <initializer_list>
template<typename T>
void f(T) { }
int main() {
std::initializer_list<int> a = { 0 };
f(a);
f<std::initializer_list<int> >({ 0 });
}
|
google | chromium | static_assert4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert4.C | 331 | utf_8 | 822fb1324c32059c620a31a887c0a851 | // { dg-options "-std=c++0x --param ggc-min-heapsize=0 --param ggc-min-expand=0 " }
// PR C++/30033
// Make sure that the static assert does not crash the GC.
template <class T>
struct default_delete
{
void
operator() (T * ptr) const
{
static_assert (sizeof (T) > 0, "Can't delete pointer to incomplete type")... |
google | chromium | decltype12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype12.C | 1,073 | utf_8 | a6caab75327a934c0a5cc960aa8a5451 | // { dg-do compile }
// { dg-options "-std=c++0x" }
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&& f(const int&) {}
int&& (*fp)(const int&) = f;
int&& (&fr)(const int&) = f;
struct X { int&... |
google | chromium | constexpr-nonlit2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit2.C | 266 | utf_8 | abdc62172146eb977bd6999da07217e6 | // { dg-options -std=c++0x }
struct A
{
~A();
};
template<class T>
struct W {
T t;
template<class U>
constexpr W(U&& u) : t(u) {}
};
template <class T>
constexpr W<T> make_w(T& w) { return W<T>(w); }
A a;
constexpr auto w = make_w(a); // { dg-error "" }
|
google | chromium | enum_base | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum_base.C | 765 | utf_8 | 0da5e64b4ad2e2d41e648440cc17438b | // { dg-options "-std=c++0x" }
typedef unsigned volatile long long uvlonglong;
enum E1 : char { };
enum E2 : signed const short { };
enum E3 : uvlonglong { };
enum E4 : char {
val = 500 // { dg-error "too large" }
};
enum class E5 {
val = (unsigned long long)-1 // { dg-error "too large" }
};
typedef float Floa... |
google | chromium | variadic28 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic28.C | 910 | utf_8 | b1f604bc250da0eaa40101ceadc8384b | // { 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 T, typename U>
struct same_type {
static const bool value = false;
};
template<typename T>
struc... |
google | chromium | scoped_enum | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/scoped_enum.C | 1,511 | utf_8 | 612e05e223838493ac0b89f8846fef6a | // { dg-options "-std=c++0x" }
enum class Color1 {
Red,
Green,
Blue
};
enum struct Color2 {
Red, // { dg-error "previously declared here" }
Orange,
Yellow,
Green,
Blue,
Indigo = Green + 2,
Violet,
Red // { dg-error "redefinition" }
};
enum Color {
Red, Green, Blue
};
enum class Color3 {
Re... |
google | chromium | variadic40 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic40.C | 122 | utf_8 | 9b07b326741489bb12551a4d16285daf | // { dg-options "-std=gnu++0x" }
template<typename... Values, typename T>
struct backward_tuple {}; // { dg-error "end" }
|
google | chromium | variadic-bind | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C | 12,171 | utf_8 | 3b0861d70d90d86a9c405a8e4158e2a0 | // { dg-do run }
// { dg-options "-std=gnu++0x" }
// A basic implementation of TR1's bind using variadic teplates
#include <cassert>
// Trivial reference_wrapper
template<typename T>
struct reference_wrapper
{
reference_wrapper(T& x) : ptr(&x) { }
operator T&() const { return *ptr; }
T& get() const { return *p... |
google | chromium | vt-34051 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34051.C | 177 | utf_8 | f396e2178ea8dfa6db0847bf75d89371 | // { dg-options "-std=c++0x" }
struct A
{
operator int();
};
template <typename... T> struct B : A
{
using A::operator T; // { dg-error "parameter packs|T" }
};
B<int> b;
|
google | chromium | nullptr12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr12.C | 258 | utf_8 | 7871ee870c34082c13b2495793d076ba | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test sizeof
static_assert(sizeof(nullptr) == sizeof(void*), "sizeof(nullptr) is wrong");
const decltype(nullptr) mynull = 0;
static_assert(sizeof(mynull) == sizeof(void*), "sizeof(nullptr) is wrong");
|
google | chromium | extern_template-2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/extern_template-2.C | 104 | utf_8 | 524d40ced067adb49fe43e140a933167 | // { dg-options "-std=c++0x -pedantic" }
template <typename> class S {};
extern template class S<int>;
|
google | chromium | initlist36 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist36.C | 344 | utf_8 | 1a6befdc11b7e39445c33e3c4dd97a92 | // PR c++/44358
// { dg-options "-std=c++0x -pedantic-errors" }
#include <initializer_list>
struct A
{
A(int);
};
struct B
{
B(std::initializer_list<A>);
};
void f (B b);
int main()
{
B b0 = {{1}};
B b1 = {{1.0}}; // { dg-error "narrowing" }
B b2 {1.0}; // { dg-error "narrowing" }
A a {1.0}; // { d... |
google | chromium | implicit5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit5.C | 295 | utf_8 | e1e552bc678025fb4098bb57cd8285a0 | // Test that the default B copy constructor calls the A member template
// constructor.
// { dg-options -std=c++0x }
struct A
{
A() = default;
A(A&&) = default;
template <class T>
A(const T& t) { t.i; } // { dg-error "no member" }
};
struct B: A { };
int main()
{
B b;
B b2(b);
}
|
google | chromium | trailing4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/trailing4.C | 346 | utf_8 | 4e81fe5045e63c6c5026150e4f2649dd | // PR c++/38597
// { dg-options "-std=c++0x" }
template<class T, class U>
auto f(T,U) -> decltype(T() + U())
{ return T() + U(); }
template<class T> void g(T){} // { dg-message "note" }
int main() { g(f); } // { dg-error "no matching function" }
// { dg-message "(candidate|deduce template parameter)" "candidate not... |
google | chromium | constexpr-noexcept4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept4.C | 333 | utf_8 | 528909a47f36014557199b9b236004d2 | // { dg-options -std=c++0x }
// 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)));
SA(noexcep... |
google | chromium | pr31434 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31434.C | 325 | utf_8 | 21ade74b56174dc769ca41654a88175a | // { dg-options "-std=gnu++0x" }
template<typename... T> int foo(const T&) // { dg-error "not expanded with|T" }
{
union { T t; }; // { dg-error "not expanded with|T" }
return t;
}
void bar()
{
foo(0); // { dg-error "no matching" }
// { dg-message "(candidate|cannot convert)" "candidate note" { target *-*-* } 10... |
google | chromium | bracket3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/bracket3.C | 294 | utf_8 | 4859776496a16f821d24207a79fe1ecc | // { dg-options "-std=c++98 -Wc++0x-compat" }
template<int N> struct X {};
X<1 >> 2> x; // { dg-warning "will be treated as|suggest parentheses" }
// From cp/parser.c
typedef int Y;
template <int V> struct Foo {};
Foo<Y () >> 5> r; // { dg-warning "will be treated as|suggest parentheses" }
|
google | chromium | constexpr-bitfield3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-bitfield3.C | 693 | utf_8 | 325875d62eecf7afea8933cbc36014d2 | // PR c++/49136
// { dg-do compile }
// { dg-options "-std=c++0x" }
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.... |
google | chromium | vt-34102 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34102.C | 185 | utf_8 | 3a065f914060d8463e7e7daebd9c6675 | // { dg-options "-std=c++0x" }
// PR c++/34102
struct A {};
template<typename> struct B : virtual A {};
template<typename...T> struct C : B<T> {}; // { dg-error "parameter packs|T" }
|
google | chromium | constexpr-49776 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-49776.C | 226 | utf_8 | 60542c48326c95c025dfcfb84ceefe07 | // PR c++/49776
// { dg-options -std=c++0x }
struct s
{
int i[1];
template<class... Types>
constexpr s(Types... args)
: i{args...} // { dg-error "cannot convert" }
{ }
};
int main()
{
s test = nullptr;
}
|
google | chromium | variadic97 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic97.C | 693 | utf_8 | 6ac2c115c6c3e36d564f67f9f523e946 | // PR c++/42266
// { dg-options -std=c++0x }
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, typename
... |
google | chromium | defaulted21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted21.C | 284 | utf_8 | 2ef2ed4d1fbba456199f0033b2d694d5 | // PR c++/46736
// { dg-options -std=c++0x }
struct U {
U();
U(U const&);
};
struct X {
U const u;
X();
X(X&&);
};
X::X(X&&)=default; // { dg-error "implicitly deleted" }
// { dg-error "does not have a move constructor" "" { target *-*-* } 15 }
X f() {
return X();
}
|
google | chromium | variadic91 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic91.C | 363 | utf_8 | e837ebebcf5da91989eb888432453fbc | // { dg-options "-std=c++0x" }
template<int N> struct Int2Type { };
template<typename... T>
struct Outer {
template<typename... U>
void foo(Int2Type<sizeof...(T)>, Int2Type<sizeof...(U)>);
};
Outer<short, int, long> outer;
void g4() {
outer.foo<float, double>(Int2Type<3>(), Int2Type<2>());
}
template<typenam... |
google | chromium | overloadn | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/overloadn.C | 12,637 | utf_8 | 1863b97caeb292de6e6b68e3e7a72e51 | // { dg-options "--std=c++0x" }
// { dg-do link }
// 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; } // rv... |
google | chromium | variadic20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic20.C | 1,625 | utf_8 | d4bb1c9f166dca09f1b8d10618a70c57 | // { dg-options "-std=gnu++0x" }
template<typename T> struct add_pointer;
template<typename T> struct add_reference;
template<template<class T> class... Metafunctions>
struct metatuple {
static const int value = 0;
};
template<>
struct metatuple<add_pointer> {
static const int value = 1;
};
template<template<cla... |
google | chromium | vt-35026 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-35026.C | 127 | utf_8 | b4fbdd94060b76da05b2f89b9716aff5 | // { dg-options "-std=c++0x" }
template<typename... T> struct A
{
T* x[1]; // { dg-error "parameter packs|T" }
};
A<int> a;
|
google | chromium | constexpr-array-ptr2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr2.C | 466 | utf_8 | 77c3bf1692d1ee1371f35cec44f07c32 | // { dg-options -std=c++0x }
template<class T>
struct IsNegative {
int dummy; // Workaround for empty class problem
constexpr IsNegative() : dummy(0) {}
constexpr bool operator()(const T& x) {
return x < T(0);
}
};
template<class T, int N, class Pred>
constexpr bool has_neg(T (&x)[N], Pred p) {
return p... |
google | chromium | constexpr-ice | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C | 240 | utf_8 | 5e230a674df46369d9735da9de5933f4 | // We used to crash on this instead of giving a decent error.
// { dg-options -std=c++0x }
struct A { int i; };
struct B {
const A *a;
constexpr B(const A& a): a(&a) { }
};
constexpr B b{A{42}}; // { dg-error "constant|expansion" }
|
google | chromium | constexpr-empty4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-empty4.C | 959 | utf_8 | 32ec0ae1767bcff3feda729f8dd46aea | // { dg-options -std=c++0x }
typedef decltype(sizeof(char)) size_type;
template<class T, size_type N, class Pred>
constexpr size_type do_find_if_or_stop(T (&x)[N], size_type i, Pred p);
template<class T, size_type N, class Pred>
constexpr size_type do_find_if(T (&x)[N], size_type i, Pred p) {
return p(x[i]) ? i : ... |
google | chromium | range-for19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for19.C | 183 | utf_8 | eecc078ffe8294fd42a669a1e20d168d | // PR c++/49838
// { dg-do compile }
// { dg-options "-std=c++0x" }
int main()
{
auto a; // { dg-error "no initializer" }
for(auto i: a) // { dg-error "deduce" }
;
}
|
google | chromium | vt-34219 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34219.C | 411 | utf_8 | e5ded9c4f13f4299049548f36f36d958 | // { dg-options "-std=c++0x" }
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;
};
static const... |
google | chromium | rv-reinterpret | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-reinterpret.C | 169 | utf_8 | 02ab2ee7cc221d0f5f3f7599f4e93dbd | // { dg-options -std=c++0x }
// { dg-do run }
void f(int &);
void f(int &&ir) { ir = 42; }
int main()
{
int x;
f(reinterpret_cast<int&&>(x));
return (x != 42);
}
|
google | chromium | defaulted14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted14.C | 464 | utf_8 | 046818f15515e346a16b9078fe7427b1 | // PR c++/39866
// { dg-options "-std=c++0x" }
struct A {
A& operator=(const A&) = delete; // { dg-bogus "" }
void operator=(int) {} // { dg-message "" }
void operator=(char) {} // { dg-message "" }
};
struct B {};
int main()
{
A a;
a = B(); // { dg-error "no match" }
// { dg-message "candidate" "candi... |
google | chromium | initlist14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist14.C | 386 | utf_8 | a0b38c8d622f08dce2118eb927a56b1f | // 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-options "-std=c++0x" }
#include <initializer_list>
struct string
{
string (const char *);
};
template <class T>
struct vector
{
template <class U>
vector (std... |
google | chromium | constexpr-function3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C | 557 | utf_8 | 1f78e4ee03b368f77ff952e8b51259f2 | // { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
// function template 1
template<typename T>
constexpr int bytesize(T t)
{ return sizeof (t); } // OK
char buf[bytesize(0)]; // OK -- not C99 VLA
// function template 2
template<typename _Tp>
constexpr _Tp
square(_Tp x) { re... |
google | chromium | variadic-crash1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-crash1.C | 1,264 | utf_8 | 09d0cfdb30531a4ad803dbcbe2f0a1cd | // { dg-options "-std=gnu++0x" }
#define ONE
#define TWO
#define THREE
struct Something {};
Something ___;
template <class F>
struct Trial
{
F f;
public:
Trial() : f() {}
Trial( const F& ff ) : f(ff) { }
template <typename... Args>
struct Sig { typedef int ResultType; };
template <typename... Args>
struct Si... |
google | chromium | vt-35243 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-35243.C | 149 | utf_8 | c17adb75d5e2cdfccd2e7026ebde629d | // { dg-options "-std=c++0x" }
struct A {};
template<typename... T> struct B : T...
{
B() : T(x)... {} // { dg-error "not declared" }
};
B<A> b;
|
google | chromium | auto22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto22.C | 338 | utf_8 | 33e42f0827353a8bf3819dd214a6a9a0 | // PR c++/47999
// { dg-options -std=c++0x }
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[])
{
f... |
google | chromium | constexpr-array | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array.C | 188 | utf_8 | a556f31ce06eec3fb6233e54f8d075bf | // { dg-options -std=c++0x }
// { dg-final { scan-assembler-not "static_initialization" } }
struct A
{
int i;
constexpr A(): i(0) { }
};
struct B
{
A a[4];
};
extern const B b{};
|
google | chromium | vt-34051-2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34051-2.C | 164 | utf_8 | 0d6427afeff9588163ff9bf8ed7970ea | // { dg-options "-std=c++0x" }
template<typename... T> struct A
{
int i __attribute__((aligned(__alignof(T)))); // { dg-error "parameter packs|T" }
};
A<int> a;
|
google | chromium | variadic33 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic33.C | 280 | utf_8 | 2b52a6e1e9ef08cf89b472a1d06d0487 | // { dg-options "-std=gnu++0x" }
void print_all() {}
template<typename T, typename... Rest>
void print_all(const T& t, const Rest&... rest)
{
print_all(rest...);
}
void f()
{
print_all();
print_all(1);
print_all(1, 3.14159);
print_all("Hello, World!", 17, 3.14159);
}
|
google | chromium | constexpr-memfn1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C | 318 | utf_8 | 34c3af53313dddf0c2446a5041f5eea7 | // PR c++/48296
// { dg-options -std=c++0x }
struct X
{
constexpr X() { }
constexpr X f(X x) { return x; }
constexpr X g(X x);
};
constexpr X X::g(X x) { return x; }
struct Y
{
Y() { }
constexpr Y f(Y y); // { dg-error "not a literal type" }
static constexpr Y g(Y y) {} // { dg-error "constexpr" }
};
|
google | chromium | variadic30 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic30.C | 156 | utf_8 | 0f676242a5f210ef183912aaa80606dd | // { dg-options "-std=gnu++0x" }
template<typename... T>
void eat(T...);
void f()
{
eat();
eat(1);
eat(1, 2);
eat(17, 3.14159, "Hello, World!");
}
|
google | chromium | decltype13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype13.C | 393 | utf_8 | 1d189249b7e9ebf527c0d549b552ef29 | // PR c++/34269
// { dg-do compile }
void
f1 ()
{
__decltype; // { dg-error "expected" }
}
void
f2 ()
{
__decltype (; // { dg-error "expected" }
}
void
f3 ()
{
__decltype (); // { dg-error "expected" }
}
void
f4 ()
{
__typeof__; // { dg-error "expected" }
}
void
f5 ()
{
__typeof__ (; // { dg-error "e... |
google | chromium | variadic106 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic106.C | 275 | utf_8 | c58788f95da16add6e9eaa00de2f9846 | // Origin: PR c++/47326
// { dg-options "-std=c++0x" }
// { dg-do compile }
template <int _N>
struct A
{
typedef int value_type;
};
template <typename... _ARGS>
auto
f (_ARGS... args) -> typename A<sizeof...(args)>::value_type
{
return 12;
}
int
main()
{
f(1,2);
}
|
google | chromium | variadic-new2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C | 265 | utf_8 | bcc81b3d6db26366e3d6762ff28dced8 | // { dg-do run }
// { dg-options "-std=c++0x" }
// PR c++/32597
#include <assert.h>
#include <new>
template< class... Args > void f( Args... args )
{
{
int x = 17;
(void)x;
}
{
int y(args...);
assert(y == 0);
}
}
int main()
{
f();
}
|
google | chromium | constexpr-using2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-using2.C | 296 | utf_8 | 2298e2e34ada9e8b8cb9ac123d538fb8 | // PR c++/49520
// { dg-options -std=c++0x }
namespace x { void foo(); }
template<typename T>
struct traits
{
static constexpr bool f() { return true; }
static constexpr bool g()
{
using x::foo;
return f() && noexcept(foo());
}
};
template struct traits<int>;
|
google | chromium | constexpr-array-ptr3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr3.C | 407 | utf_8 | aa54c5902a9d9548b6e01f91c2a4859d | // { dg-options -std=c++0x }
constexpr bool is_negative(int x) {
return x < 0;
};
constexpr bool do_has_neg(const int* x, bool(*p)(int)) {
return p(x[0]) || p(x[1]); // Line 6
}
constexpr bool has_neg(const int (&x)[2], bool(*p)(int)) {
return do_has_neg(x, p); // Line 10
}
constexpr int a[] = {1, -2};
conste... |
google | chromium | constexpr-base2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-base2.C | 185 | utf_8 | e8b32df4ca8e1919e99a1bbf8d9208ab | // PR c++/46293
// { dg-options -std=c++0x }
struct A
{
};
struct C
{
int i;
constexpr C(int i): i(i) {}
};
struct B: A, C
{
constexpr B(): A(), C(42) { }
};
constexpr B b{};
|
google | chromium | range-for17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for17.C | 298 | utf_8 | 80a5e93ee87e848fda6edf673cff6ccd | // { dg-options -std=c++0x }
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 | chromium | variadic74 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic74.C | 742 | utf_8 | 74270e3d26f0eb4b8d346509e6794d94 | // { dg-options "-std=gnu++0x" }
template <class... Types> class A
{
public:
template <Types... Values> class X { /* ... */ }; // { dg-error "not a valid type for a template constant parameter" }
};
template<class... Types> class B
{
public:
template <Types*... Values> class X {
typename A<Types*...>::templat... |
google | chromium | enum17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum17.C | 464 | utf_8 | 366127817ed249e734c8240648919022 | // PR c++/48536
// { dg-options "-std=c++0x -pedantic-errors" }
#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 equiv... |
google | chromium | range-for20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for20.C | 460 | utf_8 | caca15a2b2f571ece3809cdff8f9d7c6 | // PR c++/49834
// PR c++/50020
// { dg-options -std=c++0x }
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.second.get_va... |
google | chromium | enum18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum18.C | 147 | utf_8 | 96f064b57a9747912f56ab170241407f | // PR c++/47277
// { dg-options -std=c++0x }
int main(void) {
enum e {};
e ev;
ev.e::~e_u(); // { dg-error "e_u. has not been declared" }
}
|
google | chromium | constexpr-ctor2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor2.C | 118 | utf_8 | 8ebcf2664e60d97bd74533e4495efbe3 | // { dg-options -std=c++0x }
struct A
{
A();
};
struct B : A
{
constexpr B(): A() { } // { dg-error "A::A" }
};
|
google | chromium | range-for9 | .C | native_client/pnacl-gcc/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 | chromium | scoped_enum_examples | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/scoped_enum_examples.C | 675 | utf_8 | 37da2abad6e3096ddafcb34050f6a4d6 | // { dg-do compile }
// { dg-options "-std=c++0x" }
enum class Col { red, yellow, green };
int x = Col::red; // { dg-error "cannot convert" }
Col y = Col::red;
void f()
{
if (y) { } // { dg-error "could not convert" }
}
enum direction { left='l', righ... |
google | chromium | range-for3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for3.C | 705 | utf_8 | 1d67612408d08c763f0c7be2dc632bf2 | // Test for range-based for loop
// Test the loop with a custom iterator
// with begin/end in std
// { 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; }
bool operat... |
google | chromium | implicit11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit11.C | 428 | utf_8 | 5c20d2cec35eeffeb424f6a0c170c2ed | // Test that we consider base dtors in determining whether
// a derived ctor is deleted even if the ctor is trivial.
// { dg-options -std=c++0x }
struct A
{
~A() = delete; // { dg-error "declared here" }
};
struct B: A { }; // { dg-error "deleted" }
extern B eb;
int main()
{
B* b1 = new B; // { dg-error "use ... |
google | chromium | explicit2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit2.C | 492 | utf_8 | f939780fc764dd8358d6428391d8f6fd | // Test for explicit conversion ops in various conversion situations.
// { dg-options "-std=c++0x" }
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(); // { dg-... |
google | chromium | nsdmi1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi1.C | 661 | utf_8 | d7882e917337a6dc32163a99fe241240 | // { dg-do run }
// { dg-options -std=c++0x }
struct A
{
int i = 42;
};
struct B
{
int i = 42;
B() { }
B(int i): i(i) { }
};
template <class T, T t>
struct C
{
T m = t;
};
template <class T, T t>
struct D
{
T m = t;
D() { }
D(T m):m(m) { }
};
int main()
{
A a1;
if (a1.i != 42) return 1;
A a2 ... |
google | chromium | range-for16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for16.C | 469 | utf_8 | 0038fdd5f2436198e3a18202ba2debfc | // Test for range-based for loop with arrays of
// incomplete type or unknown size
// { dg-do compile }
// { dg-options "-std=c++0x" }
extern int a[10];
extern int b[];
struct S;
extern S c[10];
extern S d[];
void test()
{
for (int n : a);
for (int n : b); // { dg-error "incomplete type" }
for (S &n : c... |
google | chromium | constexpr-rom | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-rom.C | 274 | utf_8 | ddedb6b3885984f1c8c1e4a42f9ba333 | // PR c++/49673: check that test_data goes into .rodata
// { dg-options -std=c++0x }
// { dg-final { scan-assembler "rodata" { target { *-*-linux-gnu || *-*-elf } } } }
struct Data
{
int i;
constexpr Data(int i = 0) : i(i+1) {}
};
extern const Data test_data = { 1 };
|
google | chromium | variadic36 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic36.C | 427 | utf_8 | 1b855022d31b131d1921bedf205f407f | // { dg-options "-std=gnu++0x" }
template<typename T, typename... Args>
void f(const T&, const Args&... args)
{
f(args); // { dg-error "packs not expanded" }
}
template<typename... Values>
struct tuple_base { };
template<typename... Values>
struct tuple : tuple_base<Values> { }; // { dg-error "packs not expanded" }... |
google | chromium | rv-func | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-func.C | 424 | utf_8 | 11bf17c5b1e23634a2c4e9efe180d2ef | // PR c++/48457, Core 1238
// { dg-options -std=c++0x }
template<class T>
T&& create();
template<class T, class Arg>
void test() {
T t(create<Arg>());
(void) t;
}
void f (void (&)());
void f (void (&&)());
int main() {
test<void(&)(), void()>();
test<void(&&)(), void()>();
// This call should choose the l... |
google | chromium | variadic4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic4.C | 482 | utf_8 | 874e124d1552d6e04add0b9e1b3670e6 | // { dg-options "-std=gnu++0x" }
// { dg-do compile }
template<typename... Args>
class tuple {};
void f_none(tuple<>) {}
void f_one(tuple<int>) {}
void f_two(tuple<int, float>) {}
void f_nested(tuple<int, tuple<double, char>, float>) { }
// { dg-final { scan-assembler "_Z6f_none5tupleIIEE" } }
// { dg-final { scan-a... |
google | chromium | sfinae1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae1.C | 208 | utf_8 | b4553a0f8f15cbb12176392650d9ecb2 | // { dg-options "-std=c++0x" }
template< typename T_VECTOR >
void f(const T_VECTOR &a, decltype(a[0]) t = 0);
template< typename T >
void f(const T &a, decltype(a*1) t = 0);
int main() {
int c;
} |
google | chromium | constexpr-ctor3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor3.C | 105 | utf_8 | 2921954a73d5c5721b085869dcf5b5f2 | // PR c++/46348
// { dg-options -std=c++0x }
struct A
{
int arr[1];
constexpr A()
: arr() { }
};
|
google | chromium | nsdmi-defer4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C | 225 | utf_8 | 8d582ecca9e7ab6e5af1da89de2432e0 | // { dg-options -std=c++0x }
// { dg-do run }
struct A
{
int i = 42;
int j = f();
int k = this->f();
int f() { return i++; }
};
A a;
int main()
{
if (a.j != 42 || a.k != 43 || a.i != 44)
__builtin_abort();
}
|
google | chromium | constexpr-incomplete1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete1.C | 126 | utf_8 | a9c5117641e2a6b68b8a2abe2a27ed1a | // { dg-options -std=c++0x }
struct A
{
static constexpr A a = 1; // { dg-error "incomplete" }
constexpr A(int i) { }
};
|
google | chromium | constexpr-targ | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C | 202 | utf_8 | 1801f53f145e6bb98c5e60e8c6c9d8e0 | // { dg-options -std=c++0x }
struct A
{
constexpr operator double() { return 1.0; }
};
template <int I>
struct B
{ };
constexpr A a { };
B<a> b; // { dg-error "template argument|invalid type" }
|
google | chromium | variadic79 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic79.C | 247 | utf_8 | 015c7cc1d96ec32be3f13d07eb7cb911 | // PR c++/33213
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<template<typename> class...> struct A;
template<template<typename...> class... B> struct A<B...> {}; // { dg-error "mismatch|'template<class ...> class ... B ...'" }
|
google | chromium | range-for12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for12.C | 2,081 | utf_8 | 86b9b8365f9eb9839fbd0c0fa8473faa | // Test for range-based for loop with templates
// and begin/end as member functions
// { dg-do run }
// { dg-options "-std=c++0x" }
/* Preliminary declarations */
namespace pre
{
struct iterator
{
int x;
explicit iterator (int v) :x(v) {}
iterator &operator ++() { ++x; return *this; }
int operator ... |
google | chromium | variadic64 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic64.C | 509 | utf_8 | 89ef3e309c7cd1d8b72de2f9c1a46ba8 | // { dg-options "-std=gnu++0x" }
template<int... Indexes>
struct _Index_tuple { };
template<int _Num, typename _Tuple = _Index_tuple<> >
struct _Build_index_tuple;
template<int _Num, int... _Indexes>
struct _Build_index_tuple<_Num, _Index_tuple<_Indexes...> >
: _Build_index_tuple<_Num - 1,
... |
google | chromium | variadic80 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic80.C | 513 | utf_8 | 570af29c30773e0480c5685e60440d61 | // PR c++/31434
// { dg-do run }
// { dg-options "-std=c++0x" }
extern "C" void abort ();
template<typename... T> inline int foo (const T...) { return 1; }
template<typename... T> inline int foo (const T *...) { return 2; }
void
bar (int *a)
{
a[0] = foo (0);
a[1] = foo (*a);
a[2] = foo<int> (a);
a[3] = foo<... |
google | chromium | syntax-err1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/syntax-err1.C | 163 | utf_8 | b55fa8553dfd9334b7c134dfc87e211d | // PR c++/47198
// { dg-options -std=c++0x }
struct S
{
template < int > sometype foo (); // { dg-error "sometype. does not name a type" }
S () = default;
};
|
google | chromium | constexpr-diag3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-diag3.C | 1,200 | utf_8 | a9a925c2650a13a1eff9b3e2dfeb3d20 | // PR c++/45923
// { dg-options -std=c++0x }
int f(int);
template <class T>
constexpr T g(T t) { return f(t); } // { dg-error "f.int" }
int main()
{
constexpr int i = g(1); // { dg-error "g.T" }
}
// --------------------
struct complex // { dg-message "no constexpr constructor" }
{
complex(double r, double ... |
google | chromium | enum20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum20.C | 106 | utf_8 | 9beff7ab26dc0851c19db4790deb4e47 | // PR c++/47635
// { dg-options -std=c++0x }
enum A { };
void A::f() { } // { dg-error "not a class" }
|
google | chromium | variadic102 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic102.C | 241 | utf_8 | 6a5f8e1238977ed2ff38f73424862533 | // { dg-options "-std=c++0x" }
struct nAny {
template<class... T>
nAny(T&&...);
};
template<class T>
T&& create();
template<class T, class... Args>
void test() {
T t(create<Args>()...);
(void) t;
}
int main() {
test<nAny>();
}
|
google | chromium | override3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/override3.C | 398 | utf_8 | d2a1963e44488193e2d5ae183c548b2d | // { dg-do compile }
// { dg-options "--std=c++98" }
struct B final {}; // { dg-warning "override controls" }
struct D : B {}; // { dg-error "cannot derive from 'final' base" }
struct E __final {};
struct F : E {}; // { dg-error "cannot derive from 'final' base" }
struct G
{
virtual void f();
};
struct H : G
{
... |
google | chromium | nsdmi-defer2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer2.C | 106 | utf_8 | 040b44a384bf30c083809241406c889b | // { dg-options -std=c++0x }
struct A
{
int i = f();
static int f(int i = 42) { return i; }
};
A a;
|
google | chromium | forw_enum8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C | 658 | utf_8 | 15c79fda2214e84475bb341def367618 | // { dg-do compile }
// { dg-options "-std=c++0x" }
//This instatiation is ok
template<typename T> struct S1
{
enum E : int;
enum E : T;
};
template struct S1<int>; //ok
//This error is diagnosed at instantiation time
template<typename T> struct S2
{
enum E : int; // { dg-error "previous definition" }
... |
google | chromium | constexpr-throw | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-throw.C | 229 | utf_8 | 073877c0f17d1d119a359d495a52a784 | // { dg-options -std=c++0x }
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 | chromium | implicit7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit7.C | 571 | utf_8 | e73d80d28ad8eca17a78b55e8fa14fcd | // PR c++/44909
// { dg-options -std=c++0x }
// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>,
// which means choosing a ctor for C<B<E>>, which meant considering
// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing
// a ctor for A<D<E>>. Cycle.
template<typename T>
st... |
google | chromium | error1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/error1.C | 255 | utf_8 | 609d70ad463c19840a3dde6aff121c32 | // PR c++/34395
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<int... N> void foo (int... x[N]) // { dg-error "int \\\[N\\\]\\.\\.\\. x" }
{
struct A
{
A () { x; } // { dg-error "use of parameter from containing function" }
};
}
|
google | chromium | pr32128 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32128.C | 206 | utf_8 | 29f37e487774452598f03757fd3d598a | // { dg-options "-std=c++0x" }
template<typename...> struct A;
template<typename...T, typename...U>
struct A<T..., U...> {}; // { dg-error "must be at the end" }
A<int> a; // { dg-error "incomplete" }
|
google | chromium | constexpr-switch2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-switch2.C | 287 | utf_8 | 57a7885b330c25b62a3c4cf2ebdb0426 | // Test for constexpr conversion in case context
// { dg-options -std=c++0x }
enum class E { e1, e2 };
struct A
{
E e;
constexpr operator E() { return e; }
constexpr A(E e): e(e) { }
};
E e;
int main()
{
switch (e)
{
case A(E::e1):
case A(E::e2):
;
}
}
|
google | chromium | initlist1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist1.C | 1,029 | utf_8 | 92f9edf7e87f0820e6cef61451c12789 | // Basic uses of initializer lists
// { dg-do run }
// { dg-options "-std=c++0x" }
#include <initializer_list>
extern "C" void abort();
using namespace std;
struct A { int i,j; A(int _i,int _j): i(_i), j(_j) {} };
struct B { A a; B(A _a): a(_a) {} };
struct C { B b; C(B _b): b(_b) {} };
struct D
{
int ia[3];
D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.