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 | constexpr-overflow | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-overflow.C | 269 | utf_8 | d0c5d8700240f096e9dbc99b2aafe71d | // { dg-options "-std=c++0x -w" }
#include <limits.h>
extern constexpr int max_s = INT_MAX + 1; // { dg-error "" }
extern constexpr unsigned max_u = UINT_MAX + 1u; // OK
extern constexpr int abs_s = -INT_MIN; // { dg-error "" } overflows on 2's complement machines
|
google | chromium | defaulted6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted6.C | 197 | utf_8 | d55216a62be51ae4ddecbd573454b5cd | // PR c++/37906
// { dg-options "-std=c++0x" }
struct b
{
b() = default;
b(const b&) = delete;
};
void test01()
{
static_assert(__has_trivial_constructor(b), "default ctor not trivial");
}
|
google | chromium | defaulted3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted3.C | 288 | utf_8 | c261c0f3e1abf5767b8f123c287ef4ea | // PR c++/37006
// { dg-options "-std=c++0x" }
template<class T>
struct A {
template<class U>
bool operator==(const A<U>&) = delete; // { dg-error "declared" }
operator bool () { return true; }
};
int main()
{
A<int> a1;
A<void> a2;
if(a1 == a2) {} // { dg-error "use" }
}
|
google | chromium | variadic76 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic76.C | 213 | utf_8 | 874a81eb8f65d81680cca4518ed1c245 | // PR c++/33496
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<int... N> int foo ()
{
return sizeof... N (); // { dg-error "cannot be used as a function" }
}
int bar ()
{
return foo<0> ();
}
|
google | chromium | constexpr-static3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static3.C | 407 | utf_8 | ee6a62fc2271cabb22d039879e50ee54 | // Test for constant initialization of class with vtable
// { dg-options "-std=c++0x -save-temps" }
// { dg-final { scan-assembler-not "static_initialization" } }
// { dg-final cleanup-saved-temps }
// { dg-do run }
int r = 1;
// implicit default constructor for A and B is constexpr
struct A { virtual void f() {} };
s... |
google | chromium | constexpr-wstring2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-wstring2.C | 261 | utf_8 | ce4462d64022a2d110788148b8612b31 | // PR c++/48570
// { dg-do compile }
// { dg-options -std=c++0x }
constexpr wchar_t c1 = L"hi"[3]; // { dg-error "out of bound" }
constexpr char16_t c2 = u"hi"[3]; // { dg-error "out of bound" }
constexpr char32_t c3 = U"hi"[3]; // { dg-error "out of bound" }
|
google | chromium | pr32115 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32115.C | 157 | utf_8 | c1b7f079bd668b594f6eb1d2ba1c6854 | // { dg-options "-std=c++0x" }
template<typename ...T, int = 0> struct A {}; // { dg-error "end of" }
A<int> a; // { dg-error "mismatch|expected|invalid" }
|
google | chromium | explicit1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit1.C | 920 | utf_8 | 5cff014c7abb4e3e318b9b2ebd7eb674 | // Test for explicit conversion ops from N2437.
// { dg-options "-std=c++0x" }
class U; class V;
class T
{
public:
T( U const & );
//implicit converting ctor
explicit T( V const & );
// explicit ctor
};
class U
{
};
class V
{
};
class W
{
public:
operator T() const;
};
class X
{
public:
explicit operator T... |
google | chromium | range-for2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for2.C | 748 | utf_8 | 585bfb120f5e17810289c123fec0b751 | // Test for range-based for loop
// Test the loop with a custom iterator
// with begin/end in an associated namespace
// { 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 ... |
google | chromium | constexpr-initlist5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist5.C | 174 | utf_8 | 99d19a6dfa53edad50b94137fec10343 | // PR c++/50024
// { dg-options -std=c++0x }
template< class T >
struct Container
{
Container(){
int* ptr = new int{};
}
};
int main() {
Container< int > c;
}
|
google | chromium | implicit9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit9.C | 262 | utf_8 | 596fe0c54f936183947dd7f8f3216483 | // Test that private base dtor makes derived ctor deleted
// { dg-options -std=c++0x }
struct A
{
A();
private:
~A(); // { dg-error "private" }
};
struct B: A { }; // { dg-error "implicitly deleted|context" }
B * b = new B; // { dg-error "deleted" }
|
google | chromium | decltype15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype15.C | 207 | utf_8 | c3ec86cf924ef203f6d25765332c13ec | // PR c++/38640
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<int N> void foo (decltype (N));
template<long int N> void foo (decltype (N));
void
bar (void)
{
foo<5> (6);
foo<5L> (6L);
}
|
google | chromium | rv6p | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv6p.C | 25,099 | utf_8 | 99c5f0ecff3f7b690c6809684129eba8 | // 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 {long x[1];};
struct two {long x[2];};
struct three {long x[3];};
struct ... |
google | chromium | constexpr-empty3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-empty3.C | 167 | utf_8 | 5478389596517a25da21cc74285cdf19 | // { dg-options -std=c++0x }
struct IsLiteral {};
constexpr auto ab = IsLiteral();
constexpr IsLiteral bar(IsLiteral x) { return x; }
constexpr auto xy = bar(ab);
|
google | chromium | variadic54 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic54.C | 227 | utf_8 | 301bf335a25b68e8f266634c4f36eec0 | // { dg-options "-std=gnu++0x" }
template<typename F, typename... BoundArgs>
class bound_functor
{
public:
bound_functor();
};
template<typename F, typename... BoundArgs>
bound_functor<F, BoundArgs...>::bound_functor()
{
}
|
google | chromium | cast | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/cast.C | 542 | utf_8 | 1a977380a1d43b958a2201bcbf61ff11 | // I, Howard Hinnant, hereby place this code in the public domain.
// Test cast from lvalue to rvalue
// { 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(const A&) {return one();}
... |
google | chromium | noexcept03 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept03.C | 859 | utf_8 | a14c42cdd53f5d0bdc462aadd46e9b56 | // Runtime test for noexcept-specification.
// { dg-options "-std=c++0x -Wnoexcept" }
// { dg-do run }
#include <exception>
#include <cstdlib>
void my_terminate ()
{
std::exit (0);
}
void my_unexpected ()
{
throw;
}
void g() { throw 1; }
void (*p)() = g;
void f () noexcept (false)
{
p();
}
template <class T>... |
google | chromium | implicit2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit2.C | 452 | utf_8 | c1701909436ef40d73976a88744b8c47 | // Test that the synthesized C copy constructor calls the A template
// constructor and has the appropriate exception specification.
// { dg-options -std=c++0x }
// { dg-do run }
int r = 1;
struct A
{
A() {}
A(const A&) throw () { }
template <class T>
A(T& t) { r = 0; }
};
struct B
{
B() {}
B(B&) throw () {... |
google | chromium | defaulted23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted23.C | 381 | utf_8 | 680dc315289d680d42454833a2aa8f99 | // Test for checking of exception specifications on defaulted fns
// { dg-options -std=c++0x }
struct A
{
A() noexcept = default;
};
struct B
{
B() throw (int) = default; // { dg-error "exception-specification that differs from the implicit declaration" }
};
struct C
{
C() throw (int) { }
};
struct D: C
{
D... |
google | chromium | variadic25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic25.C | 342 | utf_8 | b06cea5f9c66b27dc3d3d19a6217154c | // { dg-options "-std=gnu++0x" }
template<int... Values>
struct sum;
template<>
struct sum<> {
static const int value = 0;
};
template<int Value, int... Values>
struct sum<Value, Values...> {
static const int value = Value + sum<Values...>::value;
};
int a0[sum<>::value == 0? 1 : -1];
int a1[sum<1, 2, 3, 4, 5>::... |
google | chromium | variadic84 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic84.C | 908 | utf_8 | 221e9719b7a3015ccd3f7255a480ae29 | // PR c++/32565
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<typename...> struct A1;
template<template<int...> class T> struct A1<T<0> > {};
template<typename...> struct A2;
template<template<int...> class T> struct A2<T<0, 1> > {};
template<typename...> struct A3;
template<template<int, int...> class ... |
google | chromium | initlist43 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist43.C | 175 | utf_8 | fe8e7432342d2e760e326c6a3a420b8a | // Test that using T{} at file scope doesn't create a static temporary.
// { dg-options -std=c++0x }
// { dg-final { scan-assembler-not "local" } }
struct A { };
A a = A{};
|
google | chromium | constexpr-condition | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-condition.C | 222 | utf_8 | d2cffceebc61a6331480d06b92637573 | // { dg-options -std=c++0x }
// Core DR 948
constexpr int something() { return 3; }
int main() {
if (constexpr long v = something()) {}
if (static long v = something()) { } // { dg-error "decl-specifier invalid" }
}
|
google | chromium | elision | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/elision.C | 1,032 | utf_8 | 614bd2c770efa2ba339de0abcc46f4cb | // I, Howard Hinnant, hereby place this code in the public domain.
// Test: Implicit cast to rvalue when eliding copy
// { 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];};
class move_only
{
move_only(... |
google | chromium | forw_enum1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/forw_enum1.C | 775 | utf_8 | 04ce4364f7feeb38f930fd446dd14073 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// opaque enum declarations
enum class E1;
enum class E2 : int;
enum class E3 : short;
enum E4 : int;
enum E5 : short;
// can be repeated
enum class E1;
enum class E2 : int;
enum class E3 : short;
enum E4 : int;
enum E5 : short;
// are complete so we can declare va... |
google | chromium | alignof | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/alignof.C | 145 | utf_8 | 617bece9e33b40fea8bf3235739a82a9 | // { dg-options "-std=c++0x" }
int main(void)
{
static_assert(alignof(int) == __alignof(int), "alignof(int) does not equal __alignof(int)");
}
|
google | chromium | constexpr-ctor | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor.C | 119 | utf_8 | 8275bc8428329263df1be2cfecbfd456 | // { dg-options -std=c++0x }
struct A
{
int i;
constexpr A() { } // { dg-error "uninitialized member .A::i" }
};
|
google | chromium | variadic1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic1.C | 171 | utf_8 | bb6afbbf296083db4650ea62c40e7f80 | // { dg-options "-std=gnu++0x" }
template<typename...>
class tuple;
template<typename... Args>
class tuple { };
template<typename T1, class... Args>
class tuple1p { };
|
google | chromium | pr33839 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr33839.C | 195 | utf_8 | 33ff45fe18bdee32a83ed1fdfad581b7 | // { dg-options -std=c++0x }
template<int> struct A;
void foo()
{
__decltype A<0>; // { dg-error "invalid declarator|expected" }
__decltype (A<0>); // { dg-error "must be an expression" }
}
|
google | chromium | variadic-new | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-new.C | 269 | utf_8 | feb4ed62ebd7a726f6acba5e19d532bf | // { dg-do run }
// { dg-options "-std=c++0x" }
// Contributed by Peter Dimov
// PR c++/32597
#include <assert.h>
#include <new>
int k = 5;
template< class... Args > void f( Args... args )
{
new( &k ) int( args... );
}
int main()
{
f();
assert( k == 0 );
}
|
google | chromium | pr31432 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31432.C | 256 | utf_8 | 8d4acf95e9330d762724340eec4d20a0 | // { dg-options "-std=gnu++0x" }
template<typename..., typename> struct A // { dg-error "parameter pack" }
{
static int i;
};
A<int, int> a; // { dg-error "mismatch|expected|invalid type" }
A<char,int> b; // { dg-error "mismatch|expected|invalid type" }
|
google | chromium | initlist27 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist27.C | 143 | utf_8 | d6492e6206eb4be3215f8b76de11bea1 | // PR c++/42061
// { dg-do compile }
// { dg-options "-std=c++0x" }
int& i = { j }; // { dg-error "invalid initialization|was not declared" }
|
google | chromium | variadic52 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic52.C | 180 | utf_8 | 6b2e3d5143374b8c95565d681a482621 | // { dg-options "-std=gnu++0x" }
template<typename T, T... Values>
struct vector_c { };
vector_c<int, 1, 2, 3> v1;
vector_c<char, 'a', 'b', 'c'> v2;
vector_c<long, 1u, 2, 3l> v3;
|
google | chromium | variadic101 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic101.C | 374 | utf_8 | 15c23646cf91a9affcde90370c5e4692 | // PR c++/43382
// { dg-options "-std=c++0x" }
template<class T>
struct Container
{ T f() const; };
template<class T>
T deref(const T& t)
{ return t; }
template <class T, class... Args>
auto
deref(const T& u, int r, Args... args)
-> decltype(deref(u.f(), args...))
{ return deref(u.f(), args...); }
int main(void)
{... |
google | chromium | constexpr-switch | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-switch.C | 236 | utf_8 | e3cde1e3883c11e3d5cde9c482349c05 | // { dg-options -std=c++0x }
template<class T>
constexpr T value(T t = T()) { return t; }
enum us_enum { us_item = value<short>() }; // OK
void func(us_enum n) {
switch (n) {
case value(us_item): ; // #1 Error
default: ;
}
}
|
google | chromium | initlist2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist2.C | 555 | utf_8 | b07e5a8dc17e52f03c788220d501f892 | // Test that conversion to std::initializer_list takes priority over other
// user-defined conversions.
// { dg-do link }
// { dg-options "-std=c++0x" }
#include <initializer_list>
struct string
{
string (const char *) {}
template <class Iter> string (Iter, Iter);
};
template <class T, class U>
struct pair
{
... |
google | chromium | range-for14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for14.C | 1,475 | utf_8 | 9ebbb216d06bc4a31635ee39ce93c571 | // Test for other range-based for loops with
// begin/end member functions
// { dg-do compile }
// { dg-options "-std=c++0x" }
//These should not be used
template<typename T> int *begin(T &t)
{
T::fail;
}
template<typename T> int *end(T &t)
{
T::fail;
}
//Test for defaults
struct default1
{
int *begin(i... |
google | chromium | auto24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto24.C | 128 | utf_8 | d8c3c940670c0afaab3b883b155e23c1 | // PR c++/48599
// { dg-options "-std=c++0x -pedantic-errors" }
int v[1];
auto (*p)[1] = &v; // { dg-error "array of .auto" }
|
google | chromium | nsdmi-defer1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer1.C | 199 | utf_8 | 97f134b1d513ba9bbb3cfd0da2208e62 | // { dg-options -std=c++0x }
#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 | chromium | constexpr-static7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static7.C | 240 | utf_8 | 9d286f0d4a470dc3ee12ca1d31d77e29 | // PR c++/48945
// { dg-options -std=c++0x }
struct A {
static constexpr bool is();
static constexpr bool is_not();
};
constexpr bool A::is() { return true; }
constexpr bool A::is_not() const { return true; } // { dg-error "static" }
|
google | chromium | pr34057 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34057.C | 190 | utf_8 | 6ffd247ca2be2be780441467eb7dce45 | // PR c++/34057
// { dg-do compile }
// { dg-options "-std=c++0x" }
template <typename... T> struct A
{
typedef T X __attribute__ ((vector_size (8))); // { dg-error "not expanded|T" }
};
|
google | chromium | nullptr06 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr06.C | 282 | utf_8 | 1c33e6a1456e02c6fbebbc211143a59d | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test compare to pointer
#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
char* const cp1 = nullptr;
void fun()
{
assert_true(cp1 == nullptr);
decltype(nullptr) mynull = 0;
assert_true(cp1 == mynull);
}
|
google | chromium | auto14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto14.C | 409 | utf_8 | 22834457eced7ff0d65e97187ae5a79b | // PR c++/40306, c++/40307
// { dg-options "-std=c++0x" }
// { dg-do run }
template< typename T >
struct test {
test run() {
auto tmp = *this;
return tmp;
}
test run_pass() {
test tmp( *this );
return tmp;
}
test run_fail() {
auto tmp( *this );
return tmp;
}
};
i... |
google | chromium | elision_weak | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/elision_weak.C | 118 | utf_8 | af521f07a34d29e505189640746f3ea0 | // { dg-do compile }
struct S
{
S() {}
S(S&) {}
};
S f()
{
S s;
return s;
}
void g()
{
S s;
throw s;
}
|
google | chromium | initlist9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist9.C | 449 | utf_8 | 73b80da7e3c8fd208ac554539a446c84 | // PR c++/37860
// { dg-options "-std=c++0x" }
struct b
{
bool t;
b() = default;
~b() = default;
b& operator=(const b&) = delete;
b(const b&) = delete; // { dg-error "declared" }
b(bool _t): t (_t) { }
};
int main()
{
// copy list initialization
b tst1 = { false };
// copy initialization.
b ts... |
google | chromium | variadic-unresolved | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-unresolved.C | 275 | utf_8 | 0a8c774329e41a74c1480e1b039d4391 | // PR c++/50086
// { dg-options -std=c++0x }
template<typename T> void tfun();
template<typename T> void fun1(T);
template<typename... Types> void fun2(Types... args);
int main()
{
fun1(tfun<int>); // ok
fun2(tfun<int>); // error: unresolved overloaded function type
}
|
google | chromium | constexpr-virtual | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual.C | 177 | utf_8 | 4138d75ee330a5d2fd3099d8f561e59b | // PR c++/47067
// { dg-options -std=c++0x }
struct X {
virtual void x();
virtual ~X();
};
struct Y {
virtual void y();
virtual ~Y();
};
struct Z: X, Y {} z;
|
google | chromium | constexpr-array-tparm | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-tparm.C | 132 | utf_8 | 433e0f16558f845c892db5541c24ca32 | // { dg-options -std=c++0x }
template <const int I[2]> struct A { int ir[I[0]]; };
extern constexpr int ar[2] = { 1, 2 };
A<ar> a;
|
google | chromium | decltype2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype2.C | 1,255 | utf_8 | e28b14d7eced400a3ea6a7418af56c8d | // { dg-do compile }
// { dg-options "-std=gnu++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;
};
#define CHECK_DECLTYPE(DECLTYPE,RESULT) \
static_assert(is_same< DECLTYPE , RESULT >::value, ... |
google | chromium | enum7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum7.C | 292 | utf_8 | ec6b0bf4b17fabec5ae1aaf79db31e6f | // PR c++/37816
// { dg-options "-std=c++0x" }
class A
{
enum class Color { Red, Orange, Yellow, Green, Blue, Violet };
enum class Alert { Green, Yellow, Red };
static const Color x = Red; // { dg-error "" }
static const Color y = Color::Red;
static const Alert z = Alert::Red;
};
|
google | chromium | initlist52 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist52.C | 128 | utf_8 | 61e5f8b374c335600e65d4896619af86 | // PR c++/45378
// { dg-options "-std=c++0x -pedantic-errors" }
int main()
{
int x { 22.2 }; // { dg-error "narrowing" }
}
|
google | chromium | variadic81 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic81.C | 221 | utf_8 | c50ca86b3c5889ab02daaecbb96d59b9 | // PR c++/33461
// { dg-options "-std=gnu++0x" }
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 | chromium | auto3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto3.C | 570 | utf_8 | 9a6d411c88e77de58c437683ee1564d8 | // Negative test for auto
// { dg-options "-std=c++0x" }
#include <initializer_list>
auto x; // { dg-error "auto" }
// If the type deduced for the template parameter U is not the same in each
// deduction, the program is ill-formed.
auto i = 42, j = 42.0; // { dg-error "auto" }
// New CWG issue
auto a[2] = { 1,... |
google | chromium | variadic18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic18.C | 1,011 | utf_8 | a235bb78ea18efc7b76823629a43177f | // { dg-options "-std=gnu++0x" }
template<typename...> class tuple { };
template<typename T, template<typename T> class... Metafunctions>
struct apply_all
{
typedef tuple<typename Metafunctions<T>::type...> type;
};
template<typename T, typename U>
struct is_same {
static const bool value = false;
};
template<ty... |
google | chromium | pr34058 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr34058.C | 166 | utf_8 | 6a5b31135f37628be4892ec76215d2a6 | // PR c++/34058
// { dg-do compile }
// { dg-options "-std=c++0x" }
template <typename...T> struct A
{
typedef T X; // { dg-error "not expanded|T" }
};
A<int> a;
|
google | chromium | nullptr25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr25.C | 87 | utf_8 | a7750972ac218ba6614c2edc19b7aab9 | // { dg-options -std=c++0x }
template<decltype(nullptr)>
struct nt{};
nt<nullptr> x;
|
google | chromium | initlist5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist5.C | 924 | utf_8 | 121997e64da72718a91a67436b8933e3 | // Test for narrowing diagnostics
// { dg-options "-std=c++0x -pedantic-errors" }
#include <initializer_list>
struct A { int i; int j; };
A a2 { 1.2 }; // { dg-error "narrowing" }
A a1 { 1, 2 }; // aggregate initialization
struct B {
B(std::initializer_list<int>);
};
B b1 { 1, 2 }; // creates initializer_list<int>... |
google | chromium | decltype20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype20.C | 127 | utf_8 | be5f0a9f9f2e7509ad349dd410c77a61 | // PR c++/42277
// { dg-options -std=c++0x }
struct S { int s; };
template <int N>
void foo ()
{
S s;
decltype (s.s) i;
}
|
google | chromium | vt-37737-1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C | 189 | utf_8 | 547e3ca9fa4d8abba50411644021e422 | // { dg-options "-std=c++0x" }
// { dg-prune-output "note" }
void f() { }
template<class U, class... T>
void f(){ f<T...>(); } // { dg-error "no matching" }
int main()
{
f<char>();
}
|
google | chromium | rv3p | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv3p.C | 34,257 | utf_8 | 53f4337f89e2369fc9a20520953362a9 | // 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 {long x[1];};
struct two {long x[2];};
struct three {long x[3];};
struct ... |
google | chromium | trivial1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/trivial1.C | 1,678 | utf_8 | afbc86b27b3b8cb6b3e9e9fba23e20e7 | // { dg-options "-std=c++0x" }
// [basic.types]/10:
// Scalar types, trivial class types (Clause 9), arrays of such types and
// cv-qualified versions of these types (3.9.3) are collectively called
// trivial types.
// [class]/6:
// A trivially copyable class is a class that:
// * has no non-trivial copy constructors (... |
google | chromium | deduce | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/deduce.C | 722 | utf_8 | 30926b69dfa89cf32d25234a7f10c447 | // { dg-options "--std=c++0x" }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
int lval_int;
int rval_int();
int const lval_const_int=0;
int const&& rval_const_int();
template <typename T> void deduce_lval_int(T && t)
{
same_type<T, int &>();
}
template <typename... |
google | chromium | defaulted2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted2.C | 1,283 | utf_8 | 7734fb6245442294189203b8b811e02e | // Negative test for defaulted/deleted fns.
// { dg-options "-std=c++0x" }
void f(); // { dg-error "previous" }
void f() = delete; // { dg-error "deleted" }
struct A
{
A() { } // { dg-error "previous" }
void f() = default; // { dg-error "default" }
};
A::A() = default; // { dg-error "redefinition" }
void... |
google | chromium | constexpr-typeid | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C | 362 | utf_8 | 9783e30ee5bab055f5956b126a283609 | // { dg-options -std=c++0x }
#include <typeinfo>
struct A { virtual void f(); };
extern constexpr const std::type_info* p1 = &typeid(int);
extern constexpr const std::type_info* p2 = &typeid(A);
// typeid-expression whose operand is of a polymorphic class type
extern constexpr const std::type_info* p3 = &typeid((A()... |
google | chromium | implicit1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit1.C | 566 | utf_8 | 30c07aa92f0d114ed68581072600f56a | // Test for implicitly deleted destructors.
// { dg-options "-std=c++0x" }
// { dg-prune-output "default definition would be ill-formed" }
// { dg-prune-output "within this context" }
class C
{
void operator delete (void *); // { dg-error "private" }
public:
virtual ~C(); // { dg-error "overriding" }
};
struct ... |
google | chromium | initlist49 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist49.C | 337 | utf_8 | 98d6920806c9999a453b66805b8760da | // Test for non-trivial list-initialization with array new.
// { dg-options -std=c++0x }
// { dg-do run }
struct A
{
enum E { c_string, number } e;
A(const char *): e(c_string) {}
A(int): e(number) {}
};
int main()
{
A* ap = new A[2]{1, ""};
if (ap[0].e != A::number || ap[1].e != A::c_string)
return 1;
... |
google | chromium | variadic-ttp | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-ttp.C | 221 | utf_8 | 0584fcdc603bce015231b5ea40e5ecba | // { dg-options -std=c++0x }
// PR c++/34101
template<typename> struct A {};
template<template<typename> class...> struct B {};
template<template<typename> class T> void foo(const B<T>&);
void bar()
{
foo(B<A>());
}
|
google | chromium | rv-dotstar | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-dotstar.C | 243 | utf_8 | 189c569f885d3f48cd1a8759eb1a4049 | // PR c++/49389
// { dg-options -std=c++0x }
template<class T> T&& val();
struct A {};
typedef decltype(val<A>().*val<int A::*>()) type;
template<class> struct assert_type;
template<> struct assert_type<int&&> {};
assert_type<type> test;
|
google | chromium | constexpr-condition2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-condition2.C | 441 | utf_8 | d0ad42a65f6f77dc80caef0d6d27924c | // PR c++/48909
// { dg-options -std=c++0x }
#define SA(X) static_assert((X),#X)
constexpr int const * is_sorted_until(int const * first, int const * last)
{
return first == last || first + 1 == last ? last
: (*(first + 1) < *first) != false ? first + 1
: is_sorted_until(first + 1, last);
}
int main()
{
static... |
google | chromium | sfinae18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae18.C | 260 | utf_8 | 49097fa84d527ec31fa9d61bc22a4572 | // PR c++/48530
// { dg-options -std=c++0x }
template<class T,
class = decltype(T())
>
char f(int);
template<class>
char (&f(...))[2];
struct DelDtor {
DelDtor() = default;
~DelDtor() = delete;
};
static_assert(sizeof(f<DelDtor>(0)) != 1, "Error");
|
google | chromium | defaulted25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted25.C | 151 | utf_8 | e5cec7abed98e56670feeac2a6c4dd9a | // PR c++/48930
// { dg-options -std=c++0x }
// { dg-prune-output "note" }
struct A
{
A(const A&) = default;
};
A a; // { dg-error "no match" }
|
google | chromium | constexpr-delete | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-delete.C | 82 | utf_8 | 14824a710dc8e012f66d8ea2d621f223 | // { dg-options -std=c++0x }
constexpr bool never() = delete; // useless, but OK
|
google | chromium | static_assert1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert1.C | 399 | utf_8 | cc518678d11c27d38238be4776df21d5 | // { dg-options "-std=c++0x" }
void foo()
{
static_assert(1, "okay");
static_assert (0 == 1, "zero is never equal to one"); // { dg-error "never equal" }
}
class X {
static_assert(1, "okay");
static_assert (0 == 1, "zero is never equal to one"); // { dg-error "never equal" }
};
static_assert(1, "okay");
stati... |
google | chromium | defaulted29 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted29.C | 189 | utf_8 | 09302da6c998e5b2d306f0bdbee8c4b1 | // PR c++/46696
// { dg-options -std=c++0x }
struct A
{
A& operator= (A const&);
};
struct B
{
A ar[1];
B& operator= (B const&) = default;
};
int main()
{
B x;
B y;
y = x;
}
|
google | chromium | initlist47 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist47.C | 164 | utf_8 | cc4228975fb28b1b9f95e7777be9e9a5 | // { dg-options -std=c++0x }
struct A { ~A() = delete; }; // { dg-error "declared" }
int main()
{
typedef const A cA[2];
cA{}; // { dg-error "deleted" }
}
|
google | chromium | variadic39 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic39.C | 303 | utf_8 | 951b21c26ba104b2ab7d8d762bd2bec0 | // { dg-options "-std=gnu++0x" }
template<typename... Args>
struct tuple {};
template<typename T, typename... Args>
struct tuple<Args..., T> { }; // { dg-error "end" }
template<int... Values>
struct int_vec { };
template<int I, int... Values>
struct int_vec<Values..., I> { }; // { dg-error "end" }
|
google | chromium | constexpr-array-ptr5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr5.C | 658 | utf_8 | 388e3e7b10ac31572872850035c0c870 | // { dg-options -std=c++0x }
template<class T>
constexpr T do_last(T* x, int n) {
return x[n - 1]; //
}
template<class T, int N>
constexpr T last(T (&x)[N]) {
return do_last(x, N);
}
constexpr bool is_negative(int x) { return x < 0; }
template<class T>
struct IsNegative {
constexpr bool operator()(const T& x) {... |
google | chromium | temp_default4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/temp_default4.C | 355 | utf_8 | 73c23f2dae4a3332cdef87694d9b06d5 | // { dg-options "-std=c++0x" }
class X {
template<typename T = int> friend void f(X) { }
template<typename T> friend void g(X); // { dg-error "previously declared here" }
template<typename T = int> friend void h(X); // { dg-error "function template friend" }
};
template<typename T = int> void g(X) // { dg-error... |
google | chromium | initlist40 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist40.C | 145 | utf_8 | f734bf285f2423eba79245138315bec1 | // { dg-options "-std=c++0x" }
struct A
{
explicit A(int = 42);
};
int main()
{
A a1 = { };
A a2 = { 24 }; // { dg-error "explicit" }
}
|
google | chromium | constexpr-string | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-string.C | 148 | utf_8 | 30140c510b3f40587923402f563eebc4 | // { dg-options -std=c++0x }
constexpr char c1 = "hi"[1];
constexpr char c2 = "hi"[2];
constexpr char c3 = "hi"[3]; // { dg-error "out of bound" }
|
google | chromium | friend1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/friend1.C | 437 | utf_8 | 71dee05a2faa0fff12d50af144fe7f6c | // From N1791
// { dg-options -std=c++0x }
class C;
typedef C Ct;
class X1 {
friend C; // OK: class C is a friend
};
class X2
{
friend Ct; // OK: class C is a friend
friend D; // { dg-error "" } no type-name D in scope
friend class D; // OK: elaborated-type-specifier declares new class
};
template <typena... |
google | chromium | range-for21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for21.C | 101 | utf_8 | 7a5a28a73ab54a06719c8681aea0540d | // PR c++/49983
// { dg-options -std=c++0x }
template <class T>
void f(T t)
{
for (auto v : t);
}
|
google | chromium | move1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/move1.C | 204 | utf_8 | b961f9e13463c0655c163234f05ecc07 | // { dg-options "-std=c++0x -pedantic-errors" }
#include <utility>
class A { };
static void g ( A && ) { }
template < class T > class B {
public:
void f ( ) {
A a;
g ( std :: move ( a ) );
}
};
|
google | chromium | variadic62 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic62.C | 127 | utf_8 | 71d58bebb24f823b96a6f96fcdba12d7 | // { dg-options "-std=gnu++98 -pedantic-errors" }
template<typename... Args> class tuple; // { dg-error "variadic templates" }
|
google | chromium | variadic115 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic115.C | 284 | utf_8 | 34a6b430f73bf90497dd20b8d19acbc8 | // PR c++/49593
// { dg-options -std=c++0x }
template<typename... T> void f(T...) { }
template<typename... Args>
static void
g(Args&&... args)
{
f( static_cast<Args>(args)... );
f( (Args)args... );
f( Args(args)... );
f( Args{args}... );
}
int main()
{
g(1, '2', 3.0);
}
|
google | chromium | warn_cxx0x | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x.C | 216 | utf_8 | f7ca8a836bf685c41c15524386f13052 | // { dg-options "-std=gnu++98 -Wc++0x-compat" }
int static_assert; // { dg-warning "will become a keyword" }
int nullptr; // { dg-warning "will become a keyword" }
void foo()
{
static_assert = 5;
nullptr = 5;
}
|
google | chromium | constexpr-stmtexpr | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C | 103 | utf_8 | dfdf1c6792b2614e81baa645e2df305b | // PR c++/46977
// { dg-options "-std=c++0x" }
template < typename > void
foo ()
{
({int i;}), 0;
}
|
google | chromium | pr42844-2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C | 1,043 | utf_8 | a6077b740f880ca48299d69a8e9694a5 | // PR c++/42844
// { dg-do compile }
// { dg-options "-std=c++0x" }
struct A // { dg-message "user-provided default constructor" }
{
int i;
A() = default; // { dg-message "not user-provided" }
};
struct Base
{
Base() {}
};
struct Derived : Base // { dg-message "user-provided default constructor" }
{
... |
google | chromium | initlist-value2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist-value2.C | 326 | utf_8 | 96c9d6afe9a74599d1eefe4a8c8690b5 | // Test that we properly value-initialize a class with a user-provided
// constructor but defaulted default constructor. The FDIS got this
// wrong; see c++std-core-19883.
// { dg-options -std=c++0x }
// { dg-do run }
struct A
{
int i;
A() = default;
A(int);
};
int main()
{
A a{};
if (a.i != 0)
return... |
google | chromium | variadic87 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic87.C | 400 | utf_8 | 3887c900d50685fb2ba16555185c042d | // PR c++/33965
// { dg-options -std=c++0x }
template<typename T>
struct foo
{
static bool const value = false;
};
template<template<typename...> class T, typename... Args>
struct foo<T<Args...> >
{
static bool const value = true;
};
template<int I>
struct int_
{};
int main()
{
static_assert(foo<int_<0> >:... |
google | chromium | constexpr-ex3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ex3.C | 507 | utf_8 | 072cdb9d385edba74441f50cef278efc | // { dg-options "-std=c++0x" }
#define SA(X) static_assert (X, #X)
struct A
{
int i;
constexpr A(int _i) { i = _i; } // { dg-error "empty body|uninitialized member" }
};
template <class T>
struct B
{
T t;
constexpr B(T _t): t(_t) { }
};
B<int> b(1); // { dg-message "not declared .constexpr" }
SA(b.t... |
google | chromium | rv-deduce2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv-deduce2.C | 240 | utf_8 | e1aa064c0db45b397cd2d5c1ee71ad82 | // PR c++/48313
// { dg-options -std=c++0x }
template<typename F>
void f(F&&) { }
void g() { }
template<typename T> void h() { }
int main()
{
f( g ); // OK
void (&p)() = h<int>;
f( p ); // OK
f( h<int> ); // ???
}
|
google | chromium | nsdmi-defer3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer3.C | 261 | utf_8 | 251c1b213469ea7380d190016b4d6e38 | // Do NSDMI get deferred instantiation?
// { dg-options -std=c++0x }
template <class T>
struct A
{
T t = T(42);
constexpr A() { }
A(T t): t(t) { }
};
struct B { };
#define SA(X) static_assert(X,#X)
constexpr A<int> a1;
SA(a1.t == 42);
A<B> a2 {B()};
|
google | chromium | union3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/union3.C | 730 | utf_8 | 934f00a4c6a4ef2e1cf82a1fab80ba9e | // Runtime test for C++0x unrestricted unions
// { dg-options -std=c++0x }
// { dg-do run }
int c, d;
struct A
{
int i;
A(): i(1) { ++c; }
A(const A&): i(2) { ++c; }
~A() { ++d; }
};
union B
{
A a;
B() { }
B(const B& b) { }
~B() { }
};
struct C
{
union { A a; };
C() { }
C(const C&) { }
~C() {... |
google | chromium | pr38795 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr38795.C | 223 | utf_8 | e21108436dc5ce57312ddc9a096ec2db | // PR c++/38795
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename... T> int foo(int i)
{
return *reinterpret_cast<T*>(i); // { dg-error "not expanded with|T" }
}
void bar(int i)
{
foo<int>(i);
}
|
google | chromium | variadic7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic7.C | 758 | utf_8 | 5b504e24aee13a1f1be99a4c933d7706 | // { dg-options "-std=gnu++0x" }
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 const i... |
google | chromium | initlist13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist13.C | 140 | utf_8 | 016de06026f59b1fa8cf2b1fd03c5f45 | // PR c++/39056
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
#include <complex>
__complex__ int i {0};
std::complex<int> i2 {0};
|
google | chromium | auto4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto4.C | 530 | utf_8 | 8754523bb1846890e4b8d81b2740ba1e | // Testcase for deduction of std::initializer_list for auto.
// { dg-do run }
// { dg-options "-std=c++0x" }
#include <typeinfo>
#include <initializer_list>
extern "C" void abort();
template <class T>
void f (T t)
{
auto ilt = { &t, &t };
if (typeid(ilt) != typeid(std::initializer_list<T*>))
abort();
auto ... |
google | chromium | auto19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto19.C | 153 | utf_8 | a08dec8a8ae0583ce146e487cb4920a8 | // { dg-options -std=c++0x }
struct Explicit {
Explicit() = default; // Line 2
explicit Explicit(const Explicit&){}
} ex;
auto ex2(ex); // Line 6
|
google | chromium | nullptr10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr10.C | 410 | utf_8 | bda51ee1dfea5a3da54f347c8b3e6e2f | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test arithmetic operations
void fun()
{
nullptr = 0; // { dg-error "lvalue required as left operand" }
nullptr + 2; // { dg-error "invalid operands of types " }
decltype(nullptr) mynull = 0;
mynull = 1; // { dg-error "cannot conve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.