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 | conv4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv4.C | 440 | utf_8 | 8e48e2a0d63cdb353b4a07380c4cf577 | // { dg-do compile }
// PR 4361. Template conversion operators were not overloaded.
struct C
{
template <typename T2> operator T2 ()
{
return 1;
}
int Foo ()
{
return operator int ();
}
};
struct D
{
int Foo ()
{
return operator int (); // { dg-error "not defined" "" }
}
}; |
google | android | memclass2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memclass2.C | 360 | utf_8 | cdd15f6514749074086ff789caa565f2 | namespace ns {
template<typename T>
struct Foo {
template<typename U> struct Bar;
};
template<typename T>
template<typename U>
struct Foo<T>::Bar {
template<typename V> struct Baz;
};
template<typename T>
template<typename U>
template<typename V>
struct Foo<T>::Bar<U>::Baz {
Foo<... |
google | android | static30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static30.C | 223 | utf_8 | 0f679908d97cd1314de7de48e6a366cf | // PR c++/31992
template <int> struct A
{
static const int i1;
static const int i2;
};
template <int N> const int A<N>::i1(A<N>::i);
template <int N> const int A<N>::i2(3, A<N>::i); // { dg-error "expression list" }
|
google | android | pseudodtor2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pseudodtor2.C | 209 | utf_8 | 5bbbdc0bd84a1cf86dd283b16e7aa6ba | // PR c++/32384
// { dg-do compile }
template<typename S> struct D
{
typedef int T;
S foo ();
D () { foo ().~T(); } // { dg-error "10:is not of type" }
};
struct Z
{
Z () {}
~Z () {}
};
D<Z> d;
|
google | android | call2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/call2.C | 170 | utf_8 | e459df3ddd572b111e8694073c95e5b9 | // PR c++/13592
struct S {
void operator()(int);
};
struct A {
template <typename> void foo();
S s;
};
template <typename> void A::foo() {
s(0);
}
|
google | android | qual2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qual2.C | 427 | utf_8 | 4bcab05d2626fd45890af6154fa22221 | // { dg-do run }
// PR9415. Forgot a lookup was scoped
int here;
int there;
struct B
{
virtual int activate() {return !here++;}
};
template <class K>
struct TPL : public B
{
int activate()
{
return !there++ && B::activate();
}
};
int main ()
{
TPL<int> i;
return !i.activate ();
} |
google | android | qualttp15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp15.C | 500 | utf_8 | 9a2e0c2053d3ed911390c7839f875856 | // { dg-do compile }
struct A
{
template <class T> class B {};
};
template <template <class> class TT> struct X
{
TT<int> y;
};
template <class T> struct X<T::template B> // { dg-error "previous" }
{
T z;
};
template <class T> struct X<T::template B> // { dg-error "redefinition" }
{
T z;
};
template <class T> stru... |
google | android | qualttp8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp8.C | 393 | utf_8 | 9e0e0d14c1f0eccec8ddc07d25401f12 | // { dg-do compile }
template <template <class> class TT> class C {
};
template <class T> struct D {
C<T::template B> c; // { dg-error "context" }
};
struct E {
private:
template <class T> class B {}; // { dg-error "private" }
};
D<E> d; // { dg-message "required" } |
google | android | pr61537 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C | 255 | utf_8 | ae27fcfe45fb638bb620109e3d14cecf | // PR c++/61537
// { dg-do compile }
struct A {};
template <typename T>
struct B
{
template <typename U>
void f(U, struct A);
};
template <typename T>
template <typename U>
void B<T>::f(U, struct A)
{
}
int main()
{
B<char> b;
b.f(42, A());
}
|
google | android | const1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const1.C | 442 | utf_8 | 2096b2764f21d9bd35c06fef449c8404 | // PR c++/28385
// instantiating op() with void()() was making the compiler think that 'fcn'
// was const, so it could eliminate the call.
// { dg-do run }
extern "C" void abort (void);
int barcnt = 0;
class Foo {
public:
template<typename T>
void operator()(const T& fcn) {
fcn();
}
};
void bar... |
google | android | error29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error29.C | 175 | utf_8 | f942827c4c8f49e463f6196ed54942bb | // PR c++/33209
template<typename T> void foo(int, T::x); // { dg-error "T::x" }
template<template<typename> class T> void foo2(int, T<int>::x); // { dg-error "T<int>::x" }
|
google | android | sfinae21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae21.C | 1,089 | utf_8 | abf4b7082d84a2ae41fd379ae916c34a | // PR c++/44908
struct A { };
struct B
: public virtual A { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<false, T> { };
template<typename From, typename To>
class mini_is_convertible
{
typedef char one;
typedef struct { char arr[2]; } t... |
google | android | crash91 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash91.C | 146 | utf_8 | 76c753d62ba8d93c3e9903cc843055e7 | // PR c++/28293
template<int> void foo();
struct A
{
typedef void foo<0>(); // { dg-error "explicit template argument list not allowed" }
};
|
google | android | friend51 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend51.C | 178 | utf_8 | 95883d7d1e93cebf1fbefb7361ffe660 | // PR c++/38392
// { dg-do link }
void Function();
int main()
{
Function();
}
template <typename T>
struct Test
{
friend void Function() { }
};
template class Test<int>;
|
google | android | const6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const6.C | 96 | utf_8 | 5a23112c6b3e5d838934cc1d80f3d075 | // PR c++/56684
template < int T > struct S
{
static const int Ti = T;
S() { 1 << Ti; }
};
|
google | android | static21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static21.C | 392 | utf_8 | 2f60676fe6640df70e647dc7565eebca | // PR c++/24389
// { dg-additional-sources "static21-a.cc" }
// { dg-do link }
template<int dummy>
struct X
{
static const int n_primes = 256;
static const unsigned long primes[n_primes + 1];
};
template<int dummy>
const int X<dummy>::n_primes;
template<int dummy>
const unsigned long X<dummy>::primes[n_primes + ... |
google | android | friend33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend33.C | 165 | utf_8 | ed2b58353effe4479fb3ba174d53040c | // { dg-do compile }
// PR c++/18733: Validation of template headers in friends
template<int> struct A
{
void foo();
};
struct B
{
friend void A<0>::foo();
};
|
google | android | nontype26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype26.C | 240 | utf_8 | b6b176e4fa04b8fbceea880b9143cbdc | // PR c++/31671
template<int& i> void doit() {
i = 0;
}
template<const int& i> class X {
public:
void foo() {
doit<i>(); // { dg-error "cv-qualification|no matching" }
}
};
int i = 0;
X<i> x;
int main() {
x.foo();
}
|
google | android | crash89 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash89.C | 212 | utf_8 | 5c0b5dde8e71a56fe836865ad0444395 | // PR c++/34397
template<typename T, int = T()[0]> struct A // { dg-error "subscripted" }
{
typedef A<T> B;
};
A<int> a; // { dg-error "declaration" }
// { dg-prune-output "template argument 2 is invalid" }
|
google | android | ptrmem28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C | 223 | utf_8 | d7e997028da5485d49789a1ed367286f | // PR c++/61488
struct A {
typedef int (A::*cont_func)();
template <A::cont_func> void wait(int);
int notify();
void fix() { wait<&A::notify>(0); } // OK
template <int> void repair() { wait<&A::notify>(0); }
};
|
google | android | crash71 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash71.C | 99 | utf_8 | 2376caa5d87197c3b097e52d7366811e | // PR c++/30659
extern "C" template A<char> foo(); // { dg-error "forbids|static data|expected" }
|
google | android | init1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init1.C | 233 | utf_8 | f30fe425de51d4cb2ab5ff05b71d616a | // { dg-do compile }
// PR c++/9457: ICE tsubst'ing initializers in templates.
template <typename> void foo (int count) {
int i = {count};
}
template void foo<int> (int); |
google | android | nontype2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype2.C | 151 | utf_8 | 00bcc57cb7d33b0250bf5efd8de34dbf | template <bool> struct A {};
template <bool> struct B
{
void foo()
{
const int i=0;
typedef A< i<=1 > C;
typedef A< i<=2 > C;
}
};
|
google | android | static10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static10.C | 580 | utf_8 | 76f7269587f9a5cc5dc6a0a3aa3b2d61 | // PR c++/19555
namespace __gnu_debug_def { }
namespace std
{
using namespace __gnu_debug_def;
template<typename _Tp> class allocator {}; // { dg-message "std::allocator" }
}
namespace __gnu_debug_def
{
template<typename _Tp,
typename _Allocator = std::allocator<_Tp> >
class vector
{
void
... |
google | android | init7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init7.C | 214 | utf_8 | 8b7e2ee31c044917df6c66a5933648fd | /* PR c++/31517. This used to ICE. */
/* { dg-do compile } */
template<typename> struct A
{
static const int i=0;
};
template<typename T> const int A<T>::i = 0=0; /* { dg-error "duplicate initialization" } */
|
google | android | ttp12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp12.C | 472 | utf_8 | 40c193a789a7cdd7cf2b6550ea810505 | // { dg-do compile }
// Check the type of non-type parameter in template template parameter
// only if it is dependent.
template <template <int* p> class T>
struct X {};
template <typename U, template <U* p> class T>
struct Y {
X<T> x;
};
template <int* p> struct Z {};
Y<int, Z> y1;
Y<char, Z> y2; // { dg-error "m... |
google | android | typename17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename17.C | 182 | utf_8 | 81aeb9e1a8d50ce9fb2161d860dc83fa | // { dg-do compile }
// This should fail as A::foo<0> is not a typename at all.
struct A
{
template<int> void foo(int i)
{
typename A::foo<0>(i1); // { dg-error "" }
}
};
|
google | android | memfriend2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend2.C | 874 | utf_8 | 3087e3c10234e9ef3745a413e6043727 | // { dg-do compile }
// Member function template of class template as friend
template <class T> struct A
{
template <class U> void f();
};
class C {
int i;
template <class T> template <class U> friend void A<T>::f();
};
template <class T> struct A<T*>
{
template <class U> void f();
};
template <> struct A<char>... |
google | android | friend49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend49.C | 228 | utf_8 | 6d77be24cb0cbaa83d42b95befcf027c | // PR c++/29054
// { dg-do compile }
struct A
{
template <typename T, typename U> static void create (U) {}
};
struct B
{
friend void A::create <B, const char *> (const char *);
};
int
main ()
{
A::create<B>("test");
}
|
google | android | qual1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qual1.C | 335 | utf_8 | 5512deff68cfd95af05439dc39d36f5c | // { dg-do compile }
template<class T>
class Link_array
{
public:
void sort (int (*compare) (T *const&,T *const&));
};
int shift_compare (int *const &, int *const &) {}
template<class T> void
Link_array<T>::sort (int (*compare) (T *const&,T *const&))
{
}
void f ()
{
Link_array<int> clashes;
clashes.sort (shi... |
google | android | crash19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash19.C | 310 | utf_8 | f106c764c1ea09eba893e334ab4c71d8 | // PR c++/15165
struct S
{
template <class T> S(const T &e);
};
int operator *(const double, const S &);
template <class T>
struct X {
enum { SIXTY_FOUR=64 };
struct node {
unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
void d() {}
};
node *head;
};
template struct X<int>;
|
google | android | crash44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash44.C | 110 | utf_8 | 37c9686aad1de31e5858e6070db0fd76 | // PR c++/25858
namespace N {
template<int> struct A {};
}
struct B N::A<0> {}; // { dg-error "invalid" }
|
google | android | spec27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec27.C | 124 | utf_8 | 5549dda851b53530395009f544d09652 | // PR c++/24139
template<typename T>
struct O {
struct I;
};
template<>
struct O<int>::I
{
I();
};
O<int>::I::I() {}
|
google | android | static35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static35.C | 196 | utf_8 | a9c4873781cdee9da4089c677e6bf829 | // PR c++/10291
// { dg-do link }
template <class T>
int foo ()
{
static int i;
struct S {
int bar () {
return i;
}
} s;
return s.bar ();
}
int main ()
{
foo<int>();
}
|
google | android | friend30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend30.C | 239 | utf_8 | 1d0be2d7ae4ecc088986fba42e7ee292 | // PR c++/14930
template<typename T> class Point;
template<> class Point<double> {
friend class Plane;
double v;
};
struct Plane {
double get(const Point<double>& p);
};
double Plane::get(const Point<double> &p) { return p.v; }
|
google | android | crash51 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash51.C | 270 | utf_8 | 81f57567c6c2e784acb94f07d2c3b51e | // PR c++/26496
template< typename _Generator> int generate_n(_Generator __gen);
struct Distribution { };
typedef double (Distribution::* Pstd_mem)();
int main(void)
{
Distribution* rng;
Pstd_mem ptr;
generate_n(rng->*ptr); // { dg-error "non-static member" }
}
|
google | android | crash23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash23.C | 205 | utf_8 | 0ebb4bf976e610e29316a5634702a44e | // PR c++/17642
template<int dim>
int f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d)
{
for (int d=0; d<dim; ++d)
lsh[d] - (bbox[2*d+1] ? 0 : nghostzones[d]);
}
|
google | android | array20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array20.C | 150 | utf_8 | dbd20d81c325cee68179c0a4fd156f81 | // PR c++/38950
template <typename T, T N> void f(T(&)[N]);
int main() {
int x[2];
unsigned int y[2];
f(x); // works
f(y); // ICE
}
|
google | android | eh2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/eh2.C | 268 | utf_8 | 2bd42f9c520c057a1250a8f6317934fb | // PR c++/23191
// { dg-do compile }
template<typename T> struct A
{
void foo() throw(typename T::X); // { dg-error "not a class" }
};
A<void> a; // { dg-message "required" } |
google | android | access21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access21.C | 230 | utf_8 | 43eff768ad4b6ca2454cbc1618596fb1 | // PR c++/48884
class X
{
static const int I = 42;
friend struct Y;
};
template <int I> struct A { };
struct Y
{
template <typename T>
static A<T::I> f(T t)
{
return A<T::I>();
}
};
int main()
{
Y::f(X());
}
|
google | android | crash61 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash61.C | 128 | utf_8 | da9e80228953353af5459e8d0d689e84 | // PR c++/29733
template<typename T> void foo()
{
T t = 0; // { dg-error "function type" }
}
void bar()
{
foo<int()>();
}
|
google | android | new2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new2.C | 198 | utf_8 | b8243d46589815a568bb0992cb04adec | // PR c++/21336
typedef __SIZE_TYPE__ size_t;
template<class _T> void* operator new( size_t Size, _T&);
struct B {
int a;
int* m() {
return new(a) int;
}
};
B* n() {
return new B();
}
|
google | android | mem-partial2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/mem-partial2.C | 512 | utf_8 | ddb3b643353af64559b17335859b3a54 | // PR c++/14032
// { dg-do run }
template <bool compare>
struct outer
{
template <bool compare_with,bool second>
struct inner // unspecialized compare != compare_with
{
static inline bool test()
{
return false;
}
};
template <bool second> // specialization compare == compare_with
... |
google | android | ptrmem29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem29.C | 220 | utf_8 | 95f5a6f80287c981e1f0659a69703991 | // PR c++/62659
struct D {
typedef int (D::*cont_func)();
template <cont_func> struct B;
template <cont_func cont_f> void wait(B<cont_f> ***);
int done();
template <bool> void fix() { wait<&D::done>(0); }
};
|
google | android | varmod1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/varmod1.C | 255 | utf_8 | 2acd5c5e77f3519d225ba9f87d2a09dd | // { dg-options "-w" }
template<typename T> void foo(T); // { dg-message "note" }
void bar()
{
int i;
int A[i][i];
foo(A); // { dg-error "" }
// { dg-message "(candidate|not a valid template argument)" "candidate note" { target *-*-* } 9 }
}
|
google | android | non-dependent9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent9.C | 273 | utf_8 | d2f711147c60030525ec70290e759fca | // { dg-do compile }
// Two-phase name lookup for address of member:
// Overloading function
struct S
{
int f();
int f(int);
};
template<int (S::*p)()>
struct X
{};
template <class T>
struct Foo
{
X<&S::f> x;
}; |
google | android | spec12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec12.C | 472 | utf_8 | 5887f7286f7e8d72346052184c20f45e | // { dg-do compile }
// Contributed by: Wolfgang Bangerth <bangerth at dealii dot org>
// PR c++/14409: Accepts invalid function signature for explicit instantiation
struct X
{
template <typename U>
void foo (U) {}
template <typename U>
void foo_const (U) const {}
};
template void X::foo (int);
... |
google | android | using15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using15.C | 291 | utf_8 | d1497117d36ab359ffab3550670a6ba3 | // Reduced from the testcase for c++/29433
template <class T>
struct A: T
{
void f(typename T::type);
using T::f;
void g() { f(1); }
};
template <class T>
struct B: T
{ typedef int type; };
struct C
{
typedef double type;
void f();
};
int main()
{
A<B<A<C> > > a;
a.g();
}
|
google | android | crash8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash8.C | 286 | utf_8 | 899e82cfa1eab0c5e96b47962c693262 | // { dg-do compile }
// PR c++/11513: ICE due to incorrect decision whether the tag is template.
template <typename T>
struct bar
{
struct foo
{
int a;
};
template <typename U>
int wom(U c)
{
struct foo b;
}
}; |
google | android | ttp28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp28.C | 326 | utf_8 | 3f96e3fc895a470c89118aba3b7b5e4a | // PR c++/56971
template <typename T>
class rp {
};
template <template <typename> class P>
struct b {
template <class, template <typename> class FriendP>
friend void f(b<FriendP> from);
};
template <class, template <typename> class P>
void f(b<P> from) {
}
int main() {
b<rp> v;
f<int>(v);
return... |
google | android | mangle1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/mangle1.C | 292 | utf_8 | 33119bbc7489f718bc456a2baae44253 | // PR c++/17324
// { dg-do assemble }
template<int, typename T> struct A
{
template<int I> void foo(const A<I,T>&) {}
};
template<typename> struct B
{
template<int J> void bar(const A<J,B>&);
void baz() { A<0,B>().foo(A<0,B>()); }
};
template struct B<void>;
template struct B<int>;
|
google | android | friend13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend13.C | 348 | utf_8 | 443d8784ec310c25ee130df06beefdd0 | // { dg-do compile }
// Perform access checking to parameter and return type of
// function template correctly when only specialization is friend.
template <class T>
typename T::Inner
foo () {
return typename T::Inner();
}
class Outer {
private:
struct Inner {};
friend Outer::Inner foo<Outer> ();
};
v... |
google | android | error40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error40.C | 664 | utf_8 | a73c78b9b0cb5a8fb837e7715821f660 | // { dg-options "-fno-pretty-templates" }
template <class T, int N=0, int X=1>
struct A
{
struct AN;
};
void foo(void)
{
A<void> a = 0; // { dg-error "A<void, 0, 1>" }
}
template <class T> T f(T); // { dg-message "int f<int>.int." }
template <class T> T f(T, int = 0); // { dg-message "" }
template <class T... |
google | android | crash18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash18.C | 329 | utf_8 | 3a58be91fa3ebac110f04aa317762b98 | // { dg-do compile }
// Contributed by: <leif dot lonnblad at thep dot lu dot se>
// PR c++/15064: typeid does not form an integral constant expression
#include <typeinfo>
template <typename T>
void dummy() {
const std::type_info& t = typeid(T);
const std::type_info& t2 = typeid(float);
}
template void dummy<int... |
google | android | ttp27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp27.C | 170 | utf_8 | 052744e1f403dbb8b61873044725e659 | // PR c++/35678
template<typename T, T> struct A;
template<typename> struct B;
template<template<typename T, T> class U> struct B<U<char, 'h'> > {};
B<A<char,'h'> > x;
|
google | android | access8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access8.C | 341 | utf_8 | 51a27bac3d6d8fa430db3b405c07c5af | // { dg-do compile }
// Template instantiate during deferred access check
template <class T> struct C {
typedef typename T::X Y;
};
class A {
typedef int X;
template <class T> friend struct C;
};
C<A>::Y f(int); |
google | android | ttp22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp22.C | 240 | utf_8 | bb208d004cabc03fdafadc3dd900340e | // PR c++/28860
// { dg-do compile }
template<template<int> class A>
class A<0>; // { dg-error "shadows template template parameter" }
template<template<int> class B>
class B<0> {}; // { dg-error "shadows template template parameter" }
|
google | android | qualttp22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp22.C | 803 | utf_8 | 3b637cecee1acb45f1c7f752a8c7732d | // { dg-do compile }
// PR c++/13520: Default template template argument that is a qualified id
// with dependent scope.
template<typename regular_type> class Policy {};
template <typename regular_type, template<typename> class OriginalPolicy>
class ChangedPolicy_impl {};
template <template<typename> class OriginalPoli... |
google | android | nontype4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype4.C | 343 | utf_8 | 4392d870aac6a442184166346dc506e9 | // { dg-do compile }
// PR c++/13797: ICE invalid nontype template parameter
template <int> struct A
{
typedef A<0> B; // { dg-message "previous declaration" }
template <B> struct B {}; // { dg-error "not a valid type|typedef" }
};
A<0> a; |
google | android | overload2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/overload2.C | 267 | utf_8 | 55cb3ca88be88700e7e00981ae5c08c6 | template <class T, int (T::*)> struct foo;
template <class T>
int f(foo<T,&T::ob_type>*);
template <class T>
char* f(...);
struct X { int ob_type; };
struct Y { char* ob_type; };
int x = f<X>(0);
char* y = f<Y>(0);
char* z = f<int>(0);
int main() { return 0; }
|
google | android | new7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new7.C | 180 | utf_8 | e8027e6b33f47fe2a7c9fdde940f6189 | // PR c++/27714
template<typename> struct A
{
static void* operator new(__SIZE_TYPE__);
template<typename T> friend void* A<T>::operator new(__SIZE_TYPE__);
};
A<int> a;
|
google | android | friend12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend12.C | 470 | utf_8 | b0a401cf45ed38cceaf9b0b254083c87 | // { dg-do compile }
// PR 9030. Perform access checking to parameter and return type of
// function template correctly when the template is friend.
template <class T> class Outer {
private:
struct Inner {};
template <class T_>
friend typename Outer<T_>::Inner foo ();
};
template <class T>
typename Oute... |
google | android | crash22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash22.C | 512 | utf_8 | 1a93146cc62f110f6b65fd8e3eb06d85 | // { dg-do compile }
// PR c++/16706: Dependent type calculation during access checking
template<typename> struct A
{
A();
template<typename> struct X {};
};
template<typename T> struct B
{
typename A<T>::template X<int> x;
template<typename> struct C;
};
template<typename T> template<typename U> struc... |
google | android | friend6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend6.C | 914 | utf_8 | d16da0e6f160e02bc23c4d98080f1644 | // { dg-do compile }
namespace boost_no_member_template_friends{
template <class T>
class foobar;
template <class T>
class foo
{
private:
template<typename Y> friend class foobar;
template<typename Y> friend class foo;
template<typename Y> friend bool must_be_friend_proc(const foo<Y>& f);
int i;
public:
... |
google | android | conv8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv8.C | 224 | utf_8 | ecc224a37ac009f350fab0ef1e1594a5 | // { dg-options "-fabi-version=1 -Wno-abi" }
template <typename T> struct S {
struct I{};
operator I* ();
};
template <typename T> struct S2 : S<T> {
operator typename S<T>::I* ();
};
template struct S2<int>;
|
google | android | error33 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error33.C | 206 | utf_8 | 23c1c937dffecf0165fe2c2bd7f041ae | // PR c++/24791
template<int> struct A
{
static int i;
A() { ++i; }
};
template<int> int A<0>::i(0); // { dg-error "template" "error" }
// { dg-message "note" "note" { target *-*-* } 9 }
A<0> a;
|
google | android | const8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const8.C | 161 | utf_8 | 29ed92e899cee3c271630df694a225fc | // PR c++/48707
struct A {
static int a();
};
template<typename X>
struct B: A {
static int const b;
};
template<typename X>
int const B<X>::b=B<X>::a();
|
google | android | void14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void14.C | 208 | utf_8 | 25f480eeead08db92a5bce8ac9a6c4ed | // PR c++/36411
// { dg-do compile }
template<template<void> class> struct A // { dg-error "not a valid type" }
{
template<template<int> class T> A<T> foo(); // { dg-error "mismatch|expected|invalid" }
};
|
google | android | pure1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pure1.C | 98 | utf_8 | b53786f776aa9fc498a50db4a10d9e69 | // PR c++/26122
struct A
{
template<int> void foo() = 1; // { dg-error "pure|non-virtual" }
};
|
google | android | ctor3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor3.C | 269 | utf_8 | eb5e9f0376abe643c647f3a9d5b69532 | struct A {};
struct B;
template <class TP> struct X: virtual A {
template <class TP2> X(TP2* ptr) {}
template <class TP2> X(const X<TP2>) {}
};
struct Y : X<B> {
Y(A* a) : X<B>(a) {}
};
void func1(X<B>);
void func2() {
A a;
Y y(&a);
func1(X<A>(&a));
}
|
google | android | init-list | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init-list.C | 295 | utf_8 | 9783cba5cd0e48e50ecc5c42ed1dd282 | // { dg-do compile }
template<typename T>
struct Base {
Base(int) { }
};
template<typename T>
struct Derived : Base<T> {
Derived();
};
template<typename T>
Derived<T>::Derived() : Base(4) { } // { dg-error "have any field" "" } |
google | android | array2-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array2-2.C | 269 | utf_8 | 8da7cf5d73e9871b3bac6287dfe96d0a | // { dg-do compile }
// { dg-options "-fabi-version=2" }
// PR c++/13494. ICE
template<typename T>
int foo(int d[][4])
{
return d[0][0];
} |
google | android | crash62 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash62.C | 109 | utf_8 | adc7a5c414a143f0cadb9db916df6769 | // PR c++/29728
template<int> void foo()
{
int a[] = { X: 0 }; // { dg-error "designated initializer" }
}
|
google | android | copy1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/copy1.C | 282 | utf_8 | aa4d8b9bd5abd8810e68268afd1bb443 | // { dg-do compile }
// PR 5189
struct A
{
A(A&); // { dg-message "note" }
template <class T> A(T); // { dg-message "note" }
};
A a = 0; // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 } |
google | android | error10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error10.C | 1,375 | utf_8 | a5aedd671af7a8cdd7d4e6c0bc538ee6 | // { dg-do compile }
// { dg-options "-std=gnu++98" }
// Origin: <tilps at hotmail dot com>
// c++/9154: poor error message for ">>" vs "> >" in template argument list
/*
* Test that the error message is issued properly
*/
template <class T>
class A {};
A<A<int>> blah; // { dg-error "should be '> >' within" }
A<i... |
google | android | nontype23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype23.C | 181 | utf_8 | d17e17b15018e6bc4a807c47ac6956b7 | // PR c++/48936
template <bool C> int foo (void);
template <class T> struct S
{
static const unsigned int a = sizeof (T);
enum { c = sizeof (foo <(a == 0)> ()) };
};
S<int> x;
|
google | android | crash77 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash77.C | 166 | utf_8 | f24a600e43d06d3cdd9d3eca14cb1abc | // PR c++/34603
template<typename> struct A; // { dg-error "declaration" }
template<typename T> A<T>::A( struct A; // { dg-error "definition|expected|incomplete" }
|
google | android | crash60 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash60.C | 153 | utf_8 | 2f12f2c641a872263f9bf48d48db92c0 | //PR c++/27961
struct A
{
template<int> void foo(X); // { dg-error "declared" }
};
template<int> void f()(0); // { dg-error "initialize" }
|
google | android | conv11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv11.C | 252 | utf_8 | 142422aea9a677fb32502402e895a96d | int i;
struct A
{
template <class T> operator T&() { return i; } // { dg-message "note" }
};
int main()
{
A().operator int(); // { dg-error "operator int" }
// { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 9 }
}
|
google | android | koenig6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/koenig6.C | 436 | utf_8 | d7b45350c258784a47a153c1dedc979d | // PR c++/38850
template <typename VType>
class Vector2 {
private:
VType c_[2];
public:
typedef Vector2<VType> Self;
Vector2(const VType x, const VType y) {
c_[0] = x;
c_[1] = y;
}
friend inline Self Max(const Self &v1, const Self &v2) {
return Self(v1.c_[0], v1.c_[1]);
}
};
template <clas... |
google | android | defarg15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg15.C | 225 | utf_8 | 8ee1c9ea2d3489ba6d02846d7c1417aa | // PR c++/54198
template <typename T> void
refIfNotNull (T* p1)
{
p1->ref;
}
template <typename T> struct A
{
A (T* p1)
{
refIfNotNull (p1);
}
};
class B;
class C
{
void getParent (A <B> = 0);
};
|
google | android | new6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new6.C | 145 | utf_8 | 4072e1463163161bf945071e8def04c3 | // PR c++/27713
// { dg-do compile }
struct A
{
template<int> friend void* operator new(__SIZE_TYPE__); // { dg-error "invalid template" }
};
|
google | android | new4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new4.C | 164 | utf_8 | ee60767832489389f13d0474ac598f82 | // PR c++/27559
// { dg-do compile }
struct A
{
template<typename T>
static void* operator new(T) {} // { dg-error "first parameter|invalid template" }
};
|
google | android | partial14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial14.C | 296 | utf_8 | ed8b9d57a67bc5c5ea55951ca907f5d9 | // PR c++/59044
template <class T>
class C {
private:
template <T a, T b>
struct Implementation {};
public:
typedef typename Implementation<0, 0>::Typedef Type;
};
template <class T>
template <T b>
struct C<T>::Implementation<0, b> { typedef void Typedef; };
template class C<unsigned>;
|
google | android | non-dependent8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent8.C | 298 | utf_8 | 663136a11c36aa84d57fc0129b2be73d | // { dg-do compile }
// Two-phase name lookup for address of member:
// Detecting error during parsing
struct S
{
char i;
};
template<int S::*p>
struct X
{};
template <class T>
struct Foo
{
X<&S::i> x; // { dg-error "convert|no type" }
}; |
google | android | class3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/class3.C | 81 | utf_8 | 478acfe8108cf9d573a8ff95d3dcf91d | // PR c++/25634
template<int> template<int> struct A; // { dg-error "too many" }
|
google | android | using5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using5.C | 379 | utf_8 | 730dbbdbfc73d70df6d68467f8af3c39 | // { dg-do compile }
// PR 9447. further test cases for dependent using decl
template <typename T> struct Base;
template <typename T> struct Derived : public Base<T> {
using Base<T>::i;
Derived() { i; }
int get_i() { return i.f(); }
}; |
google | android | alignof1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/alignof1.C | 152 | utf_8 | 98629e0464be5ba2c3ca56190b5b6f48 | template<typename T>
int my_alignof()
{
return __alignof__(T);
}
template<typename>
struct X { };
int main()
{
return my_alignof<X<void> >();
}
|
google | android | using17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using17.C | 622 | utf_8 | 24be9330d739e4540644e36d6e434557 | // PR c++/14258
// { dg-do run }
template<typename T>
struct A
{
typedef T type;
typedef A type2;
};
template<typename T>
struct B : A<T>
{
using typename A<T>::type;
type t;
using typename A<T>::type2;
type f()
{
typ... |
google | android | static24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static24.C | 211 | utf_8 | 50003a8a22751483a8181b5d2eebb900 | template<typename> struct A;
template<> struct A<char>
{
static const char i = 1;
};
template<typename T> struct B
{
static const int j = A<T>::i;
static const int k = int(j);
int x[k];
};
B<char> b;
|
google | android | current-inst1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/current-inst1.C | 217 | utf_8 | 75713792374068fe6d8c9f8fc26407dc | // PR c++/53549
template<typename T>
struct C2
{
int operator()();
template<int> struct F2;
};
template<typename T>
template<int I>
struct C2<T>::F2 : C2<T>
{
using C2<T>::operator();
};
C2<int>::F2<42> f;
|
google | android | friend43 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend43.C | 183 | utf_8 | d9e6aaa893125e91967d2b2ffd7b8e4d | // PR c++/28111
// { dg-do compile }
template<typename> void foo();
template<typename T> struct A
{
friend void foo<>(typename T::X); // { dg-error "not a class" }
};
A<int> a;
|
google | android | spec22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec22.C | 636 | utf_8 | fbcb25d460c773d1b6a68ecba11d0fb9 | template <typename T> class srp;
template <typename T> struct ptr
{
template <typename U> ptr(const srp<U> &other); // { dg-message "ptr<T>::ptr" }
};
template <typename T> struct srp
{
template <typename U> operator ptr<U>(void) const; // { dg-message "srp<T>::operator" }
};
ptr<int> parent_get()
{
srp<int> pare... |
google | android | typename19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename19.C | 357 | utf_8 | 5817c410b70cf0419a1198d2aaf89a0e | // PR c++/56395
struct A
{
template <class T> struct B { };
};
template <class T> struct D { };
template <class T, class U> struct C
{
typedef T _Type;
typedef typename T::template B<_Type> _BType;
D<_BType> d;
};
template <class T> struct C<T,T>
{
typedef T _Type;
typedef typename T::template B<_Type> ... |
google | android | access10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access10.C | 306 | utf_8 | 71d21b2797de6268bae8a876a61f64ac | // { dg-do compile }
// PR c++/10849: Incorrect access checking on template specialization.
class X {
private:
template <typename T> struct Y;
};
template <> struct X::Y<int> {};
template <typename T> struct X::Y {};
template struct X::Y<int>; |
google | android | crash108 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash108.C | 208 | utf_8 | d99f465c2964b567ae2f38287c38dd27 | // PR c++/50861
template<class T> struct A {A(int b=k(0));}; // { dg-error "parameter|arguments" }
void f(int k){A<int> a;} // // { dg-message "declared" }
// { dg-message "note" "note" { target *-*-* } 3 }
|
google | android | unify11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/unify11.C | 488 | utf_8 | 09af30adee47658569e7245f1283085e | // Origin: PR c++/40684
// { dg-do compile { target c++11 } }
struct A
{
};
template <typename S, typename T, typename U,
typename S::v = &S::v::s> // { dg-error "is not a" }
typename S::A
foo (S c, T t, U u)
{
}
struct B
{
struct C
{
template <typename U>
C (U t)
{
A a;
A b = foo (this, ... |
google | android | sizeof12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof12.C | 210 | utf_8 | 085b9f955b319ea26fa659b0342a998f | // Origin PR c++/41863
template<int X>
struct Bar
{
};
template<typename T>
class Foo
{
T m_foo;
void
crash()
{
Bar<sizeof(m_foo)> bar;
}
}; |
google | android | typename12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename12.C | 462 | utf_8 | 30d9dbf1a055ca371d55466a58a6efb8 | // { dg-do compile }
// PR 30818, failure to resolve typename typedef
template < typename T >
class A
{
typedef int type;
class B;
};
template < typename T >
class A<T>::B
{
typedef typename A<T>::type type;
type f();
};
template < typename T >
typename A<T>::B::type
A<T>::B::f() { return 0; } |
google | android | memfriend3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend3.C | 669 | utf_8 | fb47ef062f1c0907f4bd591ea44dd1ea | // { dg-do compile }
// Member function of class template as friend
template<class T> struct A
{
void f(T);
};
class C {
int i;
template<class T> friend void A<T>::f(T);
};
template<class T> struct A<T*>
{
void f(T*);
};
template<> struct A<char>
{
void f(char);
};
template<class T> void A<T>::f(T)
{
C c;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.