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 | qualttp12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp12.C | 348 | utf_8 | f5d74cc14dee1391fe409d4d0258396e | // { dg-do link }
struct A
{
template <class T> class B {};
};
template <template <class> class TT> void f()
{
TT<int> y;
}
template <class T> struct C
{
void g() { f<T::template B>(); }
};
int main()
{
C<A> c;
c.g();
} |
google | android | ntp1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ntp1.C | 396 | utf_8 | 72688e70f855e78a966cd593acf9f923 | // { dg-do compile }
// PR 35. We were default promoting template PARM_DECLs
template <short B> class R {};
template <class T> class A
{
public:
template <short B>
void operator() (R<B> const &);
};
int main() {
A<int> a;
R<1> r;
a (r);
return 0;
} |
google | android | typename2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename2.C | 632 | utf_8 | e157ec339365093c9f152c565a72d172 | // { dg-do compile }
// { dg-options "" }
// PR 5507. Overzealous implicit typename warning
template<typename _CharT>
class __ctype_abstract_base
{
typedef int mask;
};
template<typename _CharT>
class ctype : public __ctype_abstract_base<_CharT>
{
typedef typename ctype::mask mask;
};
template<typename _CharT>
clas... |
google | android | ptrmem26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem26.C | 95 | utf_8 | 0d524ba59ac7aba767ec6a00d1495501 | // PR c++/46552
struct S
{
int x;
};
template < typename >
void f( void )
{
&S::x;
}
|
google | android | typedef11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef11.C | 453 | utf_8 | b78c82a7750916aed5380fcb3deb8b10 | // Origin: PR c++/26693
// { dg-do compile }
class Alpha
{
typedef int X; // { dg-error "'typedef int Alpha::X' is private" }
};
template<int>
class Beta
{
typedef int Y; // { dg-error "'typedef int Beta<0>::Y' is private" }
};
template <int>
int
bar ()
{
Beta<0>::Y i = 0; // { dg-error "within this context" }... |
google | android | repo4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo4.C | 292 | utf_8 | fda0c1ab651480c546b2e4e94922aebd | // PR c++/17775
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
namespace {
struct Foo {};
}
template <typename Tp>
void foo(Tp) {}
int
main()
{
foo(Foo());
}
|
google | android | sfinae1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae1.C | 484 | utf_8 | d4a6fe33f1456d026d068d25f316aa9c | // PR c++/14337
template <bool> struct Constraint;
template <> struct Constraint<true> { typedef int Result; };
template <typename T>
struct IsInt { static const bool value = false; };
template <>
struct IsInt<int> { static const bool value = true; };
template <typename T>
typename Constraint<IsI... |
google | android | explicit7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit7.C | 312 | utf_8 | 9710691c4af4b589e4831b829d124e2e | // PR c++/22263
// { dg-do link }
template <class T> struct S { T foo (); T bar (); };
template <class T> T S<T>::foo () { return bar (); }
template struct S<int>;
template <class T> T S<T>::bar () { return T (); }
#if !__GXX_WEAK__
template int S<int>::bar ();
#endif
int main () { return S<int>().foo (); }
|
google | android | spec5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec5.C | 85 | utf_8 | ac4700345bbf0d5aafda66965305864b | template <int i> struct A;
template <> struct A<0> { struct B; };
struct A<0>::B {};
|
google | android | static17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static17.C | 225 | utf_8 | a65d6e5ddc2f69a204f701eb15bc324b | // PR c++/23896
template <int> struct X {};
template <typename T> struct length {
static const int value = 2;
};
template <typename T> void foo () {
sizeof(X<length<T>::value>);
}
template void foo<int>();
|
google | android | injected1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/injected1.C | 679 | utf_8 | 59eb525ce48c5e31b50c37c8d6c5f08e | // PR c++/13950, DR 176
template <class T> struct Base { }; // { dg-message "" } candidate
struct D1: Base<void>
{
D1::Base* p1;
D1::Base<double>* p2;
Base *p3;
Base<double>* p4;
};
struct D2: Base<void>, Base<void*>
{
D2::Base* p1; // { dg-error "" }
D2::Base<double>* p2;
Base *p3; // { dg-error "... |
google | android | complit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/complit1.C | 168 | utf_8 | d8eeedb4ae11ac620e9e3c21e5ce29ae | // { dg-options "" }
template <int D> struct C {
int d[3];
C();
};
template<int D>
C<D>::C() : d((int[]){1,2,3}) {} // { dg-error "array" }
template class C<1>;
|
google | android | sizeof5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof5.C | 201 | utf_8 | 3732e9c01b98ba779d2beb4a94b1f1a4 | // PR c++/9907
// sizeof(foo()) was not considered constant.
template <unsigned n> struct bar {};
int foo();
template <class T>
void baz()
{
bar<sizeof(foo())> b;
} |
google | android | debug1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/debug1.C | 305 | utf_8 | 884d79169a3e45dac3ed1c397aba8ac9 | // PR c++/40274
// { dg-options "-g" }
template <class T> struct valuelist_types
{
struct null { };
template <T V, class next=null> struct list { };
};
template <unsigned D> void foo()
{
typename valuelist_types<unsigned>::template list<D> v;
}
void bar()
{
valuelist_types<unsigned>::list<2> v;
}
|
google | android | repo8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo8.C | 347 | utf_8 | 7aaeeff16027161d626d21273f9ac79c | // PR c++/34340
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
struct A
{
int a;
};
template <typename T> struct D
{
static const A b;
};
template<typename T> const A D<T>::b = { 2 };
const A *x = ... |
google | android | crash21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash21.C | 915 | utf_8 | e11ee09376a4af9fd0b4e8a0131f1ad5 | // { dg-do compile }
// PR c++/16706: Dependent type calculation during access checking
template <typename> struct B {
B() throw() {}
struct S { };
static int i;
typedef unsigned short int dummy;
};
template <typename _Tp>
struct allocator: B<_Tp> {
template<typename _Tp1> struct rebind
... |
google | android | error11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error11.C | 109 | utf_8 | 92cc57f022fdde0a0e1d5b1eb3c129b3 | // PR c++/12132
inline template <int> void foo () {} // { dg-error "<" }
void abort (); // { dg-error ";" }
|
google | android | nontype11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype11.C | 282 | utf_8 | 9ba9723e8601b19208ac3f8350ee6695 | // { dg-do compile }
// Origin: <fsm at robots dot ox dot ac dot uk>
// PR c++/18354: Unary plus should not be wrapped in NON_LVALUE_EXPR
template <int N>
struct X { };
const int n = 1;
void f()
{
X< 1> a;
X<-1> b;
X<+1> c;
}
void g()
{
X< n> a;
X<-n> b;
X<+n> c;
}
|
google | android | friend19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend19.C | 396 | utf_8 | 599c6765352974ba5694506637bc1ea3 | // { dg-do compile }
// PR c++/11030: Template substitution of friend class that is
// a specialization.
template <int S>
struct A
{
void func(void);
};
template <class T>
class C
{
static void private_func(void) {}
public:
friend class A<512>;
};
template <int S>
void A<S>::func(void)
{
C<void>::private_func()... |
google | android | redecl3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/redecl3.C | 223 | utf_8 | 397a393f391e401bd8e5e28d01882ef8 | // PR c++/19980
// { dg-do compile }
int foo; // { dg-message "previous declaration" }
template<int> void foo() {} // { dg-error "redeclared" } |
google | android | defarg12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg12.C | 168 | utf_8 | b4e6ac72e699425e016e3e7bc21e8d39 | // PR c++/35828
// { dg-do compile { target c++11 } }
template < typename > struct A ;
template < template < typename > class = A >
void test ()
{
test ();
}
|
google | android | fn-ptr2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/fn-ptr2.C | 369 | utf_8 | bf4059583f0cb76eb21c8462cd632142 | // PR c++/56095
int *a(void) { return 0; }
typedef void voidfn(void);
template <voidfn* b> void z1(void) {}
template <voidfn& b> void z2(void) {}
int main()
{
z1<(voidfn*)a>(); // { dg-error "" }
z1<reinterpret_cast<voidfn*>(a)>(); // { dg-error "" }
z2<(voidfn&)a>(); // { dg-error "" }
z2<reint... |
google | android | error-recovery1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error-recovery1.C | 179 | utf_8 | 96f7108f863832f018e00d40ac665c3e | // PR c++/43076
struct S;
template < typename > struct T
{
template < typename >
template < bool > struct T < S > // { dg-error "" }
{
void f () { // { dg-error "" }
|
google | android | sfinae18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae18.C | 233 | utf_8 | c69bb3273ce27c4b44754551d50caaf4 | // PR c++/41468
typedef int Ft(int);
struct A { operator Ft*(); };
struct B { operator Ft*(); };
struct C : A, B { };
template<typename C> void f(int (*a)[sizeof(C()(0))]);
template<typename C> void f(...);
int main() { f<C>(0); }
|
google | android | overload1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/overload1.C | 456 | utf_8 | 6cba2353f6c7917dd350506e390d9379 | // { dg-options "-w" }
// PR c++/9420
// Bug: We were instantiating B<int> during overload resolution for E<0.
// This is wrong; the contents of B<int> are not relevant, since we can't
// use its constructors (because we'd already be using a constructor for
// C).
enum { E };
template <typename T> struct A {
static... |
google | android | template-id-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/template-id-2.C | 369 | utf_8 | ecf0de18eacd09d8644abc4030d2c8f0 | // { dg-do compile }
// PR c++/12924
template<typename> struct A {};
template<> struct A<void>
{
template<typename T> void foo()
{
A<T> a;
a.template foo<int>(); // { dg-error "member" }
}
};
void bar()
{
A<void> a;
a.foo<int>(); // { dg-message "required" }
} |
google | android | char1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/char1.C | 132 | utf_8 | da6545b2d6ba666e74a516285717c0ed | template <class CharType, CharType line_terminator = 0>
class String {};
String<signed char, 255> s; // { dg-warning "overflow" }
|
google | android | crash3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash3.C | 94 | utf_8 | 18fc9fd079fbcb8ff4e2ad941df67718 | struct S {
};
extern S i[];
void g (S*);
template <typename T>
void f () {
g (&i[2]);
}
|
google | android | using18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using18.C | 517 | utf_8 | cfc21cabe74fa837433fc899f5f5211c | // PR c++/23211
// { dg-do compile }
template<class T>
struct foo
{
typedef int jtype;
struct bar
{
using typename foo<T>::jtype; // { dg-error "not a base type" }
using foo<T>::jtype; // { dg-error "not a base type" }
};
};
template <class T>
struct A : T
{
using T::i;
using typename T::typ... |
google | android | nested3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nested3.C | 457 | utf_8 | ef7f36711851ed451f4f826a28d9fadd | template <class T1, class T2>
class A {
template <class S>
class SubA {
int _k;
};
T1 _t1;
T2 _t2;
};
template <class U>
class B {
class SubB1 {
B _i;
};
class SubB2 {
int _j;
};
A<U,SubB1>::SubA<SubB2> _a; // { dg-error "not a base type" "not base" }
// { dg-message "note" "note" { ... |
google | android | qualttp3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp3.C | 392 | utf_8 | 91db5b2e9413146a0519b8347dce2dea | // { dg-do compile }
struct A
{
template <class T, class U> class B {};
};
template <template <class> class TT> struct X
{
TT<int> y;
};
template <class T> struct C
{
X<T::template B> x; // { dg-error "type" }
};
int main()
{
C<A> c; // { dg-message "required" }
} |
google | android | ptrmem22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem22.C | 597 | utf_8 | 1deaba7f1445a234a33b8d445f9ce048 | // PR c++/44778
enum Healpix_Ordering_Scheme { RING, NEST };
class Healpix_Base
{
protected:
Healpix_Ordering_Scheme scheme_;
int nest2ring (int pix) const;
int ring2nest (int pix) const;
typedef int (Healpix_Base::*swapfunc)(int pix) const;
};
template<typename T> class Healpix_Map: public He... |
google | android | enum4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/enum4.C | 118 | utf_8 | 118d8ffd607a579db3ddbc9662179566 | // PR c++/18020
template <typename> struct bar {
enum {
e1 = 1,
e2 = ~e1
};
};
template struct bar<int>;
|
google | android | ttp16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp16.C | 152 | utf_8 | 93f5f30ce330a50c0d7dc80278b3e0d8 | template <template <typename> class C>
void f() {}
template <typename T, typename U = int>
struct S {};
template void f<S>(); // { dg-error "match" }
|
google | android | friend34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend34.C | 290 | utf_8 | 861190a2944f470305adf84080e394bd | // { dg-do compile }
// PR c++/9783: Forward declaration of class in template.
template <typename T>
struct C {
void foo (struct X *);
};
struct X {};
template <typename T>
void C<T>::foo(struct X *) {} |
google | android | memfriend11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend11.C | 966 | utf_8 | 63a099d4fd981493045dce1eefbf9723 | // { dg-do compile }
// Nested class template of class template as friend
template<class T> struct A
{
template <T t> struct B
{
void f();
};
};
class C {
int i;
template<class T> template <T t> friend struct A<T>::B;
};
template<class T> struct A<T*>
{
template <T* t> struct B
{
void f();
};
};... |
google | android | pr35240 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr35240.C | 142 | utf_8 | 8b412f982420deb1ea42c0e8ebcbb0b4 | // PR c++/35240
// { dg-do compile }
template<int> struct A {};
template<int N> A<sizeof(new int[N][N])> foo();
void bar()
{
foo<1>();
}
|
google | android | ttp26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp26.C | 209 | utf_8 | 441677b54d35c8c2843c3ae2399b893b | // PR c++/34052
template<typename T = int, typename U> class C; // { dg-error "no default argument" }
template<template<typename T = int, typename U> class C> struct X; // { dg-error "no default argument" }
|
google | android | const7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const7.C | 126 | utf_8 | 4a59aab32c22e47414d9d9e930f7986d | // PR c++/47897
template < typename T, T N >
struct S
{
static const T value = N;
typedef S< T, value + 1 > next;
};
|
google | android | repo3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo3.C | 324 | utf_8 | 8a2e51baf8c1d282bb93044b215b3c77 | // { dg-options "-frepo -DF='a'" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template <typename A, typename B> void f () {}
template <typename A, typename B> void g () { f<int,int>(); }
int main () { g<int,int>(); }
char c = F;
// { dg-final { cleanup-repo-files ... |
google | android | spec9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec9.C | 414 | utf_8 | 03e26c658592047cdea1d686aa9cfacf | // { dg-do compile }
// PR c++/10956: Incorrect template substitution for member template
// specialization inside template class.
template <int> struct C {
template<typename T> void pre_add(T);
};
template<>
template<typename T>
void C<32>::pre_add(T) {
T pre;
}
int main() {
C<32>().pre_add<int>(1);
} |
google | android | memfriend9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend9.C | 716 | utf_8 | 6602e9e6cba784386891556ebd44b430 | // { dg-do compile }
// Nested class of class template as friend
template<class T> struct A
{
struct B
{
void f();
};
};
class C {
int i;
template<class T> friend struct A<T>::B;
};
template<class T> struct A<T*>
{
struct B
{
void f();
};
};
template<> struct A<char>
{
struct B
{
void f(... |
google | android | typedef34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef34.C | 564 | utf_8 | b2cb2daaa093a2320aa6fa022b544e0b | // Origin PR c++/45200
// { dg-do compile }
template<typename T>
struct remove_reference
{
typedef T type;
};
template<typename TestType>
struct forward_as_lref
{
};
template<typename Seq, typename N>
struct apply1
{
typedef typename remove_reference<Seq>::type seq;
typedef forward_as_lref<typename seq::seq_ty... |
google | android | crash13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash13.C | 400 | utf_8 | 2fcd941d4dd7debb10ded9602271ab54 | // { dg-do compile }
// PR c++/11076: ICE for invalid access declaration containing typename.
template<typename, typename T=void> struct A
{
typedef A<T,T> B;
};
template <typename T> struct C
{
typedef typename A<T>::B X;
X::Y; // { dg-error "not a base type" }
// { dg-warning "deprecated" "" { target *-... |
google | android | lvalue1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lvalue1.C | 621 | utf_8 | c0214387b51fcbd1778447a0a4a88720 | // PR c++/38877
template<class _T1, class _T2>
struct pair
{
typedef _T1 first_type;
typedef _T2 second_type;
_T1 first;
_T2 second;
pair () : first(), second() { }
pair(const _T1& __a, const _T2& __b)
: first(__a), second(__b) { }
};
template<class _T1, class _T2>
inline pair<_T1, _T2>
make_pair(_T1 ... |
google | android | static16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static16.C | 533 | utf_8 | ad55298cbb7ecb4c0c032a17f174564f | // PR c++/23691
namespace std {
class type_info {
bool operator==(const type_info& __arg) const;
};
}
template <class T, T val> struct integral_constant {
static const T value = val;
};
template< typename T > struct is_integral : integral_constant<bool,false> {};
template <bool B> struct enable_if_c {};
te... |
google | android | typename20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename20.C | 138 | utf_8 | 9e947348c80b5b375430f354424dbea6 | // PR c++/56543
template <typename>
struct S;
template <typename T>
struct U
{
typedef typename S <T>::template V <> W;
S <W> x;
};
|
google | android | koenig5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/koenig5.C | 524 | utf_8 | 02dae2280971fe5ff910e6472b7a407a | // { dg-do compile }
// Contributed by David Abrahams <dave at boost-consulting dot com>
// PR c++/14143: Koenig lookup should only look into template arguments only
// if the argument is a template-id.
namespace fu
{
template <class T>
struct bar
{
struct baz {};
};
}
namespace axe
{
struct handle ... |
google | android | error45 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error45.C | 346 | utf_8 | 7671645c3f9a57016a5fee9111ddb609 | // PR c++/47125
template < bool, typename >
struct enable_if {};
template < typename T >
struct enable_if< true, T >
{
typedef T type;
};
template < typename T >
struct enable_if< true, T >::type
f( T x ); // { dg-error "not a class type" }
void
g( void )
{
f< int >( 0 ); // { dg-error "no match" }
}
// {... |
google | android | partial-specialization | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial-specialization.C | 295 | utf_8 | e187a317d102d915368fe357726202ba | // { dg-do compile }
struct B
{
int i;
};
template <class _T, class _M, _M _T::* _V>
struct A;
template <class _T, int _T::* _V>
struct A<_T, int, _V>
{
};
int main()
{
A<B, int, & B::i> a;
} |
google | android | error42 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error42.C | 375 | utf_8 | 0f72e7f5b78f19b4c40b2fd681e5db21 | // PR c++/40372
// { dg-do compile }
template <int> struct A
{
int i; // { dg-error "invalid use of non-static data member" }
friend void foo ()
{
int x[i]; // { dg-error "from this location" }
}
};
struct B
{
int j; // { dg-error "invalid use of non-static data member" }
friend int bar ()
{
... |
google | android | offsetof3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/offsetof3.C | 282 | utf_8 | 9ec5d5812226d3bfd59f234bd2a254c2 | // PR c++/64487
struct foo {
int member;
};
template < int N>
struct bar {};
template <int N>
struct qux {
static bar<N+__builtin_offsetof(foo,member)> static_member;
};
template <int N>
bar<N+__builtin_offsetof(foo,member)> qux<N>::static_member;
int main() { }
|
google | android | new9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new9.C | 223 | utf_8 | d9f77d8b87ad7fd06a4f1856e8f33024 | // PR c++/46277
class ggRGBE {
public:
ggRGBE();
};
template <class T> class ggIO
{
void readbody(int);
ggRGBE *scanline;
};
template <class T> void
ggIO<T>::readbody(int width)
{
scanline = new ggRGBE[width];
}
|
google | android | explicit6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit6.C | 297 | utf_8 | 0f1992cf38a7f4a3d4febc06bbe2dc39 | // Bug 19895: ICE on invalid
struct A;
template A<>::A(); // { dg-error "(not a template)|(explicit qualification)" "" } |
google | android | friend35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend35.C | 347 | utf_8 | e1e2f22ab1205ab9d092f2b388d3e071 | // { dg-do compile }
// PR c++/4403: Incorrect friend class chosen during instantiation.
template <typename T>
struct A
{
struct F;
};
template <typename T>
struct B : A<T>
{
friend struct F;
private:
int priv;
};
struct F
{
void func(void)
{
B<int> b;
b.priv = 0;
}
}; |
google | android | memfriend7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend7.C | 2,480 | utf_8 | 10bc6d2f48ce4d0b74af144a4996ddfa | // { dg-do compile }
// Member function of class template as friend
// Erroneous case: mismatch during specialization
template <class T> struct A {
template <class U> void f(U);
void g();
void h();
void i(int);
template <T t> void j();
};
class C {
int ii; // { dg-error "private" }
template <class U> t... |
google | android | error24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error24.C | 113 | utf_8 | 6c54776e760954055280860b689859b0 | // PR c++/30863
template <typename T>
struct s {};
void f() {
unsigned s<int> x; // { dg-error "invalid" }
}
|
google | android | crash6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash6.C | 199 | utf_8 | 503d2ceca1151ace69073bc94b2e3181 | template <class> struct A { static const int n = 1; } ;
template <int> struct B;
template <class S>
struct restype_order {
static const int s = A<S>::n;
typedef typename B<(s > 0)>::t t;
};
|
google | android | koenig10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/koenig10.C | 181 | utf_8 | d57d3d6b5c4c1d0a3fa0910f3184bb28 | // PR c++/47511
namespace N {
template <typename T> bool g( T ) {
return true;
}
struct A { };
}
template <class T> void f(const T&) {
N::A x;
g(x) ;
}
|
google | android | access16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access16.C | 214 | utf_8 | 2f37ed40bca28851af33f3bafa4181d9 | // PR c++/23842
struct S;
extern S *p;
template <class T> int f(T*, int y = ((T*)p)->x) {
return y;
}
struct S {
private:
int x;
template <class U> friend int f(U*, int);
};
int g() {
return f(p);
}
|
google | android | qualified-id2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualified-id2.C | 934 | utf_8 | 760d233b1e82d77a4e17829a3a0eb589 | // PR c++/44587
// { dg-do run }
template <const char *N> struct A { static const char *p; };
template <const char *N> const char *A<N>::p = N;
template <class T> struct B { static const char c[1]; typedef A<B<T>::c> C; };
template <class T> const char B<T>::c[1] = "";
template <class T> struct D { static const char c... |
google | android | error16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error16.C | 161 | utf_8 | 709638c9b094e580ab80981a248856e2 | // PR c++/18674
template <typename I>
static void g() {
enum I::t a; // { dg-error "" }
(void) a;
}
struct B {
typedef int t;
};
void h()
{
g<B>();
}
|
google | android | vla1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/vla1.C | 126 | utf_8 | 94a0a165b65e3caa1af30d5a45bc1934 | // PR c++/29226
// { dg-options "" }
template <bool>
static int label (int w)
{
sizeof(int[w]);
}
int a = label<false>(1);
|
google | android | type2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/type2.C | 346 | utf_8 | 7bd261d29e895f70198d2995a62cbd35 | // { dg-do compile }
// PR c++/8442
// Type template parameter incorrectly treated as template template
// parameter.
template <typename T> struct A {};
template <typename T> struct B
{
template <typename U> struct C {};
template <typename U> A<C<U> > foo(U);
};
B<void> b; |
google | android | pseudodtor4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pseudodtor4.C | 212 | utf_8 | b2d3a32829fc6808db1b3b6f0e96ef74 | // PR c++/34068
// { dg-do compile }
template <typename> struct A
{
typedef int X;
A () { T (). ~X (); } // { dg-error "there are no arguments to|fpermissive|was not declared in this scope" }
};
A <int> a;
|
google | android | sfinae15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae15.C | 330 | utf_8 | 342781775b0e1a80ce495730cb3c43ce | // PR c++/40944
// { dg-do run { target c++11 } }
template<typename T>
struct make { static T&& it(); };
void (*pf)(int&) = 0;
template< typename T >
int bar(T const& x,
decltype( pf(make<T const&>::it()) )* = 0 // SFINAE!
) {
return 1;
}
int bar(...) {
return 0;
}
int main() {
return b... |
google | android | sfinae8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae8.C | 7,169 | utf_8 | 6f91239bd167bb9f6b68f4d27c340176 | // DR 339
//
// Test of the use of various boolean binary operators with SFINAE
// Boilerplate helpers
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<typ... |
google | android | error26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error26.C | 148 | utf_8 | 4193d6f584da90f2fe4c2e4cc8ef6c43 | // PR c++/32112
template<typename> struct A;
template<typename T> void foo (A<&T::template i>); // { dg-error "T:: ?template i|mismatch|& T::i" }
|
google | android | access9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access9.C | 401 | utf_8 | 7834be58b513cdde90c14c885e21ae63 | // { dg-do compile }
// Template instantiate during deferred access check
template <void (*)(int)> struct C {
typedef int Y;
};
template <class T> void f(typename T::X) {
}
class A {
typedef int X;
template <class T> friend void f(typename T::X);
};
C<&f<A> >::Y g(int); |
google | android | dependent-name2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dependent-name2.C | 359 | utf_8 | 18d61b100652dfe4816b8b9c6cefa923 | // { dg-do compile }
// PR 10530. Thought a type was dependent.
template <typename T>
struct Foo {
struct Inner {
typedef int type;
};
};
template <typename A> struct Bar {
typedef typename Foo<int>::Inner::type type;
}; |
google | android | crash104 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash104.C | 394 | utf_8 | 1225a54926913e691b51137aef8b5d33 | // PR c++/46046
template <class T>
struct foo
{
template <class U, class V = void>
struct type
{};
template <class V>
struct type<
typename T::template some_type<int>,
V
>
{};
};
template <class T>
class bar
{};
int main()
{
typedef foo<bar<i... |
google | android | new5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new5.C | 138 | utf_8 | 1a15a65a0d144c0881e658ac6436ea42 | // PR c++/27210
template <class foo> class junk {
void bar(int a)
{
unsigned char *c = new unsigned char[a*sizeof(foo)];
}
};
|
google | android | inherit8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/inherit8.C | 215 | utf_8 | 25ec4783042b53fc8562540bbe248d82 | // PR c++/52685
template <typename T>
struct A
{
template <typename U>
struct B : public A <B<U> > // { dg-error "declaration" }
{
struct C : public B<U> // { dg-error "incomplete" }
{
};
};
};
|
google | android | crash73 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash73.C | 184 | utf_8 | b6d335f5ace93b3d4a0fd5d2614a2df2 | // PR c++/34100
// { dg-do compile }
template<typename T> struct A
{
typedef typename T::X Y __attribute__((vector_size(8))); // { dg-error "is not a class, struct" }
};
A<int> a;
|
google | android | ttp4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp4.C | 334 | utf_8 | ab6711e26bfa413d472fc55475e7cc75 | // { dg-do compile }
// PR c++/6723
// ICE when default template argument contains instantiation of
// template template parameter.
template <typename A, typename B,
template <typename,typename> class Predicate,
bool _matches=Predicate<A,B>::answer>
struct helper { }; |
google | android | member4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/member4.C | 582 | utf_8 | 7f0db13593e12c1671ab63412653ea6c | // { dg-do compile }
// Contributed by Matty T. <mattyt-bugzilla at tpg dot com dot au>
// PR c++/13813 [DR206]: Check semantic constraints of members of
// non-dependent type at instantiation time.
// DR206 explains that this is ill-formed, no diagnostic required. We emit
// a diagnostic instead.
class E;
templ... |
google | android | crash26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash26.C | 240 | utf_8 | c422942e29cb019f6814e83fa47ae512 | // { dg-do compile }
// PR c++/18471: ICE redeclaration of typedef as class template
typedef int X; // { dg-message "previous" }
template<X> struct X {}; // { dg-error "typedef-name" } |
google | android | using6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using6.C | 168 | utf_8 | 6bc8a704452336d9d0ee978fef2a7f60 | namespace foo {
template<typename T>
struct A {};
}
namespace bar {
template<typename T>
struct A {};
}
namespace foo {
using bar::A; // { dg-error "" }
}
|
google | android | typedef5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef5.C | 431 | utf_8 | c216b7fcf0f0612e246302001f5b0d6f | // PR c++/27572
// { dg-do compile }
template<typedef,int> struct A1; // { dg-error "no type|typedef declaration|default argument" }
template<typedef x,int> struct A2; // { dg-error "type|typedef declaration|default argument" }
template<typedef x[],int> struct A3; // { dg-error "no type|typedef declarat... |
google | android | ref3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ref3.C | 209 | utf_8 | 3fe7102cd5d7b48abace464974ca16c3 | // PR c++/28341
template<const int&> struct A {};
template<typename T> struct B
{
A<(T)0> b; // { dg-error "constant|not a valid" }
A<T(0)> a; // { dg-error "constant|not a valid" }
};
B<const int&> b;
|
google | android | assign1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/assign1.C | 145 | utf_8 | 63a5e3d5f634ef4eb13aa4a9d62a8cd7 | // PR c++/16623
template <int N>
struct C
{
C& operator= (int);
};
template <int N>
C<N>& C<N>::operator= (int)
{
return *this;
}
C<0> a;
|
google | android | init5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init5.C | 277 | utf_8 | ca8434716aafffaf7e37a7ea8e094cc5 | template<typename T> bool foo()
{
const int i = T();
return i > 0;
} |
google | android | partial12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial12.C | 681 | utf_8 | de5b350b4a291d22a6e427de9a0c69fc | // PR c++/46105
template< typename T >
struct empty { // support class is like stripped-down enable_if
typedef void type;
};
template< class T, typename v = void > // v is always void!
struct element {
typedef typename T::value_type type;
};
template< class T > // T in deduced context, T::element_type is SFI... |
google | android | friend45 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend45.C | 240 | utf_8 | e3a0414fe5ccc0a10aa6656eadd87cec | // PR c++/28025
class BaseSubmit
{
template<class T> friend class PeriodicSubmit;
};
template<class ID>
class ValuesSubmit
{
template<class T> friend class PeriodicSubmit;
};
class A;
class MultiSubmit : public ValuesSubmit<A>
{
};
|
google | android | static25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static25.C | 143 | utf_8 | 7b985567967838ede5e338abace5eafc | // PR c++/27819
struct A
{
static const char i = 1;
};
template<int> struct B
{
static const int j = A::i;
int x[int(j)];
};
B<0> b;
|
google | android | void4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void4.C | 187 | utf_8 | f52ef262006018fae2f9121ca966abcd | //PR c++/28638
template<void> struct A; // { dg-error "not a valid type" }
template<template<int> class> struct B {};
B<A> b; // { dg-error "template|invalid type" }
|
google | android | error21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error21.C | 244 | utf_8 | d8c534ccbad9bbbc650685d274b0d2ca | // PR c++/20173
template<typename AT>
struct A{
template<typename T>
void function(T){}
};
template<>
template<typename T>
void A<int>::function(T){}
template<>
template<typename T>
void A<double>::function(T*){} // { dg-error "match" }
|
google | android | new3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new3.C | 333 | utf_8 | e803384df62d31ef9dc9c4a9a02c1eff | extern void *operator new(__SIZE_TYPE__); // { dg-message "note" }
template <class T >
struct C
{
void f() {
int* node;
new (&node) int(0); // { dg-error "new" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
};
void* operator new(__SIZE_TYPE__, void* __p);
void g() {
C<int> c;... |
google | android | canon-type-12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-12.C | 212 | utf_8 | aa7133ad1bbd90029e808f551c0b104d | // { dg-do compile { target c++11 } }
template<class T, T t = (T)0>
struct S
{
void
foo(decltype(t) = t);
};
template<class T, T t>
void
S<T, t>::foo(decltype(t))
{
}
void
bar()
{
S<int> s;
s.foo();
}
|
google | android | enum5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/enum5.C | 311 | utf_8 | 109e68e063340fe9a814b152f4df9eb3 | // { dg-do compile }
// PR c++/14479: Template header check for enum
template <int dim>
struct X {
enum { dimension = dim };
template<int d> void bar ();
};
template <>
template <>
void X<0>::bar<0> () {} |
google | android | access19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access19.C | 549 | utf_8 | 7e32e40681ed46393d75ffa788dfff19 | /* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
/* { dg-do compile } */
template< class T >
class explicit_t
{
public:
explicit_t( const T& c ): value( c ) { }
operator T&() { return value; }
private:
template< class U >
explicit_t( U t ); /* {... |
google | android | nontype22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype22.C | 226 | utf_8 | 4104efa445f1a5c0a6ea00569a6e73b5 | // PR c++/44629
// The proper mangling is unclear.
template<typename T> int cmp1(T a, T b);
template<typename T, int (*cmp)(T, T) = cmp1> struct A { };
template <typename T> void f (A<T> &);
void g()
{
A<char> a;
f(a);
}
|
google | android | typedef40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef40.C | 247 | utf_8 | 443d701e91eb8625219ca859d1d03f71 | // PR c++/55058
template <typename T>
struct A { };
template <typename T>
struct B {
B(const A<T> T::* p);
typedef A<T> D;
};
template <typename T>
B<T>::B(const D T::* p) { }
struct C {
C() : e() {};
const A<C> e;
};
B<C> g(&C::e);
|
google | android | dtor3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dtor3.C | 130 | utf_8 | c46251d092a454420a2658cd0fcc8c15 | // PR c++/19762
template<int> struct A { ~A(){} }; // { dg-error "" }
template A<>::~A(); // { dg-error "template|declaration" }
|
google | android | memtmpl1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memtmpl1.C | 360 | utf_8 | a028161f345a592e44b9dd2c85780ba8 | // { dg-do compile }
// PR 11347. ICE in tsubst
template <class T> struct T1 {
enum {N};
};
template<class T> struct T2 {
template <class S, bool Z = T1<S>::N + 1> struct B {};
struct C {};
};
T2<int> t;
T2<int>::B<int> s; |
google | android | qualttp20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp20.C | 797 | utf_8 | ef7349a159d60a688d713b38b11fe2b4 | // { dg-do compile }
// { dg-options "-pedantic -pedantic-errors" }
// PR 2645
struct AS
{
typedef void (myT) ();
struct L {};
};
template <typename T> struct B1 : T
{
typedef typename T::L __restrict__ r;// { dg-error "'__restrict__' qualifiers cannot" "" }
typedef typename T::myT __restrict__ p;
// The f... |
google | android | static23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static23.C | 200 | utf_8 | 55ffcdd6cb9d31737ce21132239b5d71 | // PR c++/26266
template<typename> struct A
{
static const int i = 1;
};
template<typename> struct B
{
static const int j = A<char>::i;
static const int k = int(j);
int x[k];
};
B<char> b;
|
google | android | ctor9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor9.C | 153 | utf_8 | 391626574e567f5a13e98f2a2884c8fc | // PR c++/9050, DR 147, 318
struct Y
{
template <typename T> Y (T);
template <typename T> void foo (T);
};
template <> Y::Y<int> (int) { }
|
google | android | conv14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C | 669 | utf_8 | c28b6679b01f4bbe8403c045289d2aef | // PR c++/61647
class XX;
template<typename Container, typename Key>
struct Accessor;
template<typename Container, typename Key, typename KeyStore = Key>
class Variant {
protected:
KeyStore index;
Container state;
public:
Variant(Container st, const Key& i) : index(i), state(st) {}
template<typename... |
google | android | instantiate2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate2.C | 255 | utf_8 | 88e1ec74b340410f99e5bf69122404bd | // { dg-do compile }
// PR c++/2862
// Default function argument and template instantiation.
template <int dim> void f (int=0) {}
template void f<1> (); // { dg-error "not match" } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.