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 | defarg5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg5.C | 320 | utf_8 | d76188a085acd697dff8b304e6cd63cc | // { dg-do assemble }
template <int dim>
class Point {
public:
Point (Point<dim> &);
Point<dim> & operator = (Point<dim> &);
};
template <int dim>
class bar{
public:
void foo (Point<dim> p = Point<dim>());
};
template <>
void bar<2>::foo (Point<2> p) {
const int dim = 2;
Point<dim> q = p;
}
|
google | chromium | memtemp13 | .C | native_client/nacl-gcc/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 | chromium | explicit52 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit52.C | 300 | utf_8 | 4cd1d9265d589b5a805457f30ca5ccc4 | // { dg-do run }
extern "C" void abort ();
template <int a> inline int fact ()
{
return a * fact<a-1> ();
}
template <> inline int fact<1> ()
{
return 1;
}
int main()
{
if (fact<3> () != 6 || fact<1> () != 1
|| fact<3> () != 6 || fact<1> () != 1 || fact<1+0> () != 1)
abort ();
}
|
google | chromium | memtemp83 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memtemp83.C | 259 | utf_8 | 36f92bddcd9a081e531e4ab67b6bf3fa | // { dg-do assemble }
struct cow_t {
template<bool Q>
static void tfunc(cow_t *cowp) {}
void moo() {
cow_t *cowp;
tfunc<true>(cowp);
}
};
int main()
{
cow_t *cowp;
cow_t::tfunc<true>(cowp);
} |
google | chromium | explicit61 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit61.C | 609 | utf_8 | 18f7175d1fd53378e80c51ca317d35b4 | // { dg-do run }
extern "C" void abort ();
template <class T> void f ();
template <class T> void g ()
{
abort ();
}
template <> void g<char> ()
{
abort ();
}
template <class T> class C
{
public:
void ff () { f<T> (0); }
void gg () { g<T> (1); }
template <class U> void f () { abort(); }
templat... |
google | chromium | ttp63 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp63.C | 182 | utf_8 | e8c2f6385f09e7463a4d5153f6c63846 | // { dg-do assemble }
template <template <class> class TT> class X {};
template <class T> class Y {
X< ::Y> x;
}; |
google | chromium | memclass16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memclass16.C | 212 | utf_8 | 05ffd060adf1f64bdb78db1e10abd3c6 | // { dg-do assemble }
template <class Q>
class A {
public:
typedef enum { X, Y } B;
template <B c> class Traits{ };
};
template class A<int>;
template class A<double>::Traits<A<double>::X>;
|
google | chromium | typename24 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/typename24.C | 329 | utf_8 | 5ceebb7517e50a9faad0b76f35cf66b5 | // { dg-do assemble }
class ostream;
extern ostream& cout;
class Foo { };
ostream &operator<<(ostream &os, const Foo &)
{
return os;
}
template<class T>
const typename T::fooz &operator<<(const Foo &, const T &t)
{
return t;
}
int main()
{
Foo foo;
cout << foo;
} |
google | chromium | ref4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ref4.C | 416 | utf_8 | eca3b76193c99a555bee74a6025d82bc | // { dg-do assemble }
//
-C; //bogus error
}
int main()
{
test<c> ();
} |
google | chromium | explicit6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit6.C | 207 | utf_8 | 6cd92bef67a152661ec9cc6c52e1a5d3 | // { dg-do link }
// { dg-options "-ansi -pedantic-errors -w" }
// GROUPS passed templates
template <class T>
int foo(T t);
template <>
int foo(int i) { return 0; }
int main()
{
return foo<int>(3.0);
}
|
google | chromium | spec24 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/spec24.C | 146 | utf_8 | c641e36402b485a24d11862e3fabfc28 | // { dg-do assemble }
template <class T> class A;
// template <>
class A<int>; // { dg-error "" "" { xfail *-*-* } } missing template header -
|
google | chromium | test5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/test5.C | 90 | utf_8 | ccb1258479fc3c67a962243e8c6ac4ba | // { dg-do assemble }
template <char *a, const char *b, char *const c> class A{int x;};
|
google | chromium | nested2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/nested2.C | 265 | utf_8 | b2734f7995a0e288c2b5eb646c538e3d | // { dg-do assemble }
template<class T>
struct a {
struct b {
T operator()();
};
};
template<class T>
T a<T>::b::operator()() { return T(0); }
template<> int a<int>::b::operator()() { return 1; } |
google | chromium | ref2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ref2.C | 166 | utf_8 | 9496be7cce9dca2d16421479e66c783d | // { dg-do assemble }
template <class T, T&>
class C;
template <int& I>
class C<int, I> {};
int i;
C<int, i> c; |
google | chromium | explicit39 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit39.C | 123 | utf_8 | 7c6e40d42d1360c7113332d1028675cc | // { dg-do assemble }
template <class T>
void f(int i);
void g()
{
f<7>(3); // { dg-error "" } no matching function.
}
|
google | chromium | defarg13 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg13.C | 236 | utf_8 | a7bda05d1cbd63fdd8fa49b8acb6fee1 | // { dg-do assemble }
template <class T>
void f (int i)
{
struct S { void g (int j = i) {} }; // { dg-error "" } default argument uses local
S s;
}
template void f<double>(int); |
google | chromium | typename23 | .C | native_client/nacl-gcc/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 | chromium | codegen1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/codegen1.C | 212 | utf_8 | 7b9ae09252e64b16ac90f079401bceeb | // { dg-do assemble }
int i;
struct S
{
~S ()
{
}
};
template <class T>
void f (T, S)
{
i = 0;
}
int main ()
{
i = 1;
f (3, S ());
return i;
} |
google | chromium | parms3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/parms3.C | 184 | utf_8 | 6f8ecc7e23bd84e90b15a55b95660d7a | // { dg-do assemble }
// Test that we can represent static_casts in template arg lists.
template <int I> struct A { };
template <class T> struct B {
A<static_cast<T>(3.14)> a;
};
|
google | chromium | friend28 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend28.C | 453 | utf_8 | 8bbd75ea6a9a3c6b41028f5cc386f6aa | // { dg-do assemble }
class mystream;
template <class T> class a;
template <class T> mystream& operator>>( mystream& s, a<T>& thea );
template <class T> class a {
public:
friend mystream& operator>> <>( mystream&, a<T>& thea );
private:
T amember;
};
template<> mystream& operator>> <int>( mystream& s, a<int>& t... |
google | chromium | friend36 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend36.C | 205 | utf_8 | 3c503188b1b4f9d0a4c7a20a99a169fc | // { dg-do assemble }
template <class T>
void f(T) {} // { dg-error "previously" }
template <class U>
struct S {
template <class T>
friend void f(T) {} // { dg-error "redefinition" }
};
S<int> si;
|
google | chromium | typedef3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/typedef3.C | 231 | utf_8 | 228fb8c248bec1bea4d3213d3004fbec | // { dg-do assemble }
template <class T>
void f(T, T)
{
}
struct A {
typedef enum {
VAL1
} result_t;
};
struct B {
typedef enum {
VAL2
} result_t;
};
void g()
{
f(A::VAL1, A::VAL1);
f(B::VAL2, B::VAL2);
}
|
google | chromium | derived2 | .C | native_client/nacl-gcc/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 | chromium | label1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/label1.C | 216 | utf_8 | 6803b17fa32f4f77f08d5a8e67084bf5 | // { dg-do assemble }
template <class T>
struct S {};
template <class T>
inline void g(T t)
{
here:
S<T> st;
goto here;
}
template <class T>
void f(T t)
{
here:
g(t);
goto here;
}
void h()
{
f(3);
}
|
google | chromium | crash5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash5.C | 161 | utf_8 | e68988007739c2e9ddee5744984d1a58 | // { dg-do assemble }
template <class T, int i>
struct K {
void f();
};
template <class T>
void
K<T, i>::f() // { dg-error "" } i has not been declared
{
}
|
google | chromium | friend44 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend44.C | 546 | utf_8 | cdbb5542332d9ba2fba1f567d6e9e08c | // { dg-do compile }
// Test that template friends referring to class template members are
// respected.
template <class T> struct A
{
int f (T);
struct AI {
int f (T);
};
};
class B
{
template <class T> friend int A<T>::f (T);
template <class T> friend struct A<T>::AI;
int a;
public:
B(): a(0) { }... |
google | chromium | ctor2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ctor2.C | 270 | utf_8 | d6dc74584a2ef3f12aaa3209271d7ae1 | // { dg-do assemble }
// Test for use of template parms in constructor name.
template <class T>
struct A {
A<T>();
};
template <class T>
A<T>::A<T>() // { dg-error "invalid use of constructor|qualified name" }
{
} |
google | chromium | redecl2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/redecl2.C | 107 | utf_8 | 4b0d2c4de566d4685481d1e70444f070 | // { dg-do assemble }
struct A
{
template <class A>
void f(A) {}
};
void g()
{
A a;
a.f(3);
}
|
google | chromium | memclass19 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memclass19.C | 171 | utf_8 | f99aa1081528c48bcecd5a6e5e0fad52 | // { dg-do assemble }
template <class T> struct A {
template <class U> struct B;
};
template <class T> template <class U> struct A<T>::B<U*> { };
A<int>::B<int*> b;
|
google | chromium | derived1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/derived1.C | 219 | utf_8 | 4a7bcf0e69407234143b8788e32f2b6c | // { dg-do assemble }
class A
{
public:
typedef int Info;
};
template <class T>
class B : public A
{
public:
typedef struct{
int a;
int b;
} Info;
};
void f()
{
B<A>::Info ie;
ie.a=1;
ie.b=2;
}
|
google | chromium | t20 | .C | native_client/nacl-gcc/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 | chromium | crash68 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash68.C | 1,029 | utf_8 | 502197be06adfab93a6d99ec37627e5a | // { dg-do assemble }
//
// Bug 3624. Template instantiation of a reference type was not
// converted from reference when doing a call.
#include <iostream>
using namespace std;
template <class A, class B, class C, C& c, bool d> class eo: public A
{
public:
eo()
{
cout << this->x << " " << this->y << " "
<<... |
google | chromium | ttp52 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp52.C | 317 | utf_8 | a0ad3717d706ab0e38262e2cb1818205 | // { dg-do assemble }
template<class A,class B> class mymap {};
template<class Key,
class Value,
template<class, class > class MapT>
class base
{
};
// specialization
template<class Key, class Value>
class base<Key, Value, mymap<int, int > > // { dg-error "type/value|class template" }
{
};
|
google | chromium | defarg7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg7.C | 260 | utf_8 | 147c0d1c22fa61d6df040461b286f76f | // { dg-do assemble }
template <int Dim, class T, class EngineTag>
class Engine {};
struct Brick;
template<int Dim, class T = double , class EngineTag = Brick >
struct ConstArray {
static const int dimensions = Engine<Dim, T, EngineTag>::dimensions;
};
|
google | chromium | explicit81 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit81.C | 790 | utf_8 | a026eff7f55e0343c0d357e41998e870 | // { dg-do assemble }
//
// bug 371 We failed to subst explicit template args before trying to
// deduce the template.
namespace N
{
enum E { e0 };
template< E e > void nf();
}
template< N::E e > void gf();
struct X {
template<N::E e> void xfn ();
template<N::E e> static void sfn ();
};
template < class C >
void ... |
google | chromium | expr6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/expr6.C | 150 | utf_8 | 619d962538d9d166d1131873bfc1b4ae | // { dg-do assemble }
template <int X> class foo {};
foo< true ? 1 : 0 > bar; |
google | chromium | nttp1 | .C | native_client/nacl-gcc/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 | chromium | defarg9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg9.C | 180 | utf_8 | 3f681d59e13e6e66d4659f1dacf5ca23 | // { dg-do assemble }
template <class T = int>
struct S
{
void g ()
{
}
friend void f (double)
{
}
}; |
google | chromium | enum9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/enum9.C | 217 | utf_8 | ee9b7f755fa40a8a83f089ffffd2ac7b | // { dg-do assemble }
template <typename _CharT>
class _Format_cache
{
public:
enum {
_S_digits, _S_digits_end = _S_digits+10,
_S_xdigits = _S_digits_end
};
};
template class _Format_cache<int>;
|
google | chromium | spec4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/spec4.C | 225 | utf_8 | 5cca19f1e13cebaaa185c729d0f8bba8 | // { dg-do assemble }
template <class T>
struct S {};
template <>
struct S<int>
{
void f();
void g();
};
void S<int>::f() {}
template <>
void S<int>::g() {} // { dg-error "" } does not match any template declaration
|
google | chromium | overload7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/overload7.C | 461 | utf_8 | c137119c4022edf2d8efa6a8da4e6f08 | // { dg-do assemble }
template<class T>
struct moo_t {
struct cow_t {};
};
template<class T> void foo(typename moo_t<T>::cow_t) {}
template<class T> void foo(moo_t<T>) {
typename moo_t<T>::cow_t p;
foo(p); // { dg-bogus "" "" { xfail *-*-* } } - no matching function for call -
}
int main() {
moo_t<int> x;
... |
google | chromium | memtemp87 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memtemp87.C | 299 | utf_8 | 96b94f804d043bb43fefbc1e5d99f357 | // { dg-do assemble }
class Q {
public:
template<class>
class X {
};
};
template<template<class> class>
class Y {
};
Q::template X<int> x; // { dg-error "" } template syntax |
google | chromium | crash33 | .C | native_client/nacl-gcc/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 | chromium | typename3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/typename3.C | 392 | utf_8 | d9ecb45851abfdfb4ebad09e52b57d7a | // { 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 | chromium | crash28 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash28.C | 234 | utf_8 | 43ca6e630feb5f24d33f3b894fe8dbdd | // { dg-do assemble }
// { dg-options "" }
template <class ARRY>
inline unsigned int asize(ARRY &a)
{
return sizeof(a) / sizeof(a[0]);
}
void f(unsigned int n) {
int x[n];
asize(x); // { dg-error "" } no matching function
}
|
google | chromium | memtemp34 | .C | native_client/nacl-gcc/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 | chromium | t11 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/t11.C | 130 | utf_8 | 4225a5fa8a7dd3d384ce411bdccbe3ca | // { dg-do assemble }
template <class A>
class B {
public:
A a;
B() { x = 2; } // { dg-error "" } no x
};
static B<int> bi;
|
google | chromium | memtemp88 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memtemp88.C | 380 | utf_8 | 74da4a1f0bfefc0429afd33a40acfb2b | // { dg-do assemble }
struct Q {
template<class>
class X {
};
template<template<class> class XX = X> // { dg-bogus "" } (original definition appeared here)
class Y {
}; // { dg-bogus "" } redefinition of default argument for `template <class> XX'
Y<> y;
}; |
google | chromium | crash22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash22.C | 175 | utf_8 | 575a37429617a03cc1f558ee82dd58ea | // { dg-do assemble }
template <class T>
struct S1 {};
template <class T, class U = S1<T> >
struct S2 {};
template struct S2<100>; // { dg-error "" } type/value mismatch
|
google | chromium | local7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/local7.C | 360 | utf_8 | 4e765c7240554e025c2792ca80ac15a9 | // { dg-do assemble }
template <class STRUCT, class MEMBER> inline STRUCT *
setback(MEMBER *bp, MEMBER STRUCT::*offset)
{
if(!bp) return 0;
union { int i; MEMBER STRUCT::*of; } u;
u.of = offset;
return (STRUCT *) ((__SIZE_TYPE__) bp - u.i);
}
struct S
{
int i;
};
int main()
{
S... |
google | chromium | ttp53 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C | 703 | utf_8 | 20fb2043be6ad6f1486e40c6e4909168 | // { dg-do assemble }
template <typename> class H;
template <typename Target, typename Source>
H<Target> foo(const H<Source>&);
template <typename Type>
class H{
#ifdef OK
public:
#endif
template<template<class, class> class Caster, typename Source>
static H<Type> cast(const H<Source>& s);
#ifndef OK
template <t... |
google | chromium | explicit77 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C | 331 | utf_8 | 7337d0a835d1b23098bea63fddcf4dfd | // { dg-do assemble }
template <int I, int J, int K>
struct S {};
template <int I, int J>
struct S<I, J, 2> : public S<I, I, I>, S<J, J, J> {};
template <int I, int J, int K>
void f(S<I, J, K>, S<I, I, I>);
void g() {
S<0, 0, 0> s0;
S<0, 1, 2> s2;
f<0>(s0, s2);
f(s0, s2); // { dg-error "" } no matching ... |
google | chromium | unify4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/unify4.C | 161 | utf_8 | 03014877170626eff7141f7d8de2100e | // { dg-do assemble }
template <class T> void f (T);
void g ();
void g (int);
int
main ()
{
f (g); // { dg-error "" } ambiguous unification
return 0;
}
|
google | chromium | friend3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend3.C | 268 | utf_8 | 4dd62e8fe56d96cc5f74a14dd6eb5903 | // { dg-do assemble }
template <class T>
void f(T);
class C
{
friend void f<>(double);
int i; // { dg-error "" } private
};
template <class T>
void f(T)
{
C c;
c.i = 3; // { dg-error "" } f<double> is a friend, this is f<int>.
}
int main()
{
f(7);
}
|
google | chromium | memtemp56 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memtemp56.C | 328 | utf_8 | 9fd903e5ed2b0f601536dfbd4c3a22a5 | // { dg-do assemble }
// GROUPS passed templates membertemplates
template<class P_numtype, int N_length>
class TinyVector {};
template<class P_numtype, int N_rank>
struct Array
{
template<int N_rank2>
Array() {}
template<int N_rank2>
P_numtype operator()(const TinyVector<int,N_rank2>& index) const... |
google | chromium | friend26 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend26.C | 109 | utf_8 | 6bebb5862e10035a9ad5d5d4f55e2305 | // { dg-do assemble }
struct S
{
friend void f<>(int); // { dg-error "" } does not match any template
};
|
google | chromium | crash65 | .C | native_client/nacl-gcc/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 | chromium | ttp25 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp25.C | 389 | utf_8 | cb02ebed2f9be0bfb5a98092e96bd082 | // { 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 D,class E> class C
{
D<E> d;
public:
int f() { return d.f(); }
};
template<template<class> class D,class E> int f(D<E> &d1)
{
d1.f();
C<D,E> d2;
d2.f();
... |
google | chromium | vaarg | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/vaarg.C | 265 | utf_8 | 9a7ae6b76deb786bde29550bc4676039 | // { dg-do run }
#include <stdarg.h>
extern "C" void abort();
template <class T>
T* f(T t, ...)
{
va_list ap;
va_start(ap, t);
T* r = va_arg(ap, T*);
va_end(ap);
return r;
}
struct S
{
};
int main()
{
S s;
if (f(s, &s) != &s)
abort();
}
|
google | chromium | t12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/t12.C | 467 | utf_8 | 24e1a97a52be67a54cacdea0ae77c24d | // { dg-do assemble }
class OBJECT {int a;};
class STDFILE {int b;};
template <class T> class VECTOR {
T *v;
int sz;
public:
T& elem(int i) { return v[i]; }
T& operator[] (int i);
};
template <class T>
class PVECTOR : VECTOR<void *> {
public:
T*& elem(int i)
{return (T*&) VECTOR<void *>:... |
google | chromium | auto_ptr | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C | 1,691 | utf_8 | 49aa891957cc7ea1b964d4de61b52f87 | // { 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 | chromium | goto2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/goto2.C | 190 | utf_8 | b5f83a28cbe580ee876974ea015b9d4f | // { dg-do assemble }
int i = 1;
template <class T> void test()
{
goto lab;
lab:
--i;
}
int main ()
{
test<int>();
return i;
} |
google | chromium | stmtexpr | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/stmtexpr.C | 180 | utf_8 | 728932a75888ba7fb19987b8fcc2c22d | // { dg-do run }
extern "C" void abort();
template <class T>
T f(T)
{
T t = __extension__ ({ T j = 4; j + 3; });
return t;
}
int main()
{
if (f(3) != 7)
abort();
}
|
google | chromium | enum14 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/enum14.C | 723 | utf_8 | 1e48bee97188537da1115301ec5f1da1 | // { dg-do assemble }
// Bug 511. We failed to set access correctly for enumeration members of
// template classes
template <class>
class A
{
public:
enum foo {bar};
typedef int baz;
};
struct C: public A<int>
{
void choke (foo);
void choke (baz);
};
template <class>
struct B
{
private:
enum foo {bar}; /... |
google | chromium | ref1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ref1.C | 126 | utf_8 | 73086c0ac161a43cd36bffb9c800b3be | // { dg-do assemble }
int i;
template <void (&FN)()>
void g ()
{
FN ();
}
void h ()
{
i = 7;
}
template void g<h>();
|
google | chromium | t39 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/t39.C | 468 | utf_8 | 94fb3f4d92db5a0db2265c73873ffa25 | // { dg-do run }
extern "C" int printf (const char *, ...);
template <class T>
struct frob {
T *ptr;
void print ();
frob (T* init) { ptr = init; }
};
template <class T>
void frob<T>::print () {
printf ("this = %08x\n", this);
printf (" ptr = %08x\n", ptr);
printf (" values = %x %x %x ...\n", ptr[0], ptr[... |
google | chromium | t14a | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/t14a.C | 233 | utf_8 | 6ab53197c0d07f59425f5093c7a03a80 | // { dg-do assemble }
class OBJECT
{
int a;
};
template <class T> class TESTA
{
public:
TESTA();
T foo(int i) {T t = 0; return t;}
};
void foo()
{
TESTA<OBJECT *> *foo;
foo = new TESTA<OBJECT *>;
}
|
google | chromium | crash37 | .C | native_client/nacl-gcc/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 | chromium | ttp49 | .C | native_client/nacl-gcc/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 | chromium | decl3 | .C | native_client/nacl-gcc/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 | chromium | explicit25 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit25.C | 175 | utf_8 | 6ca295110a7bfb90129d0058fdb6a886 | // { dg-do assemble }
// GROUPS passed templates
template <int I>
class S {};
template <int I, class T>
void foo(T t, S<I>);
void bar()
{
S<3> s3;
foo<3>("abc", s3);
}
|
google | chromium | var1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/var1.C | 137 | utf_8 | c97f3ca8bb97750a598a263e1d916808 | // { dg-do assemble }
template <class T> T t; // { dg-error "" } template declaration of t |
google | chromium | typename21 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/typename21.C | 345 | utf_8 | dfb67d61dc724f688029b5c625517ab9 | // { dg-do assemble }
// { dg-options "" }
template <class T>
struct S1 {
typedef T X;
};
template <class T>
struct B {
typedef T I;
};
template <class T>
struct S2 : public B<T> {
struct I {};
typedef typename S1<I>::X IX;
void f(IX);
};
template <class T>
void S2<T>::f(IX) {} |
google | chromium | spec35 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/spec35.C | 1,260 | utf_8 | 964443140f5b0f0d212e4565d2c533f4 | // { dg-do assemble }
//
// Bug 1617. We didn't resolve partial ordering properly. The std is rather
// vague about it anyway, DR 214 talks about this.
extern "C" int puts (char const *);
template <typename T> int Foo (T); // { dg-message "candidate" }
template <typename T> int Foo (T &); // { dg-message "note" ... |
google | chromium | test4 | .C | native_client/nacl-gcc/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 | chromium | overload3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/overload3.C | 172 | utf_8 | 17d985f8e0055d711bd6f46440b506c0 | // { dg-do assemble }
template <class T>
void g(T, T);
template <class T>
void g(int*, T);
struct S
{
void f() const
{
g(X, X+3);
}
double X[3];
};
|
google | chromium | overload15 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/overload15.C | 439 | utf_8 | b120569cbaba674fa6fa0e1461c92fc8 | // { dg-do assemble }
// Test resolution of templatized overloaded constructors.
// The more specialized constructor, i.e., A (const B<Dim1,Dim2> &b)
// should be chosen per \S 14.5.5.2/2 [temp.func.order/2].
template <int Dim1, int Dim2>
struct B {
int f;
};
struct A {
template <int Dim1, int Dim2>
A (const B... |
google | chromium | partial3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/partial3.C | 305 | utf_8 | a51913000fc79ce5fce525d2592b04ca | // { dg-do run }
// Test that partial ordering works between conversion ops from different
// classes.
struct A {
template <class T> operator T*() { return 0; }
};
struct B : public A {
template <class T> operator T();
};
int main()
{
B b;
(void*) b;
} |
google | chromium | spec10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/spec10.C | 379 | utf_8 | 78f3b4847f76087dd14f1722999a7331 | // { dg-do run }
extern "C" void abort();
template <class T>
struct S
{
template <int i>
int f(int j) { abort(); return 0; }
};
template <>
template <>
int S<double>::f<7>(int j) { return j + 7; }
template <>
template <>
int S<double>::f<8>(int j) { return j + 8; }
int main()
{
S<double> s;
if (s.f<7>(3) ... |
google | chromium | memclass4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memclass4.C | 452 | utf_8 | 5b606b807bf311106ed8968ee6b98b01 | // { dg-do run }
#include <typeinfo>
template <class T>
struct allocator {
typedef T* pointer;
template <class U> struct rebind {
typedef allocator<U> other;
};
};
template <class T, class Allocator>
struct alloc_traits
{
typedef typename Allocator::template rebind<T>::other allocator_type;
};
i... |
google | chromium | explicit18 | .C | native_client/nacl-gcc/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 | chromium | explicit70 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C | 1,114 | utf_8 | 29af8035db05ca17cb07fb5b6b670065 | // { dg-do assemble }
template <class T>
void f(T) {}
template <class T>
struct S {
static T t;
};
template <class T>
T S<T>::t;
template void f(int);
template void f(int); // { dg-error "duplicate explicit instantiation" }
template int S<int>::t;
template int S<int>::t; // { dg-error "duplicate explicit instan... |
google | chromium | builtin | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/builtin.C | 243 | utf_8 | f2dc0c4f766e43328cdd36ba323cdfa6 | // { dg-do assemble }
// { dg-options "-Wno-abi" { target arm_eabi } }
// Bug: Checking whether A depends on template parms, we crash because
// __builtin_va_list lacks TYPE_LANG_SPECIFIC.
void f (__builtin_va_list arg)
{
enum { a } A;
}
|
google | chromium | nontype5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/nontype5.C | 472 | utf_8 | b9bb8ed83d5de4ef7c492ee49635ea20 | // { dg-do assemble }
// Bug 1509. We ICE'd on trying to coerce a non-type template parm
// that wouldn't.
template<class T>
struct A {
typedef int F();
};
template<class T, typename A<T>::F f>
struct B {
static int g() { return f(); }
};
int f() { return 0; }
int main() {
return B<int,&f>::g(); // { dg-error "" } co... |
google | chromium | defarg12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/defarg12.C | 163 | utf_8 | 916263ca55139f5dfeb25afe206b20f1 | // { dg-do assemble }
template <class T = int>
struct S
{
void f ()
{
struct U {
};
}
}; |
google | chromium | friend31 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/friend31.C | 130 | utf_8 | 81c9926f980edcd17231f56b9568b0dc | // { dg-do assemble }
template <class T>
struct S1 {
};
template <>
struct S1<int> {};
struct S2 {
friend class S1<int>;
};
|
google | chromium | crash34 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash34.C | 325 | utf_8 | b8a43da58e14e7b6fd2c0512bd16c158 | // { dg-do assemble }
template <class T>
class A {
public:
class B { };
class C: public B {
public:
C(A&):B() { }
};
C f() { return C(*this); }
};
int
main()
{
A<int> a;
a.f();
} |
google | chromium | local4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/local4.C | 260 | utf_8 | 1100c5bcce4a46a1489112c4c257c7a7 | // { dg-do run }
extern "C" void abort();
template <class T>
struct S {};
S<int> si;
template <class T>
int f(T t)
{
struct S {
int g(int i) { return i + 2; }
};
S s;
return s.g(t) + s.g(t);
}
int main()
{
if (f(3) != 10)
abort();
}
|
google | chromium | unify3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/unify3.C | 298 | utf_8 | 1e49fa76a69677164367e1fd374b5370 | // { dg-do assemble }
template <class T1, class T2>
struct ComputeBinaryType
{
};
template<class T1>
struct ComputeBinaryType<T1, double> {
void g();
};
template<class T1>
struct ComputeBinaryType<T1&, double> {
void h();
};
void f()
{
ComputeBinaryType<double, double> cb;
cb.g();
}
|
google | chromium | local3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/local3.C | 201 | utf_8 | e2e409c8ab85028ef09b220a91de6dfb | // { dg-do run }
extern "C" void abort();
template <class T>
void f(T)
{
int j;
j = 6;
struct S {
int i;
};
S s;
s.i = j;
if (s.i != 6)
abort();
}
int main()
{
f(7);
}
|
google | chromium | static6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/static6.C | 312 | utf_8 | 5b6d68c887162d2aa7c3f075bcc9dc94 | // { dg-do link }
// { dg-xfail-if "" { *-*-aout *-*-coff *-*-hms } { "*" } { "" } }
template <class T> struct A {
static const int l[1];
};
template<class T>
const int A<T>::l[1] = {1};
int i = A<int>::l[0];
int main(){} |
google | chromium | crash62 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/crash62.C | 263 | utf_8 | c123d0b9a12303c4b06fb3047614c601 | // { dg-do assemble }
// Bug 911, ICE on bogus template declaration
template <class T> class A<T>; // { dg-error "" } not a template |
google | chromium | ttp8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp8.C | 173 | utf_8 | f1614c9083ef134c9a16d71f945322a4 | // { dg-do run }
template<class E> class DD
{
};
template<int> class D
{
};
template<template<class> class D,class E> class C
{
D<E> d;
};
int main()
{
C<DD,int> c;
}
|
google | chromium | spec38 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/spec38.C | 356 | utf_8 | bc15e40e290206d22d8803ef0d77c08f | // { dg-do assemble }
//
// Bug 1638. We failed to check if a function instantiation produced a void
// parameter type.
template <class T> struct S
{
int f (T); // { dg-error "" } void type
};
void foo ()
{
S<void> s;
} |
google | chromium | ttp55 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/ttp55.C | 460 | utf_8 | 960d60e90f42a0eb908c58d544fbd322 | // { dg-do assemble }
// Testing overloading of function argument involving template template
// parameters
template<class A>
class H{};
template <class T>
void f( const T& ){} // #1
template< template<class, class> class X,
class A, class B>
void f( const X<A,B> & x ) // #2
{}
in... |
google | chromium | array2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/array2.C | 205 | utf_8 | 3b220deaab541cb68cedec5e541bfe9e | // { dg-do assemble }
template<int N, class C>
class Bar {};
template<class C>
class Huh {};
template<int N>
void foo(const Bar<N,Huh<float[1]> > &x) {}
int main() {
foo(Bar<3,Huh<float[1]> >());
}
|
google | chromium | eichin01 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/eichin01.C | 368 | utf_8 | 27f2ac161e4df5610b1e51676a20752a | // { dg-do link }
/*
*/
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; }
};
template <> float TC<float>::sss = 0.0;
template <> long TC<long>::sss = 0;
TC<long> xjj(1,2);
int main(int,char**) {
TC<float> xff... |
google | chromium | memclass10 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/memclass10.C | 186 | utf_8 | 56b1bdd1db0bf5887d8d8c29324977e5 | // { dg-do assemble }
struct S1
{
template <class T>
struct S2 {}; // { dg-error "" } previous definition
template <class T>
struct S2 {}; // { dg-error "" } redefinition
};
|
google | chromium | warn2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/warn2.C | 182 | utf_8 | 3309094d2647252bd9b04ea2b4de883f | // { dg-do assemble }
// { dg-options "-Wall" }
template <typename T>
void f()
{
for(;;)
for(;;)
goto a;
a:
;
}
void g()
{
f<long>();
} |
google | chromium | instantiate5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.old-deja/g++.pt/instantiate5.C | 522 | utf_8 | d9a0eaaa98a929b13cc2a5f883260640 | // { dg-do link }
// { dg-additional-sources " instantiate5.cc instantiate5-main.cc" }
// `global constructors' are given the same name, based on foo(), on
// both translation units, which is wrong, because it must be possible
// to define template functions in multiple translation units, as long
// as they're given t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.