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 | array1-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array1-1.C | 418 | utf_8 | 99d7b1deba3ad5e11fcbd2dc7d70e9ee | // { dg-do compile }
// { dg-options "-fabi-version=1" }
// PR c++/12774 Array domains compared unequal
void Foo(double r[3][3])
{
}
void Baz()
{
double m[3][3];
Foo(m);
}
template <class T>
void Bar()
{
double m[3][3];
Foo(m);
}
int main()
{
Baz();
Bar<int>();
return 0;
} |
google | android | crash98 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash98.C | 246 | utf_8 | 533e129564f3047607f954786747051f | // PR c++/43630
template < typename > struct A;
template < typename > struct A < int > // { dg-error "not used|template\\-parameter|declaration" }
{
int i;
int f ();
};
int A < int >::f () // { dg-error "incomplete type" }
{
return i;
}
|
google | android | sfinae6_neg | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae6_neg.C | 1,235 | utf_8 | 8d9554dc6976327bd3dd118e393c6f24 | // DR 339
//
// Test of the use of the function call operator with SFINAE
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<fal... |
google | android | repo5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/repo5.C | 402 | utf_8 | 4a25565c9833beec64e5bf027190e23a | // PR c++/25625
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template< typename T, T N > struct integral_c {
static const T value = N;
typedef integral_c< T, value + 1 > next;
};
template< typename... |
google | android | explicit-args1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit-args1.C | 483 | utf_8 | e55630cc11be91571d5b580292e51090 | // PR c++/34950
template <class T = int> struct policy {
typedef int unnecessary;
};
template <class Policy> struct A {
typedef int type;
typedef typename Policy::unnecessary unused;
};
template <class T> struct S {
typedef int type;
typedef typename A<T>::type unused;
};
template <class, class ... |
google | android | incomplete2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/incomplete2.C | 297 | utf_8 | e8b18c9093eb547e76b1598e177671b2 | // PR c++/27427
// { dg-do compile }
struct A;
template<A&> void foo(); // { dg-message "note" }
A a; // { dg-error "incomplete type" }
void bar()
{
foo<a>(); // { dg-error "(no matching function|could not convert)" }
// { dg-message "candidate" "candidate note" { target *-*-* } 12 }
}
|
google | android | friend53 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend53.C | 259 | utf_8 | c02ac6cbb6d31fb45edabe8ff6c697a7 | // PR c++/53403
template <typename T>
class Foo
{
typedef void type;
template <typename U> friend void f();
public:
Foo() {}
};
template class Foo<void>;
template <typename T>
void f()
{
typedef Foo<void>::type type;
}
int main()
{
f<void>();
}
|
google | android | access25 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access25.C | 385 | utf_8 | 8fd60bfd6c2c2368d8cb3afb7640aa87 | // PR c++/56359
typedef int (*InvocationCallback) (const int &);
template < typename target_t >
void SetPrototypeMethod (target_t, const char *, InvocationCallback);
class A
{
void Initialize ();
protected:
static int Stop (const int &);
void Stop (); // comment out to make the bug disappear.
};
void
A... |
google | android | nontype12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype12.C | 1,173 | utf_8 | e4176144e393e4accb07877196c4e693 | // PR c++/20172
template<typename T> struct A
{
template<T> int foo(); // { dg-error "double" }
template<template<T> class> int bar(); // { dg-error "double" }
template<T> struct X; // { dg-error "double" }
};
A<char> a1;
A<double> a2; ... |
google | android | ttp6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp6.C | 415 | utf_8 | ede8e95c1aeeeb0cf1c4cfb0fd860e07 | // { dg-do compile }
// PR c++/10552: Member class template as template template argument
// substitution issue.
template <template <typename> class A, typename>
struct B
{
typedef typename A<int>::t t;
};
template <typename D>
struct E
{
template <typename> struct F { typedef int t; };
typedef typename B<F, D>::... |
google | android | nontype8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype8.C | 439 | utf_8 | 2db8591db13ac8e8cf2e26468f9d18e3 | // { dg-do compile }
// Origin: C++ standard, [temp.arg.nontype]/3
template<int* p> class X { };
int a[10];
struct S { int m; static int s; } s;
X<&a[2]> x3; // { dg-error "" } address of array element
X<&s.m> x4; // { dg-error "" } address of non-static member
X<&s.s> x5; ... |
google | android | static15 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static15.C | 3,226 | utf_8 | c3b36a59772fbeeb2232e39c7ec7b99c | // PR c++/23667
// { dg-options "-std=gnu++98" }
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 + 1] =
{
2ul... |
google | android | ptrmem16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem16.C | 211 | utf_8 | df5cd343f05e3fae16de3ecb28034b53 | // PR c++/25369
// { dg-do link }
template <typename> struct A
{
void foo() {}
};
void bar(void (A<int>::*)()) {}
template <int> void baz()
{
bar(&A<int>::foo);
}
int main()
{
baz<0>();
return 0;
}
|
google | android | spec32 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec32.C | 118 | utf_8 | f2a0b8ac9757fbcaba8addb591bb1e06 | //PR c++/28861
struct A
{
template<template<int> class B> struct B<0>; // { dg-error "name of class shadows" }
};
|
google | android | abstract1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/abstract1.C | 361 | utf_8 | c07d50142bc334d2ce490d4f68be9ca4 | // PR c++/58022
template <class T> struct A { };
template <class T> A<T> & operator<< (A<T>&, T);
template <class T> class foo;
template <class T> A<char> & operator<<(A<char>& o, const foo<T>& l);
template <class T> class foo {
friend A<char>& operator<< <T> (A<char>& o, const foo<T>& l);
};
class bar;
foo<bar> ... |
google | android | crash110 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash110.C | 152 | utf_8 | bc34a5c1a684295dab662a89dc6697f6 | // PR c++/51402
template<void> struct A // { dg-error "not a valid type" }
{
template<int,int> struct B {};
template<int N> struct B<N,N> {};
};
|
google | android | repo1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/repo1.C | 299 | utf_8 | 0a632cddef1c669686cf95071e3afa4f | // { dg-options "-frepo" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
struct A {
A();
};
A::A() {}
template <typename T>
struct B : public A {
B() {} // { dg-bogus "" }
};
B<int> b;
int main () {}
// { dg-final { cleanup-repo-files } }
|
google | android | access17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access17.C | 274 | utf_8 | 092b63314ea4c83dfe2ff66c762901cd | // PR c++/27339
class A
{
private:
enum private_enum {a};
template<A::private_enum v> // OK
struct B
{
void bm();
};
public:
void am()
{
B<a> instance; //OK
instance.bm();
}
};
template<A::private_enum v> // FAIL
void
A::B<v>::bm(){}
|
google | android | incomplete3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/incomplete3.C | 166 | utf_8 | b6192cd189e5459a84384348bf07ab8a | // PR c++/27315
// { dg-do compile }
struct A; // { dg-error "forward declaration" }
template void A::foo<0>(); // { dg-error "before|incomplete" }
|
google | android | ctor7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ctor7.C | 309 | utf_8 | 0572945ccfe2a2369a8e72b22dab3d97 | // PR c++/27640
template < class T > struct refcounted :
virtual T
{
template < class A1 > refcounted (const A1 & a1) : T () { }
};
struct nfsserv {};
template < class T >
void
sfsserver_cache_alloc (int *ns)
{
new refcounted < nfsserv > (*ns);
}
void
usage ()
{
sfsserver_cache_alloc < int > ( 0);
}
|
google | android | crash105 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash105.C | 275 | utf_8 | f07fd8a3820e9db30fbbab54d71dd891 | // PR c++/44118
template < typename > struct S;
template < typename > struct S < int >; // { dg-error "template" }
template < typename > struct S < int >
{
void f ();
};
void
f ()
{
S < int >::f ();
}
// Don't be picky about error-recovery.
// { dg-prune-output "." }
|
google | android | defarg11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg11.C | 512 | utf_8 | d4611f4846a0b498f17d4173fb4e9cfb | // { dg-do compile }
// We used to reject this code as the extension
// for default arguments being accepted as less the
// needed template arguments.
template<typename> struct match { };
template<template<typename> class t,typename T>
struct match<t<T> > { typedef int type; };
template<template<typename,typ... |
google | android | new11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/new11.C | 262 | utf_8 | 8a3716757b496de374cb6d6a4f5b6a64 | // PR c++/54984
// { dg-do run }
int n = 1;
void* operator new(__SIZE_TYPE__)
{
n = -1;
return &n;
}
template <class T>
struct Foo
{
Foo()
: x(new int)
{
if (*x != -1)
__builtin_abort();
}
int* x;
};
int main()
{
Foo<float> foo;
}
|
google | android | friend14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend14.C | 414 | utf_8 | 2c569073aac74ea8a9886428ec873202 | // { dg-do compile }
// Perform access checking to parameter and return type of
// function template correctly when the template is friend.
template <class T> class O {
struct I { I (int); };
template <class T_>
friend typename O<T_>::I f ();
};
template <class T_>
typename O<T_>::I f () { return 1; }
struct X {... |
google | android | crash36 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash36.C | 263 | utf_8 | f8bee91d29458817363bd2ca4c94d704 | // { dg-do compile }
// PR c++/20333: ICE parsing typename without nested-name-specifier
template<class> struct f {};
f<int> f2[2] = {typename f<int>()}; // { dg-error "" } |
google | android | nested2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nested2.C | 115 | utf_8 | 1cf2f3c9d70e586c16763a10c08d9972 | template <class T> class CO {
class CI1 {
class CI2;
};
};
template <class T>
class CO<T>::CI1::CI2 {};
|
google | android | non-type1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/non-type1.C | 911 | utf_8 | c68d85d18e13eca7b98c51e07b278cf0 | // PR c++/4377
template < int I1, int I2 >
class unit
{
public:
typedef unit<I1,I2> my_type;
unit() {}
unit( const unit<I1,I2>& ) {}
template< int Q1, int Q2 >
unit< I1 + Q1, I2 + Q2 > operator * ( const unit< Q1, Q2 >& rhs ) const {
return unit< I1 + Q1, I2 + Q2 >();
}
template< int Q1, int ... |
google | android | array11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array11.C | 462 | utf_8 | 5c9702e760be4db613f93c64564000c5 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// PR c++/19208: Fold dependent array domains
template <class C> struct if_t { typedef int type; };
template <class T> struct ffff { static const bool value = true; };
template <class A>
struct bound_member_action
{
typedef char f[ff... |
google | android | spec28 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec28.C | 180 | utf_8 | d7344703a351e2d4d50cf9f8383b2013 | // PR c++/25854
// Bad diagnostic
// { dg-do compile }
template<typename> struct A {}; // { dg-error "provided" }
template<> struct A<> {}; // { dg-error "wrong number" }
|
google | android | friend37 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend37.C | 194 | utf_8 | 19ae206b65ef32c57066f4c9d603d478 | // PR c++/22147
template<typename> struct A;
template<typename T> void foo(A<T>* p) { *p; }
template<typename> struct A
{
friend void foo<class X>(A<X>*);
};
void bar()
{
foo<int>(0);
}
|
google | android | dependent-expr6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-expr6.C | 301 | utf_8 | 0c0a12ab75ecc281ca68babd4d565ce5 | // { dg-do compile }
// PR C++ 34081 ICE
class Foo;
template < class Foo > class Bar
{
enum Status
{ OK, NO };
enum Status getStatus ()
{
return status;
}
Status status;
}; |
google | android | overload3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/overload3.C | 179 | utf_8 | 98ebf130b836485f9a7ceae171151be5 | // PR c++/16870
struct A
{
int operator[](int) const;
};
template<int> A foo();
A bar(A(*)());
template<int> int baz() { return (bar(&foo<0>))[0]; }
template int baz<0>();
|
google | android | cast1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/cast1.C | 451 | utf_8 | dae4547b0ed98c262ad1adff2778e177 | // { dg-do compile }
struct A
{
void foo();
};
template<int> void bar(A& a)
{
const_cast<A&>(a).foo();
static_cast<A&>(a).foo();
reinterpret_cast<A&>(a).foo();
((A&)a).foo();
}
template void bar<0>(A& a); |
google | android | sfinae28 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae28.C | 364 | utf_8 | 071c3f65cf279133e0877210d8149c4e | // Origin: PR c++/44267
struct B {};
struct D : B {};
struct VD : virtual B {};
template <class T> T create();
typedef char one[1];
typedef char two[2];
template <class D, class B>
one& f(char (*)[sizeof(static_cast<D>(create<B>()))]);
template <class D, class B>
two& f(...);
int main()
{
f<D*, int>(0);
f<D... |
google | android | init6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/init6.C | 515 | utf_8 | 65a281c41b82251552faaf8359766e91 | // PR c++/25836
template <class T>
class Iter {};
template <class T>
class SubIter : public Iter<T> {
void insert(T);
};
class GraphBase {
public:
class Node;
};
template<class T>
class Graph : public GraphBase {
class Inner {
Iter<typename Graph<T>::Node*> *get();
};
};
template<class T>
Iter<typename... |
google | android | static11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static11.C | 90 | utf_8 | d208baa6490e1bda86ed7140d7cc233b | // PR c++/19826
template<typename T> struct A
{
static const T i = 1;
char a[i];
};
|
google | android | defarg4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg4.C | 190 | utf_8 | 64d2588370b2c020d9d5828deadfc7dc | // PR c++/14763
struct A {
int get() const {}
static A *foo();
};
template<bool> struct S {
S(unsigned int = A::foo()->get()) ;
};
void foo() throw() {
S<false> f;
}
|
google | android | member2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member2.C | 254 | utf_8 | cabe816ff29ed547a0c78ab109ad97d0 | // PR c++/8660
// Bug: we were treating the definition of the non-template as a definition
// of the template, which broke.
struct BadgerBuf
{
void ReadPod();
template<class B>
void ReadPod();
};
void BadgerBuf::ReadPod ()
{ ReadPod<int> (); }
|
google | android | access6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access6.C | 421 | utf_8 | 3f2e5ae210f767c1589637afbcf45353 | // { dg-do compile }
// PR c++/8389
// Access control ICE for typename during instantiation and name mangling
template <class> class Base {
protected:
typedef int Type;
};
template <class T> struct Derived : public Base<T> {
typedef typename Base<T>::Type Type;
template <class Arg> void f(Type = Type()) ... |
google | android | ctor5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ctor5.C | 132 | utf_8 | efa9db39e10b4576a573bca4b38cf74b | // PR c++/24278
template<typename T> struct A
{
A() : T(0) {} // { dg-error "base" }
};
A<int*> a; // { dg-message "required" }
|
google | android | spec14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec14.C | 374 | utf_8 | 8c1a1dce043f50d8d866a9779357c645 | // { dg-do compile }
// Origin: <weissr at informatik dot uni-tuebingen dot de>
// PR c++/3671: Non-type enum parameters must not be converted
enum T1 {a};
enum T2 {b};
struct Y {
template <T1 i> void foo() {}
template <T2 i> void foo() {}
};
struct Z {
template <T1 i> void foo() {}
};
template void Y::foo<b>... |
google | android | crash35 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash35.C | 194 | utf_8 | 8df742184e3299064aab4742d5bbf80b | // PR c++/20463
// { dg-do compile }
template <typename T> struct C; // { dg-error "declaration" }
template <typename T> void C<T>::f() // { dg-error "invalid|template" }
{
const foo bar;
}
|
google | android | static32 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static32.C | 163 | utf_8 | ddaf68e1fab11516ec3373cfa6be7fd8 | // PR c++/51430
// { dg-do compile }
template<int> struct A
{
static const int x[] = 0; // { dg-error "in-class initialization|initializer fails" }
};
A<0> a;
|
google | android | koenig9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/koenig9.C | 866 | utf_8 | 0e217ccc45d6ea239c0b368c1909c623 | // PR c++/29131
// int has no associated namespaces, so arg-dep lookup doesn't find g(int).
template <class T> int f() { return g(T()); } // { dg-error "argument-dependent" }
int g(int); // { dg-message "declared here" }
int i = f<int>();
// PR c++/24163
// Unqualified lookup doesn't find names from dependen... |
google | android | friend22 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend22.C | 290 | utf_8 | dbfcd529175cac71265e5dff4f4513fe | // { dg-do compile }
// PR c++/641: Duplicate friend diagnostics
template <class T> class iterator { };
template <class T> class item {
friend class iterator<T>;
friend class iterator<const T>;
};
class A { };
item<const A> i; |
google | android | ctor4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ctor4.C | 1,083 | utf_8 | 517013de9505a99dcece802cdd7f1c6d | // { dg-do compile }
// Bug 16174, SFINAE failure.
template <class T> struct K
{
K();
K(K<T> & rhs);
K(K<T> const& rhs);
template <class U> K(K<U> const& rhs);
private:
template <class U> struct A;
template <class U> struct A< K<U> const>
{ typedef typename K<U>::compile_time_error type; };
// This is... |
google | android | sizeof8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof8.C | 191 | utf_8 | 84c8e28b3b15370829046813c1fbb7b3 | // { dg-do compile }
// PR c++/11406: ICE
template <int> struct S{};
template <int N> S<sizeof(new double[N])> f() {}
template S<sizeof(void*)> f<2>(); |
google | android | defarg6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg6.C | 513 | utf_8 | 74543160bb89c6fe96c522faabe5c5e0 | enum X{ a, b, c };
struct C
{
static void func (X &ref = a); // { dg-error "" }
};
template <typename T>
struct D
{
static void func (X &ref = a); // not an error at this point
};
void Foo (X & obj)
{
D<int>::func (obj);
D<int>::func (); // { dg-error "" }
}
// { dg-prune-output "passing argument" } |
google | android | void9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/void9.C | 149 | utf_8 | 40eb8a19e0fcd553ccef6d762b7efceb | //PR c++/28738
template<int,void> struct A {}; // { dg-error "not a valid type" }
template<int N> struct A<N,0> {}; // { dg-message "invalid" }
|
google | android | sizeof14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof14.C | 113 | utf_8 | f3d1c78c98af6fc6f4d1fbc648a31143 | // PR c++/54844
// { dg-do compile }
template <int N> int fn () { return sizeof (double); }
int var = fn <0> ();
|
google | android | using11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using11.C | 89 | utf_8 | a3ac6b8050e3adf5b98b0e28e64070fc | struct X {
void f();
};
template <typename T>
struct S : public T {
using X::f;
};
|
google | android | vtable1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/vtable1.C | 315 | utf_8 | 98fb9a7526b5989b48ce49e7131f8f76 | // Test that vtables are set up properly for constructors and destructors
// of template classes.
// { dg-do run }
int r;
template <class T>
struct A {
virtual void f () { }
A() { f (); }
~A() { f (); }
};
struct B : public A<int> {
virtual void f () { ++r; }
};
int main ()
{
{ B b; }
return r;
}
|
google | android | crash78 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash78.C | 114 | utf_8 | 63aa4ea81419f0f2436d71c62bb543c3 | // PR c++/35077
template<typename=int struct A __attribute((aligned(4))); // { dg-error "declaration|expected" }
|
google | android | crash25 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash25.C | 86 | utf_8 | a9a41c255aa794f8caef16dd63a3534d | // PR c++/18124
template <template <int> class class> class A {}; // { dg-error "" }
|
google | android | crash103 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash103.C | 95 | utf_8 | 44d05d042dc79a79585f17b3bcda6ec0 | // PR c++/45665
template < typename > struct S;
void (S <0>::*ptr) (); // { dg-error "type" }
|
google | android | friend40 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend40.C | 216 | utf_8 | e91add4174f6722fc0ed3c0bbd420d70 | // PR c++/24173
// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
template <int> struct A;
void foo(A<0>);
template<int> struct A
{
friend void foo(A<0>);
};
void bar()
{
foo(A<0>());
}
|
google | android | typedef17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef17.C | 338 | utf_8 | 1b0cfbee8f3caf6029a657e5011d2adc | // PR c++/37806
extern "C" int printf (const char *, ...);
template <typename T>
struct S1
{
typedef void (function_type)(int) const;
};
struct S2: public S1<int>
{
virtual function_type f = 0;
};
struct S3: public S2
{
void
f (int i) const
{
printf ("Hello world: %d\n", i);
}
};
int
main()
{
... |
google | android | arg9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/arg9.C | 140 | utf_8 | 9a06687b448bfad17e2e10a4c58cfcf5 | // PR c++/57771
// { dg-do compile }
template <int N>
struct S {};
S <static_cast <int> (4>>2)> s1;
S <reinterpret_cast <int> (4>>2)> s2;
|
google | android | ttp15 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp15.C | 342 | utf_8 | c09549e0b04f66b0e190b742362d2eb7 | struct Dense {
static const unsigned int dim = 1;
};
template <template <typename> class View,
typename Block>
void operator+(float, View<Block> const&);
template <typename Block,
unsigned int Dim = Block::dim>
struct Lvalue_proxy {
operator float() const;
};
void
test_1d (void)
{
Lvalue_proxy<Dense> p;
... |
google | android | template-id-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/template-id-1.C | 474 | utf_8 | 2f6494bf04dd960a886f4ba09c1a1bcf | // { dg-do compile }
struct A {
typedef int Y;
typedef double Z;
};
struct B {
template<typename T>
void func(typename T::Y, typename T::Z) { }
};
template<typename T>
struct X {
void gunc();
};
template<typename T>
void X<T>::gunc()
{
B b;
b.func<A>(0, 3.);
}
int main()
{
X<int> x;
x.gunc();... |
google | android | meminit1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/meminit1.C | 137 | utf_8 | 5976fb93a66e679d029e62d55d218219 | // { dg-options "-std=gnu++98" }
template <class T >
struct S
{
S() : S() {} // { dg-message "delegating constructors" }
};
S<int> s;
|
google | android | crash64 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash64.C | 81 | utf_8 | 7045ba233c32f06a7ff182a156a50844 | // PR c++/29730
struct A
{
template<int> void foo()(0); // { dg-error "" }
};
|
google | android | crash100 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash100.C | 348 | utf_8 | 71cd4d9bd2cbdcf3dca414dbf7f1b2af | // PR c++/44628
template <typename T>
class Temp
{
int Val;
public:
operator T&(void) { return Val; }
virtual T& operator=(T a ) // { dg-error "overriding" }
{
Val = a;
return Val;
}
};
class Int : public Temp<int>
{
public:
Int& operator=(int a) // { dg-error "conflicting return type" }
{... |
google | android | qualttp21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp21.C | 290 | utf_8 | d7668570c380f7a54655435e409395c9 | // { dg-do compile }
template <class A>
class foo {
int _foo;
public:
foo() {}
protected:
~foo() {} // { dg-error "~foo" }
};
int main()
{
foo<int> a; // { dg-error "context" }
} |
google | android | sfinae20 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae20.C | 1,065 | utf_8 | 6fa7fa4fb4de4886b98de2ee612e609b | // PR c++/44907
// { dg-options "-std=c++0x" }
#include <utility>
struct A { };
struct B
: public A { };
struct C
: public A { };
struct D
: public B, public C { };
template<typename From, typename To>
class mini_is_convertible
{
typedef char one;
typedef struct { char arr[2]; } two;
template<typ... |
google | android | error5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error5.C | 161 | utf_8 | 668f5fe72c385e6518a4a328986f3ff5 | template <typename T>
struct X<T*> { // { dg-error "not a class template" }
typedef int Y;
};
extern struct Z<int> s; // { dg-error "not a class template" }
|
google | android | qualttp16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp16.C | 599 | utf_8 | d5117f3f1bc5abfa2a210383b5c90542 | // { dg-do run }
extern "C" void abort();
struct A
{
template <class T> class B {};
};
template <template <class> class TT, class T> struct X
{
TT<int> y;
T z;
int f() { return 0; }
};
template <class T> struct X<T::template B, T>
{
typename T::template B<int> y;
T z;
int f() { return 1; }
};
template <class T> ... |
google | android | crash28 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash28.C | 132 | utf_8 | 902d626992584b53e5dc2b44257c55a4 | // PR c++/18445
struct a
{
int what();
};
void g(void*);
template<class T>
void f()
{
a ex;
g(ex.what); // { dg-error "" }
}
|
google | android | error14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error14.C | 104 | utf_8 | 059b8fc25423ba0f718bb1feff4898e7 | // PR c++/16904
template<typename T> struct X
{
X() { this->T::i; } // { dg-error "" }
};
X<int> x;
|
google | android | crash1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash1.C | 335 | utf_8 | ff8577ac97f88f47b1257f3d5c6a4c9a | // { dg-do compile }
// PR 5125. ICE
class S
{
public:
template <class I> void Foo(int (*f)(S& o) );
};
template <class I>
void S::Foo(int (*f)(TYPO&o) ) // { dg-error "Foo|f|TYPO|o" }
{
} |
google | android | explicit8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit8.C | 233 | utf_8 | ad629aa6efcf1374753dbd987791a144 | namespace N {
template <typename T>
struct S {
void f() {}
};
namespace I {
template void S<double>::f(); // { dg-error "namespace" }
}
}
namespace K {
template void N::S<int>::f(); // { dg-error "namespace" }
}
|
google | android | ttp2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp2.C | 354 | utf_8 | 55545b6f734664ea7227a639a1393d4f | // { dg-do compile }
template <class U> struct Alloc {};
template <class T, class U = Alloc<T> > struct Vector {};
template <template <class T, class U = Alloc<T> > class TT>
struct C {
TT<int> tt;
};
int main()
{
C<Vector> c;
} |
google | android | pr4926-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/pr4926-1.C | 350 | utf_8 | 698fef868c92929bbef3fe847bfc6295 | // PR c++/4926
// { dg-do compile }
template <unsigned> struct X { typedef int Type; };
template <typename T> struct Y { char array[1]; };
template<typename T> Y<T> P(T); // acts as "Y<typeof(T)>"
struct F { int operator()() const; };
template <typename T>
typename X<sizeof(P( T()() ).array)>::Type foo();
... |
google | android | function1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/function1.C | 865 | utf_8 | a5ecff5cba84cd71c83879e1437f0497 | // PR c++/38647
// { dg-do compile }
// { dg-prune-output "note" }
template<const char *, int> struct A {};
const char func[] = "abc";
template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" }
char a1[1];
A<a1, 0> a;
template<const char *, int> struct B {};
temp... |
google | android | canon-type-5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/canon-type-5.C | 338 | utf_8 | 85fdca2492646ea03edf6e35b0a582d0 | // Origin PR c++/39754
// { dg-do compile }
struct Foo {};
template<typename> struct A ;
template<typename T ,typename = A<T> > struct B { } ;
template<class W, class>
struct D
{
typedef W X ;
A<X Foo::*> a ;
} ;
template<class Y>
struct E
{
B<Y Foo::*> b ;
} ;
E < int > e ; |
google | android | access24 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access24.C | 187 | utf_8 | e369c82013a70a752273af1adface28c | // PR c++/54437
template <void (*P)()> void f();
class A {
template <class T> static void g();
template <class T> static void h () { f<g<T> >(); }
static void i() { h<int>(); }
};
|
google | android | redecl4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/redecl4.C | 144 | utf_8 | cd21403ce71916cfa4b5c75f6da549d9 | // PR c++/28710
// { dg-do compile }
template<int> union A; // { dg-error "previous" }
struct A; // { dg-error "non-template" }
|
google | android | pseudodtor5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/pseudodtor5.C | 240 | utf_8 | bb39ba4948ed54bad8f9e9fc8e3fbb26 | // PR c++/37563
struct A {};
template<int> struct Traits
{
typedef void X;
};
template<> struct Traits<0>
{
typedef A X;
};
template<int N> struct B
{
typedef typename Traits<N>::X Y;
void foo(Y y)
{
y.Y::A::~A();
}
};
|
google | android | cast3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/cast3.C | 293 | utf_8 | f715bb7e6f7666f67d1ebfc95f66935e | // PR c++/56438
struct A { };
A& operator<<(A&, const char*);
struct B {
int size();
};
struct C { };
template <class S, class T>
S bar(const S& s, const T& t) {
return s;
}
template<class S, class T>
void foo() {
A a;
B b;
a << bar(b.size(), C()); // { dg-error "no match" }
}
|
google | android | friend16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend16.C | 320 | utf_8 | 594b1d8549baa1139753596a807dbd91 | // { dg-do compile }
// PR c++/9602: Inline friend/pure virtual tree data sharing in
// class template.
template <typename T> struct X {
void foo (X);
friend void bar () {}
};
template <typename T>
void X<T>::foo (X x) {}
template struct X<int>; |
google | android | member9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member9.C | 327 | utf_8 | 807c0634d8537b12659c5c1e5946086a | // Origin PR c++/48838
// { dg-do compile }
class DUChainItemSystem
{
public:
template<class T>
void registerTypeClass();
static DUChainItemSystem& self();
};
template<class T>
struct DUChainItemRegistrator
{
DUChainItemRegistrator()
{
DUChainItemSystem::self().registerTypeClass<T>();
... |
google | android | nontype18 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype18.C | 179 | utf_8 | 2e2e9f4aee22cc3045d21afc23fb88ce | // PR c++/28743
template<int I> struct A
{
template<typename T> void foo();
};
template<int I> template<typename T> void A<0>::foo() {} // { dg-error "template parameter" }
|
google | android | access12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access12.C | 265 | utf_8 | 20c6114a3d4d0119b052ef6635d54a2c | // { dg-do compile }
// PR c++/10849: Incorrect access checking on class template partial
// specialization.
class X {
private:
template <typename T> struct Y;
};
template <typename T> struct X::Y<T*> {}; |
google | android | using21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using21.C | 385 | utf_8 | 8f24a6602645350feb421484b6b3ea57 | // PR c++/52126
// { dg-do compile }
template<typename T>
struct A
{
int foo;
struct B;
struct C;
struct D;
struct E;
};
template <class T>
struct A<T>::B : A<T>
{
using A::foo;
};
template <class T>
struct A<T>::C : A
{
using A::foo;
};
template <class T>
struct A<T>::D : A<T>
{
using A<T>::foo;
}... |
google | android | shadow1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/shadow1.C | 123 | utf_8 | 29035539c4fa91a4347b7a40e31e2701 | // PR c++/58632
template<template<int I> class A> // { dg-message "shadows" }
class A {}; // { dg-error "declaration" }
|
google | android | crash84 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash84.C | 372 | utf_8 | 549c3852175cb8583d8001c2823bd41c | // Origin PR c++/35405
// { dg-do compile }
template<typename T> struct a
{
template <template <typename> class C, typename X, C<X>* =0>
struct b
{
};
};
void
foo ()
{
a<int> a1; // OK
a<int>::b<a,int> b1; // { dg-error "template argument" }
}
// { dg-prune-output "invalid type in declaration" } |
google | android | crash70 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash70.C | 193 | utf_8 | e7c65b521cffd29e1a3625614a4329be | // PR c++/32113
template<int> struct A;
template<typename T> void foo (A<&T::template i>); // { dg-error "not a template" }
template void foo<A<0> > (A<0>); // { dg-error "does not match" }
|
google | android | nontype1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype1.C | 177 | utf_8 | 0841e0681f53f5792b711984e991f3a8 | // PR c++/4934
// dump_expr didn't know how to deal with a CONVERT_EXPR with no type.
template<unsigned> struct A {};
template<typename T> struct B { A<sizeof(+int())> a; };
|
google | android | instantiate6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate6.C | 311 | utf_8 | 1b065aa49cdac44198ed227ed0da9cb5 | // { dg-do compile }
// PR c++/13289: ICE recursively instantiate static member data.
template <int N> struct S {
static const int C;
};
template <int N>
const int S<N>::C = S<(N+1)%2>::C;
template struct S<1>; |
google | android | shift1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/shift1.C | 223 | utf_8 | 429c749d4a969d6e6782e2108d66cc72 | // PR c++/18140
// { dg-options "-std=gnu++98" }
template <int N> struct IntHolder {
static const int value = N;
};
template <int N, int S> struct ShrIntHolder {
static const int value = IntHolder< N>>S >::value;
};
|
google | android | func2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/func2.C | 406 | utf_8 | d68216ca94895657c1d7e1a9deffaa6e | // { dg-do compile }
typedef void (*fptr)();
fptr zeroptr = 0;
template<typename T, fptr F> struct foo { };
template<typename T> struct foo<T,zeroptr> { };
// { dg-error "not a valid template argument" "not valid" { target *-*-* } 6 }
// { dg-error "must be the address" "must be the address " { target *-*-* } 6 }
//... |
google | android | crash74 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash74.C | 197 | utf_8 | 1363ef4acbdebfd7f9100d267a7e11ab | // PR c++/34089
// { dg-do compile }
// { dg-options "" }
template<typename F> void foo () { } // { dg-prune-output "previous" }
template<typename F> struct foo<F> { }; // { dg-error "template" }
|
google | android | instantiate7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate7.C | 254 | utf_8 | 45a941d2c18f981ce0d37d4ebeae6190 | // PR c++/19498
// { dg-do compile }
template<typename T> struct A
{
template<T&> struct B; // { dg-error "reference to void" }
};
A<void> a; // { dg-message "required" } |
google | android | for1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/for1.C | 250 | utf_8 | 27ffc9918dee82089419624de1850354 | // PR c++/47388
// { dg-do compile }
// { dg-options "-fno-for-scope" }
template <int>
void
foo ()
{
int i;
for (i = 0; i < 16; i++)
;
for (int j = 0; j < 16; j++)
;
if (j != 16)
for (;;)
;
}
void
bar ()
{
foo <0> ();
}
|
google | android | partial6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial6.C | 594 | utf_8 | af2b317af1f920fbca6b70a32297df09 | // PR c++/41703
// The second GetAllSize template is more specialized because even though
// deduction on each parameter type succeeds, we never get a template
// argument for its X to make it match the first template.
template <typename T, int (T::*)() const>
struct TSizeEnabler
{
typedef T TClass;
};
template <... |
google | android | friend28 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend28.C | 449 | utf_8 | 5242e61bb45530434007931e7e9949d2 | // PR c++/15629
// { dg-do link }
template<int a, int b> class T;
template<int a, int b> void func(T<a, b> * t);
template<int a> void func(T<a, 3> * t) {}
template void func<2>(T<2, 3>*);
template<int a, int b> struct T {
friend void func<a, b>(T<a, b> * t);
friend void func<a> (T<a, 3> * t);
... |
google | android | typename18 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typename18.C | 223 | utf_8 | 281d5672faf3e37ce44792d24c1cc723 | // { dg-do compile }
// These typename should work as they are types.
struct A
{
typedef int a;
template <int>
struct f {};
template<int> void foo(int i)
{
typename A::a(i1);
typename A::f<0>(i2);
}
};
|
google | android | crash106 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash106.C | 279 | utf_8 | ef85880b4b1dc7af7256099bc4e93ce4 | // PR c++/47974
typedef double T;
struct A
{
template<T> void foo(); // { dg-error "type" }
};
template<T N = 0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared" }
B<> b; // { dg-error "type|declaration" }
// { dg-prune-output "could not convert" }
|
google | android | instantiate5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate5.C | 524 | utf_8 | 6888f3f922d084199e0af93c5fbadceb | // { dg-do compile }
// PR c++/11616: Incorrect line number in diagnostics
template <int> struct A
{
static const int i=0;
};
int baz() { return A<0>::i; }
struct B
{
static void foo (int); // { dg-message "B::foo|candidate expects" }
};
template <typename T> struct C
{
virtual void bar() const { T::foo(); } // {... |
google | android | conv12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/conv12.C | 545 | utf_8 | 6652f3b06cb1bfcdf341802d7b0a8a9a | // PR c++/51079
#if __cplusplus > 199711L
struct C1
{
template <class T>
operator T() = delete; // { dg-message "declared here" "" { target c++11 } }
operator bool() { return false; }
} c1;
int ic1 = c1; // { dg-error "deleted" "" { target c++11 } }
int ac1 = c1 + c1; // { dg-error "deleted" "" { target c++1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.