plateform stringclasses 1
value | repo_name stringclasses 2
values | name stringlengths 1 78 | ext stringclasses 2
values | path stringlengths 15 1.11k | size int64 1 8.55M | source_encoding stringclasses 11
values | md5 stringlengths 32 32 | text stringlengths 0 8.49M |
|---|---|---|---|---|---|---|---|---|
google | android | ttp64 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ttp64.C | 1,056 | utf_8 | 4ab0afb1cb3c9db02b756d5cf4e5e6f0 | // { dg-do assemble }
// Bug: We fail to set DECL_TEMPLATE_PARM_P when reducing template
// parameter level.
template <class T> class A2 {
public:
A2() {}
virtual ~A2() {}
template <class other> A2 & operator=(const A2<other> o) {
i=o.i;
return *this;
}
T i;
T j;
};
template <class T> cla... |
google | android | crash47 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash47.C | 363 | utf_8 | 3814395846f273915594218124823208 | // { dg-do assemble }
template <class Owner, typename Type>
struct DataMember
{
inline DataMember (Type Owner::* data_member);
Type Owner::* _data_member;
};
template <class Owner, typename Type>
inline
DataMember<Owner,Type>::DataMember (Type Owner::* data_member)
: _data_member (data_member)
{
} |
google | android | memtemp3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp3.C | 272 | utf_8 | 36d4d3c6025343e652003f710e36c1ba | // { dg-do link }
// GROUPS passed templates membertemplates
extern "C" int printf(const char*, ...);
struct S {
template <class T>
void foo(T);
};
template <class T>
void S::foo(T)
{
printf("Hello, world.\n");
}
int main()
{
S s;
s.foo(3);
s.foo(s);
}
|
google | android | auto_ptr | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C | 1,730 | utf_8 | 8f4139d159d226f0a5e70a51dd2ca345 | // { dg-do assemble }
template <typename Y> struct auto_ptr_ref {
Y* py;
auto_ptr_ref(Y* p) : py(p) {}
};
template<typename X> struct auto_ptr {
X* px;
public:
typedef X element_type;
explicit auto_ptr(X* p =0) throw() : px(p) {}
auto_ptr(auto_ptr& r) throw() : px(r.release()) {} // { dg-message "not... |
google | android | typename11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename11.C | 258 | utf_8 | f0e11d6518f0fceed09780cc74f1c25a | // { dg-do assemble }
template <class T, int I>
struct S {
struct X {};
};
template <class T, class U, int I>
typename S<T,I>::X f(T, U) {
typename S<T, I>::X();
return typename S<T, I>::X();
}
template S<int, 3>::X f<int, double, 3>(int, double);
|
google | android | t16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t16.C | 601 | utf_8 | db61d490571ac4a6c293fd7847f28c80 | // { dg-do run }
extern "C" int printf (const char *, ...);
template <class T> T max (const T&x, const T&y)
{
return (x>y)?x:y;
}
int min (const float&, const float&);
int min (const int& i1, const int& i2) {
return (i1 < i2) ? i1 : i2;
}
class complex
{
double re, im;
public:
complex (double r, double i=0) ... |
google | android | memtemp65 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp65.C | 331 | utf_8 | f4f0157f17dc22f1dd440e652a01fc84 | // { dg-do assemble }
template<unsigned int n> struct PartialDotProduct {
template<class T>
static T Expand(T* a, T* b) { return T(); }
};
const int N = 10;
template<class In1, class In2>
void
dot(In1 f1, In2 f2)
{
PartialDotProduct<N>::Expand(f1, f2);
}
int main()
{
double a[N], b[N];
dot(&a[0],... |
google | android | instantiate9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/instantiate9.C | 485 | utf_8 | 9b52836d0b5cc24477740b8ffda0b8b4 | // { dg-do assemble }
// Bug 789. We ICE'd trying to instantiate B<float> because there was no
// existing partial specialization of C in A<float>.
template <typename T>
struct A {
template <typename D1>
struct C { };
};
template <typename T1>
struct B {
typename A<T1>::template C<int> s1;
};
int main()
{
... |
google | android | enum6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/enum6.C | 244 | utf_8 | 3f167732c6384edca3e309289b2a7c1f | // { dg-do assemble }
template <class T>
struct vector {};
template<class T>
void fn(T)
{
enum tern { H, L, X, U };
vector<tern> ternvec; // { dg-error "" "" { target { ! c++11 } } } composed from a local type
}
template void fn(int);
|
google | android | ttp23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ttp23.C | 393 | utf_8 | 7b8b66cea56883c0d8c13376f47e201d | // { dg-do run }
template<class T> class D
{
public:
int f();
};
template<class T> int D<T>::f()
{
return sizeof(T);
}
template<template<class> class E,class D> class C : E<D>
{
public:
int f();
};
template<template<class> class E,class D> int C<E,D>::f()
{
return E<D>::f();
}
class E : C<D,int>
{
public:... |
google | android | ptrmem7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ptrmem7.C | 163 | utf_8 | 43af7526c15acf063c86ed2628da6ed1 | // { dg-do assemble }
struct A {
int i;
};
template<const int A::* P>
struct B { };
int main()
{
B<&A::i> b;
} |
google | android | t04 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t04.C | 201 | utf_8 | b50c701134c37b321e4a69d0c58403cc | // { dg-do assemble }
template <class A> class B { public: A a; };
static B<int> b_int;
static B<char> b_char;
static B<unsigned char> b_uchar;
int foo () { return b_int.a + b_char.a + b_uchar.a; }
|
google | android | explicit76 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit76.C | 215 | utf_8 | 2104f62c7cc5239c486541c241ef89b5 | // { dg-do assemble }
struct foo {
template <class T> void bar();
};
template void foo::bar<void>(); // { dg-bogus "" "" { xfail *-*-* } } - ICE - |
google | android | memtemp35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp35.C | 233 | utf_8 | ec27f665d21ce7ab16a07bd62e210ce5 | // { dg-do assemble }
// GROUPS passed templates membertemplates
template <class T>
struct S
{
S(const S& s) {}
template <class U>
S(S<U>& s)
{
S<U> s2(s);
}
};
extern S<int>& si;
void foo()
{
S<char*> sc(si);
}
|
google | android | memclass15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memclass15.C | 300 | utf_8 | 7c353edc5e8c81c94f858f4fde721e74 | // { dg-do assemble }
template <class T>
struct S1
{
template <class U>
struct S2 {};
template <class X, class Y, class Z>
void f(X, Y, Z)
{
S2<Z> s2z;
}
template <class X, class Z>
void g(X, Z)
{
S2<Z> s2z;
}
};
void h()
{
S1<int> si;
si.g(3, 4);
}
|
google | android | memclass17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memclass17.C | 220 | utf_8 | 8bec4cc1da1e18f32458e4c3a3c8af2f | // { dg-do assemble }
template <class T> struct S
{
template <class U> struct I
{
};
S();
S(S& s);
S(I<T>);
template <class U> operator I<U>();
};
S<int> f();
void g(S<int>);
void h()
{
g(f());
}
|
google | android | memtemp64 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp64.C | 265 | utf_8 | 38d96a224830c7705b0dffc6e34755ab | // { dg-do assemble }
template <class T>
struct S1 {};
template <class T>
void f(T);
template <class C>
struct S2
{
template <class T>
void f<S1<T> >(T) {} // { dg-error "" } bad specialization.
};
template <class T>
struct S3
{
friend class S2<T>;
};
|
google | android | explicit23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit23.C | 225 | utf_8 | ff368b7934b08c23823271b831360d66 | // { dg-do link }
// { dg-options "-ansi -pedantic-errors -w" }
// GROUPS passed templates
template <class T>
int foo(T t) { return 1; }
template <>
int foo<int>(int i) { return 0; }
int main()
{
return foo<int>(3.0);
}
|
google | android | memtemp85 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp85.C | 241 | utf_8 | e998842784d030d4fab2fcc177428ba6 | // { dg-do assemble }
struct Q {
template<class>
class X {
};
};
template<template<class> class>
class Y {
};
Y<Q::X> y1; |
google | android | crash27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash27.C | 173 | utf_8 | 8986c1670e0c717d65ec99c78532722b | // { dg-do assemble }
template<int i> int f (void)
{
if (__extension__ ({ 1; }))
return 0;
return 1;
}
void g (void)
{
f<1> ();
}
|
google | android | friend41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/friend41.C | 294 | utf_8 | 31398208b74ece771fe1f2f73fcba014 | // { dg-do assemble }
template <class T>
class S {
public:
template <class U>
class C {
public:
void f() { S::i = 3; }
};
template <class U>
friend class C;
private:
static int i;
};
template void S<int>::C<double>::f(); |
google | android | lookup6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/lookup6.C | 500 | utf_8 | 4922c229088bbca4c83064c2e8943fef | // { dg-do assemble }
class t {};
template <class T> struct A { typedef T t; typedef T u; };
template <class T> struct B : public A<T> {
// according to [temp.dep.type], `t' and `u' cannot be dependent types,
// and so there's no reason to delay lookup to specialization time.
void f(t p); // this is ::t [temp.de... |
google | android | typename22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename22.C | 266 | utf_8 | 82b2d6c1bd6b51ffd07d163c6670c8d0 | // { dg-do assemble }
template <class T>
struct S {
template <class U>
struct I {
typedef U X;
X f();
};
};
template <class T>
template <class U>
typename S<T>::template I<U>::X S<T>::I<U>::f() {} |
google | android | typename23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename23.C | 257 | utf_8 | 0d1d1652f65bda4acdaf004a283dac4e | // { dg-do assemble }
template<class T>
void value_type(T){}
template <class T>
struct B{
typedef T value_type;
};
template<class>class Vector{};
template<class T>
struct D:B<T>{
Vector<value_type> r; // { dg-error "" } value_type is not a type
};
|
google | android | virtual1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/virtual1.C | 200 | utf_8 | eb15972adcb852ad15bcb37d39739ce8 | // { dg-do run }
struct V { virtual ~V() {} };
template <class T> struct A : virtual V { };
template <class T> struct B {
virtual void f() { T foo; }
};
int main() { B< A<int> > bar; }
|
google | android | ttp49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ttp49.C | 161 | utf_8 | fc6613a2b4cdea9da335da10b446300a | // { dg-do assemble }
template <int i> class C {};
template <template <long> class TT> class D {};
int main()
{
D<C> d; // { dg-error "" } args not match
}
|
google | android | inherit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/inherit1.C | 453 | utf_8 | b3a04570db4fdb69f0df03a3fcf1d309 | // { dg-do run }
int i = 1;
struct Base1 { int local1; };
struct Base2 { int local2; };
template <int dim> class Derived;
template <>
class Derived<1> : public Base1, public Base2 {};
template <int dim>
class FinalClass : public Derived<dim> {
public:
FinalClass () {
if (&this->local1 != &this->local2)
... |
google | android | spec19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec19.C | 127 | utf_8 | 20894f40e5d69e5aae0b8e042159c827 | // { dg-do assemble }
template<class T> T f(T o) { return o; }
template<> int f(int o) { return o; }
template int f(int);
|
google | android | typedef4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typedef4.C | 237 | utf_8 | 71a2c13ad42702533a6f21d43d2049d5 | // { dg-do assemble }
struct B1 {
typedef int X;
};
struct B2 {
typedef int X;
};
template <class T>
struct D : public B1, public B2 {
typedef int X;
};
template struct D<int>; |
google | android | spec8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec8.C | 227 | utf_8 | 3612c391a5a866716ef9cd0a70802bfe | // { dg-do run }
extern "C" void abort();
template <void* P>
void f(int j);
template <int I>
void f(int j);
template <void* P>
void f(int j)
{
abort();
}
template <int I>
void f(int j)
{
}
int main()
{
f<3>(7);
}
|
google | android | ptrmem6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C | 749 | utf_8 | e2a99f033bd90bddb4e27cd5f0ff6575 | // { dg-do assemble }
class A {
public:
virtual void f();
int i;
};
class B : public A {
public:
void f();
int j;
};
template <void (A::*)() >
void g() {}
template <int A::*>
void h() {}
int main() {
g<&A::f>();
h<&A::i>();
g<&B::f>(); // { dg-error "" }
h<&B::j>(); // { dg-error "" }
g<(void ... |
google | android | explicit26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit26.C | 178 | utf_8 | ff484f1d424746014d1bcf8bf7f8a1b1 | // { dg-do link }
// GROUPS passed templates
template <class T>
int foo(T t) { return 1; }
template <>
int foo(int i) { return 0; }
int main()
{
(int (*)(int)) &foo<int>;
}
|
google | android | overload5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/overload5.C | 169 | utf_8 | cf5bc865967699ad3f2906d8d936bfe5 | // { dg-do assemble }
template <class T> void foo(); // { dg-message "" } candidate
void (*bar)() = foo<void>;
void (*baz)() = foo; // { dg-error "" } can't deduce T
|
google | android | memtemp77 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp77.C | 483 | utf_8 | 13318d291465bb4d363f8f6cec839efb | // { dg-do run }
extern "C" int strcmp(const char*, const char*);
template <class T>
struct S3
{
template <class U>
static const char* h(U);
};
template <>
template <>
const char* S3<double>::h(int) { return __PRETTY_FUNCTION__; }
template <>
template <>
const char* S3<char>::h(int) { return __PRETTY_FUNCTION__... |
google | android | overload4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/overload4.C | 199 | utf_8 | 3810576128729d1dc68f6e22b99defef | // { dg-do assemble }
template <class T> void foo(T);
template <class T> void bar(void (*)(T), T);
void baz() {
bar<int>(foo, 1);
bar(foo<int>, 1);
bar<int>(foo<int>, 1);
bar(foo, 1);
}
|
google | android | typename27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename27.C | 428 | utf_8 | 679e18c47a0bd7b78b62cbf46c438146 | // { dg-do assemble }
//
// bugs 173, 174 & 406 all ICE'd due to Koenig lookup involving
// typename T::t.
struct A
{
typedef int type;
};
template<typename T> void same_key (T, typename T::type);
template <class T> void foo (T *, void (*) (T, int));
void baz (A *ptr)
{
foo (ptr, same_key);
} |
google | android | lookup7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/lookup7.C | 205 | utf_8 | ace1d008dd08c5bb54e89244f9df1cd6 | // { dg-do assemble }
struct A { typedef int B; };
template <int B> struct C : public A {
B b;
void f();
};
template <int B>
void C<B>::f() {
B b;
} |
google | android | memtemp20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp20.C | 522 | utf_8 | 57131ddff95db101deaa3f1a8531b57f | // { dg-do link }
// GROUPS passed templates membertemplates
extern "C" int printf(const char*, ...);
struct S
{
template <class T, class U>
void foo(T t, U u);
template <class U>
void foo(char*, U);
void foo(int i);
};
template <class T, class U>
void S::foo(T t, U u)
{
printf ("T,U version\n");
}
t... |
google | android | defarg8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C | 472 | utf_8 | e9e4ffab1856eb43275fed8552ccdd51 | // { dg-do assemble }
// Default arguments containing more than one non-nested explicit
// template argument leads to parse error
// This might be ill formed. See DR 325 (one proposed resolution is to make
// it so)
template <class T> class foo1;
template <class T, class U> class foo2;
struct bar {
template <cla... |
google | android | nttp1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/nttp1.C | 323 | utf_8 | fb0d9b0c70fadf9233f9da77e12933ab | // { dg-do run }
// Test for nested template template parameter feature
template <template<template <class> class> class TTT> struct C
{
int f();
};
template <template<template <class> class> class TTT> int C<TTT>::f()
{
return 0;
}
template <template <class> class TT> struct D
{
};
int main()
{
C<D> c;
c.f();... |
google | android | cast2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/cast2.C | 546 | utf_8 | e4534f08b10c7d0e52a22a8c645b799d | // { dg-do assemble }
// Bug 1588. We ICE'd on reparsing an absdcl as a cast inside a template
// function.
class A {
public:
template <class T> void f(void *CLUTp);
};
template <class T> void A::f(void *CLUTp)
{
void *CLUT;
CLUT = (unsigned char [3][256])CLUTp; // { dg-error "" } cast to array
return;
}
... |
google | android | t18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t18.C | 272 | utf_8 | 933beb1baf7c9b5eba412bbc82a23eb3 | // { dg-do assemble }
extern void byebye ();
template <class T1, class T2>
struct A
{
T1 t1;
T2 t2;
A() { t1 = 0; t2 = 0; }
~A() { byebye(); }
};
template <class Q>
int f (A<int, Q> a) {
return a.t1;
}
extern A<int,double*> aa;
int foop () { return f(aa); }
|
google | android | decl4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/decl4.C | 224 | utf_8 | bb80eeb4577bc0be3bc12a6e2efd2bef | // { dg-do assemble }
typedef std::vector<int>::iterator iter; // { dg-error "" } syntax error before `::' |
google | android | spec2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec2.C | 284 | utf_8 | 6dea43e72960bc1d42aee3da9eaf0230 | // { dg-do assemble }
class X
{
public:
virtual void f() const = 0;
};
template <class T>
class Y: public X
{
public:
virtual void f() const;
};
template <class T>
void Y<T>::f() const
{
}
template <>
void Y<bool>::f() const;
template <>
void Y<bool>::f() const
{
}
|
google | android | m9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/m9.C | 217 | utf_8 | 46df5c4cfffb3709e86a3342eda1d702 | // { dg-do assemble }
struct A { A() { a = 1; } int a; };
struct Q {
struct A { A() { a = 2; } int a; };
struct R {
struct A { A() { a = 3; } int a; };
A aaz;
};
R rrr;
A aay;
}
;
Q qqq;
A aav;
|
google | android | spec21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec21.C | 619 | utf_8 | 52d3bef899d8ffa7c94dcdd013dd1d9d | // { dg-do assemble }
template <class T> struct S {};
template <class T = int> struct S<T*> {}; // { dg-error "" } default argument
template <int I, int J> struct A {};
template <int I> struct A<I+5, I*2> {}; // { dg-error "" } argument involves parameter
template <class T, T t> struct C {};
template <class T> stru... |
google | android | spec15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec15.C | 599 | utf_8 | 2f8e3ba39b62e7596b8074418d5931ca | // { dg-do run }
extern "C" void abort();
template <class T>
struct S1
{
static void f();
};
template <>
void S1<int>::f() {}
struct S2
{
template <class T>
static void g(T);
};
template <>
void S2::g(double) {}
template <>
void S2::g<int>(int) {}
template <class T>
struct S3
{
template <class U>
stati... |
google | android | explicit36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit36.C | 205 | utf_8 | ddc0504c1242a1e73e50ba46667f3643 | // { dg-do link }
// GROUPS passed templates
template <class T>
void foo(T);
class S {
friend void foo<>(int);
int i;
};
template <>
void foo(int)
{
S s;
s.i = 3;
}
int main()
{
foo(3);
}
|
google | android | spec23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec23.C | 208 | utf_8 | 367cdf2dd4f938be53439e37487c6a8f | // { dg-do assemble }
/* [temp.expl.spec] p18. */
template<class T>
struct A {
template <class U> class B { };
};
template<class T>
class A<T>::B<void> { // { dg-error "" } only one template header
};
|
google | android | t20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t20.C | 164 | utf_8 | 1a70177ec379802cdf5ee9ffeb79c086 | // { dg-do assemble }
template <class X> class A {
public:
X aaa;
int foo();
};
template <class X> A<X> f(X);
void frep() {
int x;
x = f(6.4).foo();
}
|
google | android | memtemp14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp14.C | 409 | utf_8 | 5a36894e465df251f14dcf5bbd344d34 | // { dg-do link }
// GROUPS passed templates membertemplates
extern "C" int printf (const char *, ...);
template <class T>
struct S
{
template <class U, class V>
void foo(U, V);
};
template <class T>
template <class U, class V>
void S<T>::foo(U, V)
{
printf("Hello, world.\n");
}
int main()
{
S<int> s;
s... |
google | android | crash37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash37.C | 292 | utf_8 | 9d42fed92afdbda595ff8b94f6cbea98 | // { dg-do assemble }
template<class T, void (T::*f)(int)>
class C { };
template<class T>
C<T, &T::output> call(T& obj)
{ return C<T, &T::output>();
}
class Test {
public:
void output(int);
};
void sub()
{
Test t;
call(t);
} |
google | android | enum11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/enum11.C | 135 | utf_8 | 4c33c98ccaa9f23b440823bd81a76d89 | // { dg-do assemble }
template <class T> void f1()
{
struct foo { enum T2 {
un, du, toi };
};
}
void f2() { f1<int>(); }
|
google | android | explicit56 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit56.C | 206 | utf_8 | f874691eaad8923e6bcb1702ff27845a | // { dg-do run }
template <class T> T* create ();
template <class T> T* create2()
{
return create<T>();
}
template <class T> T* create ()
{
return new T;
}
int main()
{
int *p = create2<int>();
}
|
google | android | t37a | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t37a.C | 131 | utf_8 | 2e421a22074476f104dce2246485a180 | // { dg-do assemble }
class A {
public:
A(int);
A(float);
~A();
};
A::A(float f) {
}
A::A(int i) {
}
A::~A() {
}
|
google | android | t31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t31.C | 203 | utf_8 | f5cd99f666857129dc16f71b72b32464 | // { dg-do assemble }
struct B { int foo (); };
int B::foo() { return 37; }
template <class A> struct X {
void f();
};
template <class A> void X<A>::f ()
{}
X<int> x;
void xyzzy () {
x.f ();
}
|
google | android | static3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/static3.C | 288 | utf_8 | cce93274cc52f32776c18c658a1f9dde | // { dg-do run }
// On targets that don't support weak symbols, we require an explicit
// instantiation of arr.
// { dg-require-weak "" }
template<class T>
struct A {
static T arr[5];
};
template <class T>
T A<T>::arr[5] = { 0, 1, 2, 3, 4 };
int main ()
{
return A<int>::arr[0];
}
|
google | android | typename14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename14.C | 255 | utf_8 | 29cbf5200ec98010b37b50f68e0e920d | // { dg-do assemble }
// { dg-options "-Wno-deprecated" }
template <class T>
struct B {
typedef T X;
};
template <class T>
struct S : public B<T>
{
struct I {
void f(X x); // { dg-error "'X' has not been declared" } implicit typename
};
};
|
google | android | local2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/local2.C | 175 | utf_8 | ecde9e102937ee809f8b67e5efbae236 | // { dg-do run }
extern "C" void abort();
template <class T>
void f(T)
{
struct S {
int i;
} s;
s.i = 3;
if (s.i != 3)
abort();
}
int main()
{
f(7);
}
|
google | android | ctor1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ctor1.C | 143 | utf_8 | 175bbaa432316cf80ec13fb36b444aff | // { dg-do assemble }
template <typename _CharT>
struct moneypunct
{
moneypunct ();
};
template <>
moneypunct<char>::moneypunct ();
|
google | android | t10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/t10.C | 161 | utf_8 | 23324631d401176730aa21b6453b5397 | // { dg-do assemble }
template <class A> class B { public: A a; B(); };
template <> class B<char> { public: int y[10]; };
static B<int> bi;
static B<char> bc;
|
google | android | memclass3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memclass3.C | 397 | utf_8 | b2895d81098caa1d254d4aad183cc47f | // { dg-do run }
template <class T> struct A {
template <class U> struct B {
template <class V> struct C {
template <class W> struct D {
template <class X> struct E {
template <class Y> struct F {
template <class Z> void f (Z) { }
void g () { }
};
};
};
};
};
};
int main ()
{... |
google | android | typename10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename10.C | 79 | utf_8 | 2abde64504f174547d8084a17412f0a9 | // { dg-do assemble }
struct S {
typedef int I;
};
void f(typename S::I);
|
google | android | explicit39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit39.C | 218 | utf_8 | f0f908bfd2f70e5e8916f7661b5152e3 | // { dg-do assemble }
template <class T>
void f(int i); // { dg-message "note" }
void g()
{
f<7>(3); // { dg-error "" } no matching function.
// { dg-message "candidate" "candidate note" { target *-*-* } 7 }
}
|
google | android | memtemp80 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp80.C | 319 | utf_8 | dfe226bdc2e8df4b798d0ebefbd4ccc1 | // { dg-do assemble }
template<typename T> T baz() { return 0; }
struct foo {
template<typename T> static T staticbar() { return 0; }
template<typename T> T bar() { return 0; }
};
void f()
{
foo t;
int i = baz<int>();
int j = foo::staticbar<int>();
int k = t.bar<int>();
}
|
google | android | derived2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/derived2.C | 369 | utf_8 | b9e028a460d0b89de8720a32a624294e | // { dg-do assemble }
// { dg-options "" }
template <typename T>
void f(T);
template <>
void f(int) {}
struct B {
typedef int I;
};
template <typename T>
struct D1 : virtual public B {
typedef T I;
};
template <typename T>
struct D : virtual public B, public D1<T>
{
void g()
{
I i;
f(i);
... |
google | android | crash65 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash65.C | 425 | utf_8 | 54f18649dccd8fb2a677fa9d37d8916c | // { dg-do assemble }
// Bug 1506. We ICE'd on a struct definition inside a template parms.
// This is still not completely fixed, but now issues a diagnostic
template<class T =
struct W {}; // { dg-error "inside template parameter list|before" }
> struct S{}; // { dg-error "before" } |
google | android | ttp29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ttp29.C | 380 | utf_8 | 88555227089654b7519e701bc3b6f621 | // { dg-do run }
template<class T> class D
{
public:
int f();
};
template<class T> int D<T>::f()
{
return sizeof(T);
}
extern "C" void abort();
template<template<class> class D,class E> class C
{
D<E> d;
public:
int f() { abort(); return 0; }
};
template<class E> class C<D,E>
{
D<E> d;
public:
int f(... |
google | android | decl3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/decl3.C | 160 | utf_8 | 9f475a21ce5a4015b7f0d2ca639eac21 | // { dg-do assemble }
template <class T, class U = int> struct A;
template <class T = int, class U> struct A { }; |
google | android | friend38 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/friend38.C | 373 | utf_8 | 02bd27febfd35272659fa48b3d236e58 | // { dg-options "-std=c++98 -pedantic-errors" }
// { dg-do assemble }
template<class P, class Q> struct foo {
typedef P parent_type;
friend parent_type; // { dg-error "" } template parameters cannot be friends
friend Q; // { dg-error "" } template parameters cannot be friends
}; |
google | android | spec31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec31.C | 152 | utf_8 | 5d85c96e7ef4ccffcea361ff582c4dac | // { dg-do assemble }
template <> struct A {}; // { dg-error "" } not a specialization
template <> void f (); // { dg-error "" } not a specialization
|
google | android | memtemp13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp13.C | 191 | utf_8 | ac3321d3cb14c1f85dd1cfa9d38df694 | // { dg-do assemble }
// GROUPS passed templates membertemplates
template <class T>
struct S
{
template <class U>
void foo(U);
};
void f()
{
S<int> s;
s.foo(3);
s.foo("hello");
}
|
google | android | explicit55 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit55.C | 172 | utf_8 | 695a1da378b9cb5d29b4810dc64c2356 | // { dg-do run }
template <class T> T* create ()
{
return new T;
}
template <class T> T* create2()
{
return create<T>();
}
int main()
{
int *p = create2<int>();
}
|
google | android | typename3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename3.C | 392 | utf_8 | 5913e6752e829f17b27b87f7e66ef6e1 | // { dg-do assemble }
// { dg-options "-Wno-deprecated" }
template <class T>
struct A
{
typedef T A_Type;
};
template <class U>
struct B : public A<U>
{
A_Type Func(); // { dg-error "does not name a type" "err" } implicit typename
// { dg-message "note" "note" { target *-*-* } 14 }
};
template <class U>
B<U... |
google | android | spec1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec1.C | 346 | utf_8 | 1c96663624a060c4cc29a4ae37cce796 | // { dg-do assemble }
template <class S, class T>
class mem_fun1_t {
public:
mem_fun1_t(S (T::*pf)(double)) {}
};
template <class T>
class mem_fun1_t<void, T> {
public:
mem_fun1_t(void (T::*pf)(double)) {}
};
struct Operation {
double eval(double) { return 0; }
};
int main() {
mem_fun1_t<double, Operatio... |
google | android | spec37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec37.C | 465 | utf_8 | d90c0eb04a0e59ee3360203fb5b060f7 | // { dg-do assemble }
//
// Bug 1728. We started sorting things when there were 7 fields. Our
// template_count algorithm was rather fragile ...
template <int dim> struct X
{
struct Y
{
int x1;
int x2;
int x3;
int x4;
int x5;
int x6;
int x7;
void Foo ();
};
};
template <> void X<... |
google | android | memtemp47 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C | 398 | utf_8 | cc4705a1810e04cd5866e5b713f45c53 | // { dg-do link }
// GROUPS passed templates membertemplates
extern "C" int printf(const char*, ...);
template <class X>
struct S
{
template <class U>
void g(U u)
{ printf ("In S::g(U)\n"); }
int c[16];
};
template <class X>
struct T : public S<X>
{
template <class U>
void f(U u)
{ printf ("In T::f(U... |
google | android | friend7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/friend7.C | 213 | utf_8 | 2a8c138073677b413a3c89de42d324f2 | // { dg-do run }
template <class T>
void f(T);
template <class U>
class C
{
template <class T>
friend void f(T);
int i;
};
template <class T>
void f(T)
{
C<T> c;
c.i = 3;
}
int main()
{
f(7);
}
|
google | android | explicit71 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C | 514 | utf_8 | d913b4d7e260746c46c4f6fb5d0d25af | // { dg-do assemble }
// According to the C++ Standard [temp.expl.spec]/17-18, explicit
// specializations are only valid if all enclosing template classes
// of the specialized template are fully specialized too
template <class X>
class bug {
template <class Y>
class a {};
};
template <class X>
template <> ... |
google | android | typedef1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typedef1.C | 188 | utf_8 | 318620e10c25eca63522f04dec88b5d7 | // { dg-do assemble }
// Testcase for handling of typedef wierdness.
template <class T>
struct A
{
typedef enum
{
foo
} B;
A (B b);
};
template <class T>
A<T>::A (B b)
{
}
|
google | android | unify2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/unify2.C | 276 | utf_8 | bf884302d62e4009612a7e93dd7f10df | // { dg-do assemble }
template <class T>
struct S
{
typedef T S_Type;
};
template <class T>
void foo(typename S<T>::S_Type)
{
}
template <class T>
void foo(T)
{
}
struct S2 {};
void bar()
{
foo(S2()); // We can't unify with the first foo, so we get the second.
}
|
google | android | typename28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/typename28.C | 575 | utf_8 | e218c9983c5cf2834e97d221625c2831 | // { dg-do assemble }
//
// Bug 1844. We can meet types in cp_tree_equal via a template-id-expr.
typedef int *Ptr;
template<class T> struct B
{
typedef typename T::template X<T> type;
typedef typename T::template X<Ptr> type2;
typedef typename T::template X<int *> type3;
void foo (type);
void baz (type2);... |
google | android | crash45 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash45.C | 149 | utf_8 | 340c2f747b9a9dcc127c9fbab8276b60 | // { dg-do assemble }
template <class T> void f()
{
extern void g ();
}
int main()
{
f<int>();
} |
google | android | crash33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/crash33.C | 307 | utf_8 | 26b119db5e5fce06a8a493e4a51c0bcd | // { dg-do assemble }
class A {
public:
template <class T> T& f(T& t) const;
};
class B {
public:
template <class T> T& f(T& t) const;
};
class C: public A,B {
public:
template <class T> T& f(T& t) const;
}; |
google | android | friend27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/friend27.C | 117 | utf_8 | c8eb156fe71d734c3ca4562810faa6e5 | // { dg-do assemble }
class S
{
friend void f<>(int); // { dg-error "" } does not match any template
int i;
};
|
google | android | memtemp34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp34.C | 215 | utf_8 | 81417ad09b437b2a04397f40d497fd9a | // { dg-do link }
// GROUPS passed templates membertemplates
template <class T>
struct S
{
template <class U>
static void f(U u)
{}
};
int main()
{
S<int>::f(3);
S<char>::f("abc");
S<int>::f("abc");
}
|
google | android | shadow2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/shadow2.C | 228 | utf_8 | 7832134a73622623fa6b54ea86054246 | // { dg-do assemble }
template <class T> struct A { // { dg-error "" } shadowed parameter
struct B {
void T(); // { dg-error "" } shadows template parameter
};
};
A<int> a; |
google | android | explicit18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit18.C | 195 | utf_8 | 6842653b5be655212acb39ca79477054 | // { dg-do link }
// { dg-options "-ansi -pedantic-errors -w" }
// GROUPS passed templates
template <class T>
int foo(T t) { return 0; }
int foo(int i);
int main()
{
return foo<int>(3.0);
}
|
google | android | link1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/link1.C | 318 | utf_8 | 74f901046228380449ae3baeb5096fbd | // { dg-do link }
template <class T>
int f(T);
template <class T>
struct S {
template <class U>
friend int f(U) { return 0; }
};
int k = f(2);
template <class T>
int g(T);
int h = g(7);
template <class T>
int g(T) {
S<T> si;
return 0;
}
int main()
{
} |
google | android | enum7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/enum7.C | 274 | utf_8 | ce9d6550a9f34d8358557849e76b1559 | // { dg-do run }
template <int I>
int f()
{
enum E { a = I };
struct S {
int g() {
E e;
e = a;
return (int) e;
}
};
S s;
return s.g();
}
int main()
{
if (f<7>() != 7)
return 1;
if (f<-3>() != -3)
return 1;
return 0;
}
|
google | android | fntry1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/fntry1.C | 220 | utf_8 | 623927839b1440501a83a44e8c6cd07a | // { dg-do run }
// Bug: g++ silently ignores function-try-blocks in templates.
template <class T> void f (T) try { throw 1; } catch (...) { }
int main ()
{
f (1);
} |
google | android | test4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/test4.C | 97 | utf_8 | 512f748377d5b3abb48e8b3adaad4be7 | // { dg-do assemble }
class B { };
template <class x, int b> class X : public B { int y[b]; };
|
google | android | defarg10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/defarg10.C | 225 | utf_8 | 07ca97ef4fcf85ee32103d562a5667ab | // { dg-do assemble }
struct A {};
template<class M, class T = A, class C> class Tc {}; // { dg-error "" } no defarg
int main ()
{
Tc<int> oops; // { dg-error "" } using template
} |
google | android | local5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/local5.C | 234 | utf_8 | b302be592ef9b4aadad4579c2e977d92 | // { dg-do run }
template <class INT>
class b
{
private:
char a(int x)
{
union {
int i;
char c;
} val;
val.i = x;
return val.c;
}
public:
b() {
}
};
int main() {
b<int> n;
return 0;
}
|
google | android | memtemp91 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp91.C | 339 | utf_8 | 64b0ec0600dc4ef8f513f0194fe7257d | // { dg-do assemble }
// regression test -
struct A {
template <class T>
struct B {
T x;
};
template <class T>
struct C : B<T> {
C() {}
};
}; |
google | android | union2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/union2.C | 424 | utf_8 | f6b916c76f9053393e246e9234587d63 | // { dg-do assemble }
template<class T> struct vector_base {
typedef T elm_t;
protected:
union {
double alignment_hack;
char defbuf_space[2 * sizeof (elm_t)];
};
elm_t *def_basep () { return reinterpret_cast<elm_t *> (defbuf_space); }
};
template<class T> struct vector : public vector_base<T> {
vecto... |
google | android | explicit66 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/explicit66.C | 120 | utf_8 | 8266c169b6e9ca69bee1c35b3cbc8746 | // { dg-do run }
void f(int) {}
void f(double);
template <void (*fn)(int)>
void foo() {}
int main()
{
foo<f>();
}
|
google | android | spec33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/spec33.C | 282 | utf_8 | 68df4c1c06ed2c04200d90b294704422 | // { dg-do link }
class A
{
public:
template <class T> A(T x, bool y = false);
};
template <class T> A::A(T, bool)
{
}
template <> A::A(char, bool)
{
}
int main()
{
int b;
char c;
A x(b);
A z(c, false);
} |
google | android | friend15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/friend15.C | 222 | utf_8 | e25a41687e4e940a81db50985ed1366d | // { dg-do assemble }
class S1
{
template <class T>
friend class S2;
static int i;
};
template <class T>
class S2
{
public:
static void f() { S1::i = 3; }
};
void g()
{
S2<double>::f();
S2<char>::f();
}
|
google | android | eichin01b | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/eichin01b.C | 403 | utf_8 | f5f3de616299b02e21b6229917343923 | // { dg-do run }
template <class X> class TC {
public:
X aaa;
static X sss;
TC(X a) {aaa = a; }
TC(X a, X s) {aaa = a; sss = s; }
void sz(X s) { sss = s; }
void syy(X syarg) { sss = syarg; }
};
template <> long TC<long>::sss = 0;
template <> float TC<float>::sss = 0.0;
TC<long> xjj(1,2);
int main(int,ch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.