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 | range-for15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for15.C | 760 | utf_8 | 01befedee44c73c641d07898a10ebdf1 | // Test for range-based for loop with templates
// and begin/end as member (non-)virtual functions
// { dg-do run }
// { dg-options "-std=c++0x" }
unsigned int g;
struct A
{
virtual int *begin()
{
g |= 1;
return 0;
}
int *end()
{
g |= 2;
return 0;
}
};
struct ... |
google | chromium | enum8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum8.C | 119 | utf_8 | 684bb209b58a089455fc93617b1e4a87 | // PR c++/47704
// { dg-do compile }
// { dg-options "-std=c++0x" }
void
foo ()
{
enum class E { A, B };
new E;
}
|
google | chromium | auto7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto7.C | 313 | utf_8 | db2c4c053604604ea47b1606378a6ec4 | // PR c++/37965
// Negative test for auto
// { dg-options "-std=c++0x" }
auto i = 6;
auto j; // { dg-error "has no initializer" }
template<int> struct A
{
static auto k = 7; // { dg-error "non-const" }
static auto l; // { dg-error "has no initializer" }
auto m; // { dg-error "has no initializer" }
};
|
google | chromium | pr33955 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr33955.C | 770 | utf_8 | df1e87feaf65676ae83648e44c557581 | // { dg-options "-std=c++0x" }
template<typename T>
struct uncvref
{
typedef T type;
};
template<typename... Args>
struct args
{
static const int size = sizeof...(Args);
};
template<typename G, typename E, typename S, typename V, long GN = G::size, long EN = E::size>
struct apply_args;
template<typename... G, ty... |
google | chromium | nullptr21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr21.C | 856 | utf_8 | 8f53ac3c9437341c6df7db62d3071ab3 | // { dg-do run }
// { dg-options "-std=c++0x" }
// Test throw and catch
#include <cstdio>
typedef decltype(nullptr) nullptr_t;
int main()
{
try {
throw nullptr;
} catch (void*) {
printf("Test 1 Fail");
} catch (bool) {
printf("Test 1 Fail");
} catch (int) {
printf("Test 1 Fail");
} catch (... |
google | chromium | variadic-mem_fn | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C | 1,042 | utf_8 | 58addf468375adde7c281479f697810e | // { dg-options "-std=gnu++0x" }
// { dg-do run }
// A basic implementation of TR1's mem_fn using variadic teplates
#include <cassert>
template<typename R, typename Class, typename... Args>
class Mem_fn
{
public:
explicit Mem_fn(R (Class::*pmf)(Args...)) : pmf(pmf) { }
R operator()(Class& object, Args... args)
{... |
google | chromium | constexpr-ice3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ice3.C | 140 | utf_8 | 4c3297ae3aa17ea50b41c45596b0c65b | // PR c++/46289
// { dg-options -std=c++0x }
struct A
{
int i;
};
struct B
{
A a;
constexpr B(): a({1,2}) { } // { dg-error "" }
};
|
google | chromium | initlist3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist3.C | 143 | utf_8 | ebf07d4ed58e4156777e047923969c63 | // { dg-options "-std=c++0x" }
#include <initializer_list>
template <class T> void f(std::initializer_list<T>);
void g()
{
f({1,2,3});
}
|
google | chromium | constexpr-initlist2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C | 206 | utf_8 | 8e6ec093d77f92eadcb8fc2562cf8b59 | // { dg-options -std=c++0x }
#include <initializer_list>
constexpr auto list = { 1, 2, 3, 4 };
#define SA(X) static_assert(X, #X)
SA(list.size() == 4);
SA(list.begin()[2] == 3);
SA(list.end()[-1] == 4);
|
google | chromium | defaulted28 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted28.C | 278 | utf_8 | 80dcf5e0495211aeef3ea92129ef2d49 | // PR c++/49102
// PR c++/50034
// { dg-options -std=c++0x }
struct A {
A() = default;
private:
A(A const&) = default; // { dg-error "private" }
};
int f(...) { }
int main() {
A a;
f(a); // { dg-error "this context" }
sizeof(f(a)); // OK because unevaluated
}
|
google | chromium | auto10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto10.C | 318 | utf_8 | 48f61f18a7cb3cb48d7aa3d0ca0e9653 | // Positive test for auto
// { dg-do run }
// { dg-options "-std=c++0x" }
#include <typeinfo>
extern "C" void abort();
int main()
{
if (auto i = 42L)
{
if (typeid (i) != typeid (long int))
abort ();
}
while (auto i = 1)
{
if (typeid (i) != typeid (int))
abort ();
break;
}
}
|
google | chromium | initlist57 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist57.C | 187 | utf_8 | 66e6e56a53e95d409574ef5ab5943a07 | // PR c++/50054
// { dg-options -std=c++0x }
void g( const int& (a)[1] ) {} // { dg-error "array of references" }
int main () {
g( { 1, 2 } ); // { dg-error "initializer list" }
}
|
google | chromium | constexpr-is_literal | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-is_literal.C | 668 | utf_8 | 9c2cc881af9feef664fbfc1573f2a246 | // { dg-options -std=c++0x }
#include <type_traits>
#define IS_LIT(T) (std::is_literal_type<T>::value)
#define SA(X) static_assert (X, #X)
#define YES(T) SA(IS_LIT(T))
#define NO(T) SA(!IS_LIT(T))
enum E1 { };
enum class E2 { };
struct Literal {};
struct NotLiteral {
~NotLiteral();
};
YES(int);
YES(int[]);
YES(i... |
google | chromium | variadic88 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic88.C | 334 | utf_8 | 32cce31ef2c89f2acbe149f22af0fd89 | // { dg-options "-std=c++0x" }
template<template<typename...> class TT>
TT<int, float, double> foo(TT<int, float>)
{
return TT<int, float, double>();
}
template<typename T>
int& foo(T)
{
static int i = 0; return i;
}
template<typename T, typename U>
struct pair {};
void bar()
{
pair<int, float> p;
int& i... |
google | chromium | union1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/union1.C | 663 | utf_8 | c38018a87dc4775cfadef57555594816 | // Negative test for C++0x unrestricted unions
// { dg-options -std=c++0x }
// { dg-prune-output "implicitly deleted because" }
struct A
{
A();
A(const A&);
~A();
};
union B
{
A a; // { dg-error "union member" }
};
B b; // { dg-error "B::B\\(\\)" }
B b2(b); // { dg-error "B::B\\(const B&\\)" }
struct C
... |
google | chromium | decltype-38655 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C | 101 | utf_8 | 51bee11248b9515ebb07cbd465c4fc47 | // PR c++/38655
// { dg-options "" }
__decltype(0r)* p = 1; // { dg-error "not supported|invalid" }
|
google | chromium | constexpr-static5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C | 199 | utf_8 | fbeee4c0d5d23792c0de801b19faffbb | // { dg-options -std=c++0x }
template <class T>
struct A
{
constexpr static T t = T(); // { dg-error "literal" }
};
template <class T>
constexpr T A<T>::t;
struct B
{
~B();
};
B b = A<B>::t;
|
google | chromium | constexpr-pos1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-pos1.C | 1,235 | utf_8 | f9defd2882781f6e4febe26b21d9b874 | // Positive examples from N3092 (FCD)
// { dg-options -std=c++0x }
#define SA(X) static_assert(X, #X)
constexpr int bufsz = 1024; // OK: definition
SA (bufsz == 1024);
constexpr int square(int x); // OK: declaration
struct pixel {
int x;
int y;
// OK: declaration
constexpr pixel(int);
};
constexpr pixel::pi... |
google | chromium | nullptr24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr24.C | 85 | utf_8 | 562d8b139a26b4f08ada61ba09450b5a | // PR c++/50371
// { dg-options -std=c++0x }
template<decltype(nullptr)>
struct nt;
|
google | chromium | variadic17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic17.C | 693 | utf_8 | 3053d79335fc919b210a3cc63f124ff4 | // { dg-options "-std=gnu++0x" }
template<typename R, typename... ArgTypes>
struct make_function_type
{
typedef R type(const ArgTypes&......);
};
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 | defaulted8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted8.C | 189 | utf_8 | e4eda3d1136f1741945b988346e3fedf | // PR c++/38649
// { dg-options "-std=c++0x" }
struct A
{
A(...) = default; // { dg-error "cannot be defaulted" }
A(const A&, ...) = default; // { dg-error "cannot be defaulted" }
};
|
google | chromium | bracket4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/bracket4.C | 445 | utf_8 | 3e5ed1d0633602d2d26f88ec6a3bcdd5 | // { dg-do compile }
// { dg-options "-std=c++0x" }
template<typename T>
struct vector {
};
struct X {
template<typename T>
struct tmpl {
operator T() const;
};
};
template<typename T>
void g()
{
T::template tmpl<vector<int>>() + 2;
}
template<typename T>
void operator+(vector<T>, int);
void f()
{
v... |
google | chromium | sfinae20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae20.C | 406 | utf_8 | 0c45c97f11b30835e0200bf4f190df7a | // PR c++/48744
// { dg-options "-std=c++0x" }
template<class T>
struct add_rval_ref {
typedef T&& type;
};
template<>
struct add_rval_ref<void> {
typedef void type;
};
template<class T>
typename add_rval_ref<T>::type create();
template<class T, class Arg>
decltype(T{create<Arg>()}, char()) f(int);
template<cl... |
google | chromium | initlist45 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist45.C | 116 | utf_8 | 5437ab72a4f00788034c9da91a24c3c4 | // PR c++/46289
// { dg-options -std=c++0x }
struct A
{
int i[2];
};
struct B
{
A a;
B(): a({{1,2}}) { }
};
|
google | chromium | pr48522 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr48522.C | 357 | utf_8 | 0f202d94aef34455737171792c0ba318 | // { dg-options "-std=c++0x" }
template <typename T>
struct Handle
{
Handle(T& t);
};
template<class T>
struct Class {
struct Struct {} data;
void f();
void g();
};
template<class T>
void Class<T>::f() {
Handle< decltype((data)) > handle(data);
}
template<class T>
void Class<T>::g() {
Handle... |
google | chromium | decltype16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype16.C | 338 | utf_8 | c00e5bacd6ac200e6550fc2d6d4ac73e | // PR c++/39070
// { dg-options "-std=c++0x" }
template<typename X> struct junk {
template<typename Z> static Z y();
template<typename Y> static int test(...);
template<typename Y> static char test(decltype(y<Y>())*);
static int const value=sizeof(test<X>(0));
};
typedef char type[junk<int>::value==sizeof... |
google | chromium | constexpr-deref | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-deref.C | 268 | utf_8 | a41ebf7ecedafc0c0d671848adb955fd | // { dg-options -std=c++0x }
struct A
{
const int *p[2];
};
constexpr const int * f(const int *p) { return p; }
int main()
{
constexpr int i = 42;
constexpr int j = *&i; // OK
constexpr int k = *A{{&i}}.p[0]; // OK
constexpr int l = *f(&i); // OK
}
|
google | chromium | auto23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto23.C | 84 | utf_8 | 42d00e4a58d35527c22193fc3509fae0 | // PR c++/46245
// { dg-options -std=c++0x }
template<auto f()->int> struct A { };
|
google | chromium | constexpr-data2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C | 981 | utf_8 | 334751d21e15a4981bda34616d3eabe8 | // { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename _Tp, _Tp v>
struct A3
{
typedef _Tp value_type;
typedef A3<value_type,v> type;
static constexpr value_type value = v;
constexpr operator value_type() { return value; }
};
// Partial specialization.
template<typename _Tp, _... |
google | chromium | constexpr-array-ptr7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr7.C | 282 | utf_8 | a621c183e9f56da1277a036e92a43fb1 | // PR c++/49290
// { dg-options -std=c++0x }
typedef unsigned T;
struct S
{
constexpr T foo (void);
unsigned s1[16];
};
constexpr T
S::foo ()
{
return *(T *) (s1 + 10);
}
constexpr S s = { 0,1,2,3,4,5,6,7,8,9,10 };
#define SA(X) static_assert ((X), #X)
SA(s.foo() == 10);
|
google | chromium | initlist53 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist53.C | 401 | utf_8 | 0312f5e7b816ce1a2160bb0b2ab7056d | // PR c++/49216
// { dg-options -std=c++0x }
// { dg-do run }
#include <initializer_list>
extern "C" void abort();
void * operator new[] (__SIZE_TYPE__, void *p) { return p; }
bool constructed;
struct A
{
A(std::initializer_list<int>) { constructed = true; }
};
int main() {
new A[1]{};
int space[1] = { 42 };
... |
google | chromium | range-for5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/range-for5.C | 753 | utf_8 | 52cc0641b88ba892142f45b2e62cdf8f | // Test for errors in range-based for loops
// { dg-do compile }
// { dg-options "-std=c++0x" }
struct container
{
};
int *begin(const container &c)
{
return 0;
}
int end(const container &c) //Ops! wrong type
{
return 0;
}
struct Implicit
{
Implicit(int x)
{}
};
struct Explicit
{
explicit Explicit(int x... |
google | chromium | vt-34754 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/vt-34754.C | 182 | utf_8 | 1cfb3c958fc83ba360a143ded32ea720 | // { dg-options "-std=c++0x" }
template<template<int> class... T> struct A
{
void foo(T<0>); // { dg-error "not expanded|T" }
void bar(T<0>); // { dg-error "not expanded|T" }
};
|
google | chromium | defaulted22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted22.C | 266 | utf_8 | 05ce1b49a98438ca33978323d158140e | // Test that a virtual defaulted constructor is still virtual.
// { dg-do run }
// { dg-options -std=c++0x }
int r = 1;
struct A
{
virtual ~A() = default;
};
struct B: A
{
~B() noexcept { r = 0; }
};
A* ap = new B();
int main()
{
delete ap;
return r;
}
|
google | chromium | defaulted17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted17.C | 163 | utf_8 | 954d4f27392aad9ed96de7b66e838e12 | // { dg-options -std=c++0x }
struct A // { dg-error "const|operator=" }
{
const int i;
};
int main()
{
A a = { 0 };
a = a; // { dg-error "deleted" }
}
|
google | chromium | variadic90 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic90.C | 150 | utf_8 | f80347db0d73cb0924ddb0b6f5e9f810 | // { dg-options "-std=c++0x" }
template<template<typename...> class TT>
struct X { };
template<typename T, typename U> struct pair { };
X<pair> x;
|
google | chromium | temp-constructor-bug | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/temp-constructor-bug.C | 118 | utf_8 | fc6f2e96c9f8ec014c9c4aa1c6219117 | // { dg-options "--std=c++0x" }
struct S { };
struct T
{
S s;
};
void f(T const &);
void g()
{
f((T){S()});
}
|
google | chromium | variadic100 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic100.C | 232 | utf_8 | 4dcf73c693bcf98a20be11c01c57fbe8 | // PR c++/43143
// { dg-options "-std=c++0x" }
template<typename T>
T&& declval();
template<class T, class... Args>
void test() {
T t(declval<Args>()...);
}
int main() {
test<const int>(); // OK
test<int[23]>(); // Error
}
|
google | chromium | initlist24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist24.C | 184 | utf_8 | 964298393533f1deb0d9c3e35699b371 | // PR c++/39923
// { dg-options "-std=c++0x" }
#include <initializer_list>
void test3()
{
std::initializer_list<int> list{move}; // { dg-error "not declared|could not convert" }
}
|
google | chromium | rv1n | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv1n.C | 5,577 | utf_8 | ea518a6f50b94ee5e80655e004858f17 | // 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 | constexpr-47969 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-47969.C | 179 | utf_8 | 992d2fb42e94b1fb034424f3e5592954 | // PR c++/47969
// { dg-options -std=c++0x }
struct A
{
// constexpr operator int () { return 1; }
};
constexpr A a = A();
int ar[a]; // { dg-error "has non-integral type" }
|
google | chromium | pr31431 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31431.C | 267 | utf_8 | ab9bd45c3833f8b2ecedc83bdab67dc6 | // { dg-options "-std=gnu++0x" }
template<typename..., typename> void foo(); // { dg-message "note" }
void bar()
{
foo<int>(); // { dg-error "no matching function" }
// { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 6 }
}
|
google | chromium | variadic73 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic73.C | 489 | utf_8 | 6ee28e41c85d3e102ed508fd3263c95e | // { dg-do run }
// { dg-options "-std=gnu++0x" }
struct A {};
struct B {};
struct C {};
template<typename... Exceptions> void f(int idx) throw(Exceptions...) {
if (idx == 0) throw A();
else if (idx == 1) throw B();
else if (idx == 2) throw C();
}
extern "C" void abort();
int main()
{
try {
f<A, B, C>(0);
... |
google | chromium | defaulted20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted20.C | 420 | utf_8 | 52f2351fe86bce2b1ae330d02d1ef4f9 | // PR c++/46497
// { dg-options -std=c++0x }
struct A {
A(A&&) = default; // { dg-message "A::A|no known conversion" }
};
struct B {
const A a;
B(const B&) = default;
B(B&&) = default; // { dg-error "implicitly deleted|no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
};
void ... |
google | chromium | nullptr13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr13.C | 295 | utf_8 | 8dcbc1541c2b9e0683c73a03dceafed4 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test typeid
#include <typeinfo>
#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
void fun()
{
typeid(nullptr);
const decltype(nullptr) mynull = 0;
typeid(mynull);
assert_true(typeid(nullptr) == typeid(mynull));
}
|
google | chromium | rv2n | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv2n.C | 21,266 | utf_8 | d3ffa5a7d68bfb2e86e4f23f03970517 | // 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 | variadic107 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic107.C | 310 | utf_8 | 495f16be454dfab754c8d5d430daad95 | // PR c++/48451
// { dg-options -std=c++0x }
namespace std {
template <class T> T&& declval();
}
template<class T, class... Args,
class = decltype(T(std::declval<Args>()...))
>
char f(int);
struct From2Ints { From2Ints(int, int); };
static_assert(sizeof(f<From2Ints, int, int>(0)) == 1, "Error"); // b
|
google | chromium | constexpr-ellipsis2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis2.C | 220 | utf_8 | 44722aa7d413ac4aea9c1f47e47bd868 | // { dg-options -std=c++0x }
struct A
{
A();
A(const A&);
bool empty();
};
constexpr int ellipsis(...) { return 1; }
static_assert(ellipsis(A().empty()), "Error"); // { dg-error "non-constant condition|empty" }
|
google | chromium | pr31438 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr31438.C | 237 | utf_8 | 825669c06b592081ee46c7b3f2839a43 | // { dg-options "-std=gnu++0x" }
template<typename> struct A;
template<typename T, typename... U> struct A<T(U)> // { dg-error "parameter packs|U" }
{
template<typename X> A(X);
};
A<void(int)> a(0); // { dg-error "incomplete type" }
|
google | chromium | auto11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/auto11.C | 190 | utf_8 | fc9eb91216b67d1f8b1342c8b7039163 | // PR c++/38256
// { dg-options "-std=c++0x" }
template<int> struct A
{
template<typename T> operator T();
};
void foo()
{
A<0>().operator auto(); // { dg-error "auto.*conversion" }
}
|
google | chromium | constexpr-abi1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-abi1.C | 203 | utf_8 | 4548e1509b7c8d98c899717a6e047ff8 | // PR c++/47301
// { dg-options "-std=c++0x -fabi-version=1" }
struct A
{
constexpr operator int ()
{
return 1;
}
};
template < int > struct B
{
static constexpr A a = A();
int ar[a];
};
|
google | chromium | implicit10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit10.C | 279 | utf_8 | 9ba981738e0d552ca1e02e2affea84e8 | // PR c++/46103
// { dg-options -std=c++0x }
struct MoveOnly {
MoveOnly(const MoveOnly&) = delete;
MoveOnly(MoveOnly&&) { }
MoveOnly() = default;
};
struct A {
MoveOnly mo[1];
A() = default;
A(A&&) = default;
};
int main() {
A a;
A aa = static_cast<A&&>(a);
}
|
google | chromium | nullptr07 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr07.C | 422 | utf_8 | 63277662514be04f72004b3a53ab6183 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test compare to int
void fun()
{
int n = 0;
if( n == nullptr ); // { dg-error "invalid operands of types " }
const int m = 1;
if( m == nullptr ); // { dg-error "invalid operands of types " }
decltype(nullptr) mynull = 0;
if( n == mynull ); // { dg-err... |
google | chromium | nullptr17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr17.C | 526 | utf_8 | 490d1900909eb89d5f1b43fea26f67c0 | // { dg-do compile }
// { dg-options "-std=c++0x" }
// Test that bool is a better overload match than int
template <typename T, typename U> struct tType_equal;
template <typename T> struct tType_equal<T, T> { typedef void type; };
template <typename T, typename U>
inline typename tType_equal<T, U>::type
type_equal(U... |
google | chromium | constexpr-attribute | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-attribute.C | 1,172 | utf_8 | 04125b4736ffd641c90fd0abdb84c3f4 | // { dg-options -std=c++0x }
//A few constexpr's
constexpr int foo() { return __alignof__(int); }
template<typename T>
constexpr int fooT() { return __alignof__(T); }
template<int N>
constexpr int fooN() { return N; }
//Now the attributes
//with normal variables,
int a __attribute__((aligned(foo())));
int b __attr... |
google | chromium | variadic2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic2.C | 503 | utf_8 | be09491ac08d1c7bda2bd004c7a559e9 | // { dg-options "-std=gnu++0x" }
template<typename... Args = int> // { dg-error "default argument" }
class tuple2;
template<typename... = int> // { dg-error "default argument" }
class tuple3;
template<typename T1, typename T2, typename... Rest>
struct two_or_more {}; // { dg-error "provided for" }
typedef two_or_mor... |
google | chromium | variadic23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic23.C | 561 | utf_8 | 7615032e452443ba81dd6860d86129d7 | // { dg-options "-std=gnu++0x" }
template<typename T, int... Dims>
struct array {
static const int value = 0;
};
template<>
struct array<int, 17> {
static const int value = 1;
};
template<int... Dims>
struct array<float, 1, Dims...> {
static const int value = 2;
};
template<typename T, int... Dims>
struct arr... |
google | chromium | variadic42 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic42.C | 282 | utf_8 | 882edd920ddef1a6fbd93d4332151817 | // { dg-options "-std=gnu++0x" }
// { dg-do compile }
template<typename... Args>
void f(Args...) { }
void g()
{
f<int*, float*, double*>(0, 0, 0);
f<int*>(0,0,0);
}
// { dg-final { scan-assembler "_Z1fIIPiPfPdEEvDpT_" } }
// { dg-final { scan-assembler "_Z1fIIPiiiEEvDpT_" } }
|
google | chromium | enum15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum15.C | 301 | utf_8 | 136cf9f59d9f42c7f21ac24a24fb8505 | // PR c++/44311
// { dg-options -std=c++0x }
enum class A { Val0, Val1 };
void foo (A a, int i)
{
switch (a)
{
case A::Val0: break;
case 1: break; // { dg-error "" }
}
switch (i)
{
case A::Val0: break; // { dg-error "" }
case 1: break;
case 2.0: break;
}
}
|
google | chromium | bracket1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/bracket1.C | 249 | utf_8 | 6743256e07715e769f21ff6578280278 | // { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T>
struct list {};
template<typename T>
struct vector {
operator T() const;
};
void f()
{
vector<vector<int>> v;
const vector<int> vi = static_cast<vector<int>>(v);
}
|
google | chromium | decltype7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype7.C | 267 | utf_8 | c3626f3b26fbb53bd234a4e39649b63f | // PR c++/34268
// { dg-do compile }
struct A
{
__decltype (A); // { dg-error "must be an expression" }
__decltype (~A); // { dg-error "must be an expression" }
};
struct B
{
__typeof__ (B);
__typeof__ (~B); // { dg-error "expected primary-expression" }
};
|
google | chromium | variadic114 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic114.C | 504 | utf_8 | 927501f16002dd77eab6d346fd9f61fe | // PR c++/49785
// { dg-options -std=c++0x }
template <typename, typename ...> struct B { };
template <typename> class A;
template <typename R, typename ... S>
struct A <R (S ...)> : public B <R, S ...>
{
struct C {};
template <typename D> A (D, C = C ()) { }
R operator () (...);
};
template <typename R, typen... |
google | chromium | constexpr-array3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-array3.C | 140 | utf_8 | 1e9229a63c4a04472e33296aafbd13ac | // PR c++/48132
// { dg-options -std=c++0x }
struct C
{
constexpr C (int x) : c (x) {}
int c;
};
void
foo ()
{
C a[] = { C (0) };
}
|
google | chromium | constexpr-ctor8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor8.C | 157 | utf_8 | 331a944ec60c32d28b16a762489ff405 | // PR c++/46466
// { dg-options "-std=c++0x -fno-elide-constructors" }
struct S { bool b; };
constexpr S f() { return S{true}; }
static_assert(f().b, "");
|
google | chromium | pr32125 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr32125.C | 153 | utf_8 | 50b3b289f7f997c655ffb07822094555 | // { dg-options "-std=c++0x" }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
{
A();
A(T);
};
|
google | chromium | constexpr-static | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-static.C | 572 | utf_8 | f28bf1ad973f2d63cf8d6c321e646970 | // Test for constant initialization of non-literal class (e.g. mutex)
// { dg-options "-std=c++0x -save-temps" }
// { dg-do run }
struct A
{
int i;
constexpr A(int _i): i(_i) { }
A(const A&); // non-trivial copy ctor makes A non-literal
};
A a(42); // constexpr constructor allows constant initializa... |
google | chromium | constexpr-recursion | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion.C | 256 | utf_8 | 5dd62e5efa439deb8f867c2329cd8ac5 | // Test that we catch excessive recursion.
// { dg-options "-std=c++0x -fconstexpr-depth=5" }
// { dg-prune-output "in constexpr expansion" }
constexpr int f (int i) { return f (i-1); }
constexpr int i = f(42); // { dg-error "constexpr evaluation depth" }
|
google | chromium | nullptr23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr23.C | 298 | utf_8 | c6bb4c0f3b538c300a9e10bc9d66a3d5 | // PR c++/50361
// { dg-options -std=c++0x }
#include <initializer_list>
struct Foo
{
Foo(std::initializer_list<Foo>) { };
template<class T> Foo(T t) { T u(t); };
private:
union Data
{
Data() : null(nullptr) {}
std::nullptr_t null;
} u_;
};
int main()
{
Foo f = { {} };
}
|
google | chromium | explicit6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/explicit6.C | 235 | utf_8 | 82200a0de005e825c670882e79f3a564 | // PR c++/47080
// { dg-options -std=c++0x }
struct A {
explicit operator int(); // { dg-message "qualification conversion" }
};
int main() {
bool b((A())); // { dg-error "invalid user-defined" }
!A(); // { dg-error "" }
}
|
google | chromium | implicit8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/implicit8.C | 723 | utf_8 | 0d6a3edc996b4bf0ab3c7ba4f50d49a0 | // The hack for PR c++/44909 breaks this testcase. We need feedback
// from the C++ committee to know how to proceed.
// { dg-options -std=c++0x }
// { dg-prune-output "implicitly deleted" }
// { dg-prune-output "cannot bind" }
// { dg-prune-output "initializing argument" }
struct A
{
A();
A(A&);
};
struct B;
stru... |
google | chromium | variadic-crash2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C | 375 | utf_8 | f06a65477a4f391c3316123286e42cb3 | // Origin: PR c++/39637
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<class... Types>
void
f(Types...)
{
enum {e = sizeof(Types)}; // { dg-error "parameter packs not expanded with '...'" }
enum {e1 = sizeof...(Types)};
}
int
main()
{
f(0);
}
// { dg-message "note" "Types" { target *-*-* } 10 } |
google | chromium | trailing2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/trailing2.C | 469 | utf_8 | dff8e484f5ebc462a610d96381bb6352 | // PR c++/37967
// Negative test for auto
// { dg-options "-std=c++0x" }
auto f1 () -> int;
auto f2 (); // { dg-error "without late return type" }
int f3 () -> int; // { dg-error "late return type" }
auto *f4 () -> int; // { dg-error "late return type" }
struct A
{
auto f5 () const -> int;
auto f6 (); // { dg-e... |
google | chromium | decltype11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype11.C | 130 | utf_8 | b1ca5344811760f6e82c858f672bd0f6 | // PR c++/35316
// { dg-options "-std=c++0x" }
template<int> struct A
{
int i : 2;
void foo()
{
decltype(i) j;
}
};
|
google | chromium | variadic44 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic44.C | 232 | utf_8 | e9bb2fef020609c3ee50141c2338a550 | // { dg-options "-std=gnu++0x" }
// { dg-do compile }
template<typename... Args>
int f(const Args&...);
template<typename T> void g(T) { }
void h()
{
g(&f<int, float>);
}
// { dg-final { scan-assembler "_Z1gIPFiRKiRKfEEvT_"} }
|
google | chromium | variadic110 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic110.C | 220 | utf_8 | a0421187555abab845ee74851f64f71e | // PR c++/45698
// { dg-options -std=c++0x }
template <class... Ts> struct tuple { };
template<class... Ts>
struct A {
template<typename T> struct N { };
tuple<N<Ts>...> tup;
};
int main()
{
A<int, double> a;
}
|
google | chromium | noexcept09 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept09.C | 321 | utf_8 | a5ee9fb53f7cb06a4c7ffc8379b8b156 | // Test that -Wnoexcept works with templates
// { dg-options "-std=c++0x -Wnoexcept" }
template <class T>
T f (T t) { return t; } // { dg-warning "does not throw" }
#define SA(X) static_assert(X, #X)
SA (!noexcept(f(1))); // { dg-warning "noexcept" }
int main()
{
f(1); // Use f(int) so it gets instantiated
}... |
google | chromium | noexcept04 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept04.C | 574 | utf_8 | c53570ed93712825e62e384d5342d798 | // Make sure that we call terminate when a noexcept spec is violated.
// The function pointers are there to make sure that
// the compiler doesn't get clever about optimizing the calls based on
// knowledge about the called functions.
// { dg-options "-std=c++0x" }
// { dg-do run }
#include <exception>
#include <cstd... |
google | chromium | variadic21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic21.C | 149 | utf_8 | 57823f63ca045ff8b8c15796278b39d1 | // { dg-options "-std=gnu++0x" }
template<typename T, int... Dims>
struct array { };
array<int> a0;
array<int, 1> a1;
array<int, 1, 2, 3, 4> a1234;
|
google | chromium | trailing5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/trailing5.C | 178 | utf_8 | d0d8f484e5d5d333ca0101b985fc1397 | // PR c++/38798, DR 770
// { dg-options -std=c++0x }
struct A {};
auto foo() -> struct A {}
enum B {};
auto bar() -> enum B {}
auto baz() -> struct C {} {} // { dg-error "" }
|
google | chromium | static_assert2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/static_assert2.C | 726 | utf_8 | 8cbc91f4f007ae34557f6cc27a860398 | // { dg-options "-std=c++0x" }
template<int I>
struct accept_evens {
static_assert( I % 2 == 0, "I must be an even number"); // { dg-error "even number" }
};
template<int I>
struct accept_evens_ok {
static_assert( I % 2 == 0, "I must be an even number");
};
template<int I>
void accept_odds() {
static_assert( I ... |
google | chromium | variadic65 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic65.C | 323 | utf_8 | ffb178f32d948f5a5c9a54d7f36d2e2e | // { dg-options "-std=gnu++0x" }
struct unused;
template<typename T1 = unused, typename T2 = unused, typename T3 = unused,
typename T4 = unused, typename T5 = unused, typename T6 = unused>
struct tuple {};
template<typename... Args>
void foo(tuple<Args...>) { } // { dg-bogus "cannot expand" "" { xfail *-*-* }... |
google | chromium | inline-ns5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/inline-ns5.C | 107 | utf_8 | 868d9c1bbed4bb85f1cbb3ad116f6eb1 | // { dg-options "-std=gnu++98 -pedantic-errors" }
inline namespace { } // { dg-error "inline namespaces" }
|
google | chromium | decltype27 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype27.C | 126 | utf_8 | 24f2cc126dd983252549de044acf1c49 | // PR c++/48617
// { dg-options -std=c++0x }
template<class T, decltype(T())> // #
struct A {};
A<int, 0> a;
int main() {}
|
google | chromium | extern_template-3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/extern_template-3.C | 153 | utf_8 | a90d02344ce471556a85a9970c53f219 | // PR c++/37256
// { dg-options "-O" }
template <typename T_>
struct B
{
T_ f();
};
extern template class B<int>;
void f()
{
B<int> t;
t.f();
}
|
google | chromium | variadic12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic12.C | 1,144 | utf_8 | 55e99e1f39f96e8dde30908350a29ef4 | // { dg-options "-std=gnu++0x" }
// A tuple type
template<typename... Args> struct tuple { };
// Determine if two types are the same
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;
};
// Append 'T' t... |
google | chromium | decltype4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype4.C | 1,963 | utf_8 | 279dfeb78dc189adeb256c12c0eb074e | // { 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 >::valu... |
google | chromium | sfinae11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/sfinae11.C | 1,219 | utf_8 | 60f4fb768016f9bd819cf8f344a9fd6c | // PR c++/48468
// { dg-options -std=c++0x }
// { dg-prune-output "note" }
template<class T>
T&& declval() noexcept;
template< class T >
inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error "Z" }
{
x.foo();
}
template< class T,
bool Noexcept = noexcept( declval<T&>().foo() )
>
inline ... |
google | chromium | variadic58 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic58.C | 380 | utf_8 | 78d145f1910f8b120ca926a7f9715581 | // { dg-options "-std=gnu++0x" }
#include <typeinfo>
template<typename... Args>
void foo(Args...) { }
template<typename... Args>
void bar(Args... args) {
foo(Args()...);
foo(args = args...);
foo(reinterpret_cast<void*>(&args)...);
foo(const_cast<const Args>(args)...);
foo(static_cast<void*>(&args)...);
fo... |
google | chromium | pr33930 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr33930.C | 169 | utf_8 | ed8d33150d8adcb5ff8de3100148a57a | // { dg-options "-std=c++0x" }
typedef const int* type;
float& foo( const type& ggg );
int& foo( type&& ggg );
void bar( int* someptr )
{
int& x = foo( someptr );
}
|
google | chromium | pr39639 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/pr39639.C | 455 | utf_8 | e57b266fc849b2221f7d9a45f1267c75 | // Origin: PR c++/39639
// { dg-do compile }
// { dg-options "-std=c++0x" }
template <class... Types>
struct S
: S<...Types>, // { dg-error "expected parameter pack before '...'" }
S<...Types...>, // { dg-error "expected parameter pack before '...'" }
S<...> // { dg-error "expected parameter pack before '...'... |
google | chromium | scoped_enum2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/scoped_enum2.C | 254 | utf_8 | 625da61bafb88e5f93285e87cb09c98d | // { dg-options -std=c++0x }
enum class E { e = 10 };
enum E2 { e2 = 10 };
struct C {
int arr[E::e]; // { dg-error "non-integral type" }
int arr2[E2::e2]; // OK
int i: E::e; // { dg-error "non-integral type" }
int i2: E2::e2; // OK
};
|
google | chromium | variadic32 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/variadic32.C | 166 | utf_8 | fac9060fdc968ccc2abbb2e4e031e333 | // { dg-options "-std=gnu++0x" }
template<typename... T>
void eat(const T&...) { }
void f()
{
eat();
eat(1);
eat(1, 2);
eat(17, 3.14159, "Hello, World!");
}
|
google | chromium | enum19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/enum19.C | 223 | utf_8 | ebe8e05bc54f51359fbdd8f97f3a1e5d | // We shouldn't give an ABI warning about promotion in switch.
// { dg-options "-std=c++0x -fabi-version=5 -Wabi" }
enum class Foo { X };
void test(Foo val)
{
switch(val)
{
case Foo::X:
break;
}
};
|
google | chromium | noexcept02 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/noexcept02.C | 1,232 | utf_8 | 7bc8cfdb03f7e234e4126cc110de22d9 | // Test for noexcept-specification
// { dg-options "-std=c++0x" }
#define SA(X) static_assert(X, #X)
void f();
void f() noexcept(false);
void f() noexcept(1 == 0);
void f();
SA(!noexcept(f()));
void g() throw (int); // { dg-error "previous declaration" }
void g() noexcept(false); // { dg-error "different exception... |
google | chromium | decltype29 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype29.C | 417 | utf_8 | 628b007a0fd21a2af28f62b3af247387 | // PR c++/44175
// { dg-options -std=c++0x }
template <bool, class T> struct enable_if { };
template <class T> struct enable_if <true, T> { typedef T type; };
template <int x>
typename enable_if<x==0,int>::type
ft() {}
template<class F, int N>
decltype (ft<F> (F()))
ft() {} // { dg-error "depth" }
int main() {
... |
google | chromium | decltype10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/decltype10.C | 211 | utf_8 | cd06903b180590e9b430016409918b61 | // PR c++/34271
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<int> struct A
{
static int i;
};
template<int N> int A<N>::i(decltype (A::i; // { dg-error "expected primary-expression before" }
|
google | chromium | defaulted26 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted26.C | 162 | utf_8 | 2825b2a468bd7b80de0bb0d3ece4781d | // PR c++/49066
// { dg-options -std=c++0x }
void foo() = delete; // { dg-error "declared here" }
void foo();
int main() { foo(); } // { dg-error "deleted" }
|
google | chromium | defaulted1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/defaulted1.C | 508 | utf_8 | dcbdd542e2a8c2332e6116fb05995fba | // Positive test for defaulted/deleted fns
// { dg-do run }
// { dg-options "-std=c++0x" }
struct A
{
int i;
A() = default;
A(const A&) = delete;
A& operator=(const A&) = default;
~A();
};
A::~A() = default;
void f() = delete;
struct B
{
int i;
B() = default;
};
int main()
{
A a1, a2;
B b = {1};
... |
google | chromium | rv8p | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/rv8p.C | 1,714 | utf_8 | d08b5679febeab9283e5914fedd26c59 | // 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 | initlist37 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/cpp0x/initlist37.C | 501 | utf_8 | d17a6da849d2b2502bbf191471575393 | // DR 990
// { dg-options "-std=c++0x" }
#include <initializer_list>
struct S {
S(std::initializer_list<double>); // #1
S(std::initializer_list<int>); // #2
S(); // #3
// ...
};
S s1 = { 1.0, 2.0, 3.0 }; // invoke #1
S s2 = { 1, 2, 3 }; // i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.