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 | typename9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typename9.C | 341 | utf_8 | 951143bd9928716b4f5d4f181539733a | // { dg-do compile }
template <class T>
struct tree {
struct iterator;
struct sibling_iterator {
friend struct tree<T>::iterator;
};
}; |
google | android | access7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access7.C | 315 | utf_8 | 4b71501200156d615a44e90d01e250d8 | // { dg-do compile }
// PR c++/3663
// Enforce access of nested type.
template <typename A>
class S {
class T {}; // { dg-error "private" }
};
template <typename A>
typename A::T* f (A) { // { dg-error "this context" }
return 0;
}
void g () {
f (S<int> ()); // { dg-message "required|no match" }
}
|
google | android | typedef12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef12.C | 351 | utf_8 | f9454605af8eaba210ba4230a78b4665 | // { dg-do compile }
class A
{
protected:
typedef int mytype;
};
template <class T> class B;
class C: public A
{
template <class T> friend class B;
};
template <class T> class B
{
C::mytype mem;
};
B<int> b; |
google | android | member5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member5.C | 803 | utf_8 | 049a5c6869f8d2fb92add9a98a984a86 | // { dg-do compile }
// Contributed by: <fasbjx at free dot fr>
// PR c++/14389: Disambiguate overloaded member templates which differ only
// in the template argument list.
namespace N1 {
struct S {
template< typename B, typename A > void foo();
template< typename A > void foo();
};
templa... |
google | android | error17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error17.C | 194 | utf_8 | 8e17e210a679a93a0f4f89a7a8f86e17 | // PR c++/20153
template <typename T>
void
foo()
{
union { struct { }; }; // { dg-error "prohibits anonymous struct" "anon" }
// { dg-error "not inside" "not inside" { target *-*-* } 7 }
}
|
google | android | dependent-expr8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-expr8.C | 234 | utf_8 | 0ade4127acffdc0e663f612bf4d1cb93 | // Origin PR c++/48574
// { dg-options "-std=c++0x" }
// { dg-do compile }
struct A
{
virtual int foo();
};
void baz (int);
template <typename T>
void
bar(T x)
{
A &b = *x;
baz (b.foo ());
}
void
foo()
{
A a;
bar(&a);
}
|
google | android | memfriend6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memfriend6.C | 856 | utf_8 | 1e93d7f7d38f19d9cc623f9113275868 | // { dg-do compile }
// Member function of class template as friend
// Erroneous case: mismatch during declaration
template <class T> struct A {
template <class U> void f(U); // { dg-error "candidate" }
void g(); // { dg-error "candidate|with" }
void h(); // { dg-error "candidate|with" }
void i(int); ... |
google | android | defarg14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg14.C | 221 | utf_8 | 39dfbed6c435f055642bb036d93a802b | // PR c++/46129
// The default argument for A<int>::B::operator() should not be required
template <class T>
struct A {
struct B {
void operator () (const T& d_ = f(T()) ) { }
};
};
int main() {
A<int>::B b;
}
|
google | android | spec17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec17.C | 182 | utf_8 | 3aa4f9ac6e238807a3c568af3718bf62 | // PR c++/16224
namespace io {
template <typename> int foo(); // { dg-error "" }
}
using namespace io;
template<> int foo<int>(); // { dg-error "" }
int a = foo<int>();
|
google | android | sizeof-template-argument | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof-template-argument.C | 441 | utf_8 | f23ba0af1fed6ed0d84fb59d38cc32a2 | /* This used to ICE (PR c++/29573) */
/* { dg-do compile } */
template<int> struct A {};
template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "template argument" } */
template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "template argument" } */
int a;
template<typename> struct D : A <sizeof(a=1)>... |
google | android | defarg2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg2.C | 127 | utf_8 | 21ce3e77355010aaab1b59936da8bfbb | struct X {
X ();
};
template <int> struct O {
struct I {
I (const X & = X());
};
};
template struct O<2>;
|
google | android | ptrmem5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem5.C | 449 | utf_8 | c1d71028a4f69f5c3fcfd2fd8a35f919 | // { dg-do compile }
// PR 10119 (part). We failed to tsubst the args of a template-id-expr
template <class T, void (T::* const U)()> struct Good
{
static int const value = 0;
};
struct A
{
template <typename U> void good ()
{
int s_id = Good<A, &A::good<U> >::value;
}
};
int main()
{
A().good<int>();
} |
google | android | ptrmem14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem14.C | 126 | utf_8 | 372af7481dbb814fd59792b6160a671e | // PR c++/15875
struct A
{
void foo();
};
template<int> void bar()
{
typedef void (A::*fptr)();
fptr ptr = &A::foo;
}
|
google | android | friend47 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend47.C | 131 | utf_8 | b4e412d8986f5c28376eafc85c4b56e2 | // PR c++/19809
template<int i>
struct n{
friend void foo(){ } // { dg-error "defin" }
};
int main(){
n<1> n1;
n<2> n2;
}
|
google | android | sfinae4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae4.C | 862 | utf_8 | 14c823d80f9e1e49b0085a00aa357406 | // DR 339
//
// Test of the use of free functions with SFINAE
void foo(int) { }
template<typename T> void foo(T*) { }
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_... |
google | android | anon1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/anon1.C | 271 | utf_8 | 0badf7e9336f7d06bd6b5e8cad37e171 | struct x {
int foo () {}
};
template <class T>
struct vector {
T& bar () {}
};
template <class T>
struct y {
typedef struct {
x t;
} s;
vector<s> array;
int foo ()
{ return array.bar().t.foo(); }
};
int i = y<x>().foo ();
|
google | android | crash92 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash92.C | 245 | utf_8 | e7ff2129d4e25ee3b9f96c6b85e5ebc9 | // PR c++/42055
template<typename T> void foo(T, T); // { dg-message "candidates|template" }
template<typename T> void foo(T, int); // { dg-message "template" }
template void foo(int, int); // { dg-error "ambiguous template specialization" }
|
google | android | spec20 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec20.C | 387 | utf_8 | ed4d5e577ced48d91b3a5054ba58d4c5 | // Bug 19203: Failure to implement DR 214
template <class A>
void foo(const A& a);
template <class RET, class ARG1>
int foo(RET (&)(ARG1)); // this one
float decl(int);
int bar(void)
{
return foo(decl);
} |
google | android | static6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static6.C | 197 | utf_8 | 40796a2389c81fb63a7c826d2e3a06af | // PR c++/13969
struct B {
static const int N=10;
};
template <int> struct X {};
template <typename> struct S {
static const int N = B::N;
X<N> x;
};
template class S<float>;
|
google | android | lookup5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/lookup5.C | 230 | utf_8 | 3ab3f4b8b6e13f0c873ee865529608c0 | // PR c++/13925
namespace N {
template <class T> void f(T);
namespace M {
class A {
friend void f<int>(int);
};
}
template <class T> void f(T) {}
template <> void f<int>(int )
{
f<long>(0);
}
}
|
google | android | using27 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using27.C | 385 | utf_8 | cc03adff320bfe4d556ca4c56ce6a4d6 | // PR c++/37140
struct X
{
typedef int nested_type;
};
template <class T>
struct A
{
typedef X type;
};
template <class T>
struct B : A<T>
{
using typename A<T>::type;
typename type::nested_type x;
};
template <class T>
struct C : B<T>
{
using typename B<T>::type;
typename type::nested_type y;
};
stru... |
google | android | member3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member3.C | 355 | utf_8 | 7485d7d4ac0efdee0b9c7fe84580e8a0 | template<typename T>
struct A {
template<typename L> struct SubA { };
template<typename T1,typename L> void f(T1 & t1, SubA<L> & t2) { }
template<typename U> void g(SubA<U> & suba) { }
template<typename U> void h(SubA<U> & suba) { }
};
int main(void) {
int i;
A<int> a;
A<int>::SubA<int> suba;
a.f(i,s... |
google | android | explicit-args5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit-args5.C | 251 | utf_8 | ebbbdf155c7037b83cc023e3e0fdf4e2 | // PR c++/51613
template<typename F, typename T>
void apply(F f, T t)
{
f(t);
}
template<typename T>
void multi(T)
{
}
template<typename T>
void multi(T*)
{
}
int main()
{
apply(&multi<int>, 7); // { dg-error "no match" }
return 0;
}
|
google | android | operator3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/operator3.C | 119 | utf_8 | 51da64bb1a35e2d4a874ecc36ed30236 | // PR c++/15640
struct A {
void foo(void);
};
template <int> void bar() {
A a;
a + a.foo; // { dg-error "" }
}
|
google | android | repo7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/repo7.C | 368 | utf_8 | c0415f4bc7bd91e896315de4d85326fe | // 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 };
template class... |
google | android | array3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array3.C | 342 | utf_8 | 353ce65cd4b47cb87d4a7e33038e372d | // { dg-do compile }
// Origin: Graeme Prentice <gprentice at paradise dot net dot nz>
// PR c++/13474: An array domain which is value-dependent must be folded
// in time for deduction.
template< int X, int Y, int (*array_ptr)[Y] >
class A;
int array[5];
template< int X >
class A<X,5,&array> {};
int main()
{
... |
google | android | new10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/new10.C | 742 | utf_8 | b4688d67c16095e2855630d6bf9633c2 | // PR c++/46658
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
template<class T> class scoped_array {
void reset(T * p = 0) { }
};
typedef uint16_t SequenceIndex;
typedef uint32_t SequenceMapIndex;
class Analyzer {
template <typename READER>
bool ReadDictionary( READER& reader... |
google | android | ttp11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp11.C | 335 | utf_8 | 7bb81c37796ee57799e21215b653e144 | // { dg-do compile }
// PR c++/14429: Matching of template template parameter containing
// non-type parameter with type that depends on earlier parameter.
template <template <typename U, U* p> class T>
struct X {};
template <template <typename U, U* p> class T>
struct Y {
X<T> x;
}; |
google | android | nested1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nested1.C | 326 | utf_8 | 39db6def8c2ae0c295a9f6433ab39375 | /* PR c++/4633 */
/* { dg-do compile } */
// The 'class X' inside the template used to escape (somehow),
// so that the typedef claimed that it was redefining X.
template <typename T> struct S ;
template <> struct S<float>
{
template <class, class> struct R;
template <class X> struct R<X, X> { };
typedef int ... |
google | android | alignof2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/alignof2.C | 181 | utf_8 | c6adc553fe9f9b98d469bd141374ae56 | // PR c++/55337
// { dg-do compile }
template <int> struct A;
template <typename T> struct B
{
static A <__alignof__ (T)> b;
};
template <typename T> A<__alignof__ (T)> B<T>::b;
|
google | android | typename6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typename6.C | 132 | utf_8 | ed39e1b4f163d77da95d420ba783410c | struct O {
template <typename T>
struct I {
I (int);
};
};
template <typename T>
void f() {
typename ::O::I<int>(3);
}
|
google | android | crash99 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash99.C | 204 | utf_8 | 6fb58c8840c31d10b033d3d47d681397 | // PR c++/34491
template<typename> struct A;
template<0> struct A<int> // { dg-error "expected|template|anonymous" }
{
static const int i = 0;
};
int n = A<int>::i; // { dg-error "incomplete type" }
|
google | android | crash95 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash95.C | 218 | utf_8 | 9f8998ef635f3a6acece5f40e91e531e | // PR c++/43705
template < typename > struct S
{
template < > struct S < int > // { dg-error "explicit|specialization|template|parameter" }
{
S(int);
};
};
S < int > s(0); // { dg-error "incomplete type" }
|
google | android | partial5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial5.C | 457 | utf_8 | c22dcd4b931c3e20f660aa27686f9a87 | // PR c++/33964
template<typename T>
struct X { };
template<typename T>
struct X<typename T::foo> { }; // { dg-error "not used|T" }
template<int N>
struct X<int[N]> {}; // okay
template<typename T, typename T::foo V>
struct Y { };
template<typename T, typename U, U v>
struct Y<T, v> { }; // { dg-error "not used|U... |
google | android | error49 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error49.C | 139 | utf_8 | 706afe0e7c07cecb5cbe62412106f6f6 | // PR c++/40405
template<int, int> struct A
{
static int i;
};
template<int> int A<0,0>::i = 0; // { dg-error "" }
int j = A<0,0>::i;
|
google | android | ref5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ref5.C | 193 | utf_8 | 506e5f8f23105cf0257a836058d1806b | // PR c++/35075
template<int&> struct A {};
template<typename T> struct B
{
static const T t;
A<t> a; // { dg-error "reference variable" }
};
B<int&> b; // { dg-message "required" }
|
google | android | init2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/init2.C | 225 | utf_8 | 76f88c13708d18ca711ab8287d1caac9 | // PR c++/9820
template <typename T> struct X {
template<typename> static int test(...);
template<typename> static int test(int *);
static const int i = sizeof(X<T>::template test<int>(0));
};
template class X<int>;
|
google | android | array5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array5.C | 114 | utf_8 | c557bdb58ff52b9fc368185880923627 | // PR c++/15427
template<class T>
struct A
{
T foo;
};
template<class T>
struct B
{
A<int> _squares[2];
};
|
google | android | ptrmem11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem11.C | 342 | utf_8 | 2733fb0b367677a0d0e425dcfc181dd9 | // PR c++/18407
template <typename Klasse>
struct the_base{
template <void (Klasse::*Fn)()> void foo() { }
};
template <typename T>
struct derivedT: the_base<derivedT<T> > {
typedef the_base<derivedT<T> > parent;
void ice(){
this->parent::template foo< &derivedT<T>::ice>();
}
};
int main() {
derivedT<i... |
google | android | array22 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array22.C | 186 | utf_8 | 21e1f968e0203fb50fece892480a4888 | // PR c++/48029
template <class T> struct A { };
template <class T, class U> struct B
{
struct N { };
typedef U u;
};
typedef B<int, A<int>(*)[2]> btype;
A<int> v1[2];
btype v2;
|
google | android | typedef9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef9.C | 823 | utf_8 | 779a641261850a2aeef3d242e02f0a9b | // PR c++/34846
template<typename, typename> struct __are_same { enum { __value = 0 }; };
template<typename _Tp> struct __are_same<_Tp, _Tp> { enum { __value = 1 }; };
template<typename, bool> struct __enable_if { };
template<typename _Tp> struct __enable_if<_Tp, true> { typedef _Tp __type; };
template<typename _Itera... |
google | android | stmtexpr2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/stmtexpr2.C | 344 | utf_8 | 5a43e87e10898038576202d6271981c9 | // Origin: PR c++/36408
// { dg-options "" }
// { dg-do compile }
template<int>
void
foo()
{
int i = ({ }); // { dg-error "void value not ignored" }
}
template<int>
void
bar()
{
int i = ({ ({}); }); // { dg-error "void value not ignored" }
}
int
main ()
{
foo<0> ();
bar<0> ();
} |
google | android | using9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using9.C | 359 | utf_8 | 43e4887ef35fe0c5873b07345814a3d3 | // { dg-do compile }
// PR c++/17154: Using declaration in partial class template specialization.
template <int numrows, class T> struct A { void test_A() {} };
template <int numrows, class T> struct B {};
template <class T> struct B <3, T> : public A <3, T> {
using A <3, T>::test_A;
void test_B_spec() { test_A(); }
... |
google | android | error35 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error35.C | 113 | utf_8 | 7b9093b26f8920c628c47bed533cc022 | // PR c++/33494
template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }
|
google | android | crash57 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash57.C | 254 | utf_8 | e8689f24f46b2d103e7556f1cd9fe1e3 | //PR c++/27397
template<int(> struct A; // { dg-error "token" }
template<typename> struct B
{
template<int(> struct C; // { dg-error "token" }
};
A<char> a; // { dg-error "type/value mismatch|constant|declaration" }
|
google | android | offsetof1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/offsetof1.C | 230 | utf_8 | 0278f61baf9894baa55e08be6e4d1217 | // { dg-do compile }
// PR c++/17221
#include <cstddef>
template <int N> struct Bar;
template <> struct Bar<3> {};
template <class T>
struct Foo {
Bar<offsetof(T, a) + 3> k;
};
struct A { int a; };
template struct Foo<A>;
|
google | android | ttp1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp1.C | 179 | utf_8 | 016674e9e056bbda052e457c8bf91720 | // { dg-do compile }
template <template <typename T> class A >
class B : virtual A<void>
{
typedef int INT;
INT i;
}; |
google | android | overload10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/overload10.C | 249 | utf_8 | 2e506fd9260fa2ce41127628f924466d | // PR c++40342
template <typename T1, typename T2> int f(T1 *, const T2 *); // { dg-message "" }
template <typename T1, typename T2> int f(const T1 *, T2 *); // { dg-message "" }
int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" }
|
google | android | dependent-name3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-name3.C | 333 | utf_8 | 0c3e325271a377838c5d47bb6fb94dd1 | // { dg-do compile }
// Dependent arrays of invalid size generate appropriate error messages
template<int I> struct A
{
static const int zero = 0;
static const int minus_one = -1;
};
template<int N> struct B
{
int x[A<N>::zero]; // { dg-error "zero" }
int y[A<N>::minus_one]; // { dg-error "negative" }... |
google | android | overload6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/overload6.C | 449 | utf_8 | 7f57829f71261be5d8d5dd5abd19860a | template<typename T> void unique(T,T); // { dg-message "note" }
struct A
{
int begin();
};
template<int> void foo()
{
unique(A().begin); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
} |
google | android | cond3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/cond3.C | 230 | utf_8 | 3dfcddf50f883d0eabd3e0a6a6f3be44 | // PR c++/13833
struct X {
template <typename T>
X & operator << (const T &t);
X & operator<< (int& (*p) (int&));
};
X x;
template <int> void foo () {
x << (1 ? "ok" : "failed");
}
template void foo<1>();
|
google | android | dr408 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dr408.C | 705 | utf_8 | 5df8658381333f348754c7590f128994 | // DR 408
// { dg-do link }
// Test that a size given in the out-of-class definition isn't used until
// instantiation time.
template<typename T>
struct X
{
static char s[];
int c;
};
template<typename T>
char X<T>::s[sizeof(X<T>)];
#define sassert(EXP) int ar[(EXP)?1:-1]
sassert(sizeof (X<char>::s) == sizeof (i... |
google | android | expr1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/expr1.C | 184 | utf_8 | d9a08dd82988a25d2840d767d582837f | // PR c++/18161
// { dg-options "" }
template <class T> struct Y;
template <> struct Y<bool> {};
template <typename T = typeof (1 == 1)> struct X { Y<T> a; };
template struct X <>;
|
google | android | typeid-template-argument | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typeid-template-argument.C | 202 | utf_8 | c8309bdff0cfda521b4e7ea53eaf9126 | // This used to ICE (PR28420)
// { dg-do compile }
template<int> struct A;
int i = sizeof(A<typeid>); // { dg-error "operator cannot appear in a constant-expression|template argument 1 is invalid" }
|
google | android | array14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array14.C | 133 | utf_8 | 00d9cd9feffed8cd62a0330e5742bbb9 | // PR c++/23993
const int data[2][4] = {
{ 0, 1, 2, 3 }
};
template <typename T>
void t(int k) {
int candidate = data[1][k];
}
|
google | android | qualttp7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp7.C | 322 | utf_8 | 3efab71e896874774c80630cb0888d5a | // { dg-do compile }
template <template <class> class TT> class C {
};
template <class T> struct D {
C<T::template B> c; // { dg-error "no class template" }
};
D<int> d; // { dg-message "required" } |
google | android | crash79 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash79.C | 148 | utf_8 | fbd484dabcedafb4f6a55188390fd076 | // PR c++/36404
struct A
{
A(int);
template<int> enum { e }; // { dg-error "template|expected" }
};
A a(A::e); // { dg-error "not a member" }
|
google | android | meminit2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/meminit2.C | 694 | utf_8 | 49a8526a10802f5f264eca9873b6546a | // { dg-do compile }
// Origin: Mark Anders <mark dot a dot anders at intel dot com>
// PR c++/15503: disambiguators in base classes and mem-initializers
template <typename K1> struct O {
template <typename K2> struct I {};
};
template <typename T>
struct A : typename O<T>::template I<int> { // { dg-error "k... |
google | android | conv3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/conv3.C | 663 | utf_8 | be5017725e9889a47d07ba0d3a3464ff | // { dg-do run }
// PR 4361. Template conversion operators were not overloaded.
template <typename T> struct C
{
operator T ()
{
return 0;
}
template <typename T2> operator T2 ()
{
return 1;
}
int Foo ()
{
return operator T ();
}
template <typename T2> int Baz ()
{
return static_c... |
google | android | ptrmem13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem13.C | 121 | utf_8 | 97ddc530a1bd61b06c131cfdf61adbec | // PR c++/20734
struct A;
void blah(int A::*);
struct A{
int a;
};
template<typename T>
void hoho(){
blah(&A::a);
}
|
google | android | memclass1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memclass1.C | 386 | utf_8 | 8dca5b65d4eeaa3cbfa61a1861a850d2 | // { dg-do compile }
// PR c++/10555: ICE for member class template when one of the
// template argument levels contains errors.
template <typename> struct A
{
template <typename> struct B;
};
template <typename T> struct C
{
typedef typename A<T>::template B<U> X; // { dg-error "declared|invalid" }
};
C<void> ... |
google | android | error47 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error47.C | 235 | utf_8 | ef2ec17333cebad645145429d47e3b4f | // PR c++/51367
template<typename T> void foo(T, T); // { dg-message "template" }
void bar(void* p)
{
foo(0, p); // { dg-error "no matching" }
}
// { dg-message "candidate|parameter 'T' ('int' and 'void*')" "" { target *-*-* } 7 }
|
google | android | friend29 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend29.C | 184 | utf_8 | a0d74e429e0416fe8fd207b1ee020c7a | // PR c++/15701
template<template<int> class T> struct A : T<0>
{
void foo();
template<template<int> class U> friend void A<U>::foo();
};
template<int> struct B {};
A<B> a;
|
google | android | crash12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash12.C | 293 | utf_8 | 627140de004634696fc53c98684c31c2 | // { dg-do compile }
// PR c++/12495: ICE looking up class template in local class.
template <typename> struct A {};
template <typename T> void foo()
{
struct B
{
B (const A<T>&);
};
} |
google | android | nontype17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype17.C | 121 | utf_8 | 6938006fe193f5813dbc894a73ef554f | // PR c++/35282
template<int> struct A
{
template<int> void foo();
};
template<> template<int> void A<0>::foo() {}
|
google | android | array4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array4.C | 146 | utf_8 | 3904f7cfd18135b5f8ef1dbb020648fc | // PR c++/14122
extern const char str[];
template <const char* P>
struct A
{
template <const char* R> void foo();
};
template class A<str>;
|
google | android | sizeof9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof9.C | 171 | utf_8 | 12df473d69cf94653ec8c2821cfe853f | // PR c++/21025
template<int N> struct X { char x[N]; };
template<typename T> X<1 + sizeof(T) - sizeof(T)> F(T const &);
template<int N> struct S { int d() { F(1); } };
|
google | android | static26 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static26.C | 249 | utf_8 | 2bfba281dfdf39292b16309d13ce403d | // PR c++/28016
// { dg-final { scan-assembler-not "computed" } }
template<class T1, class T2>
struct scalar_divides_assign {
static const bool computed ;
};
template<class T1, class T2>
const bool scalar_divides_assign<T1,T2>::computed = true;
|
google | android | ptrmem4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem4.C | 403 | utf_8 | 730a9854e0dabd1a65dcfa256defbcf2 | // { dg-do compile }
// PR c++/8849
// Pointer to member function template argument deduction ICE.
template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "queryAliases|no known conversion" }
struct SpyExample
{
void ready();
void inputs();
};
void SpyExample::ready()
{
queryAliases(inputs); // { ... |
google | android | ttp25 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp25.C | 993 | utf_8 | eacf697cb9c3929c2c1cb6331f9ea409 | // { dg-do compile }
template<typename T, template<T> class C>
void f1(T, C<5>); // { dg-message "note" }
template<typename T, template<T> class C>
void f2(C<5>, T);
template<typename T, template<T> class C>
void f3(C<5>, T); // { dg-message "note" }
template<typename T> struct metafun { typedef T type; };
templa... |
google | android | access3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access3.C | 305 | utf_8 | bb203818faa22dcb1d2c8ada7ef4ec82 | // { dg-do compile }
// PR c++/5387
// Enforcing access of typename type.
template <class T> struct A {
typename T::template X<int> x; // { dg-error "this context" }
};
class B {
template <class T> class X {}; // { dg-error "private" }
};
int main()
{
A<B> ab; // { dg-message "required" }
}
|
google | android | crash55 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash55.C | 219 | utf_8 | 76422d9ef3fa61436a0439bfaab2d350 | //PR c++/27668
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
struct A {};
template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
|
google | android | static33 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static33.C | 252 | utf_8 | be10cab7b5da25690bdabe2a885d3ae2 | // PR c++/52688
// { dg-do link }
template<typename T>
T f()
{
static const double staticLocalVariable = 100.0;
struct local
{
static double f() { return staticLocalVariable; }
};
return T(local::f());
}
int main()
{
f<double>();
}
|
google | android | crash88 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash88.C | 84 | utf_8 | 59238bcb93582e024a0c5cb12c7ab7e1 | // PR c++/34397
template<typename T, int = T()[0]> struct A
{
typedef A<T> B;
};
|
google | android | using2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using2.C | 501 | utf_8 | 39ab7cfa3b77ae21d0f7e2140e1bc6f7 | // { dg-do compile }
// PR 9447. Using decls in template classes.
template <class T>
struct Foo {
int i;
};
struct Baz
{
int i;
};
template <class T>
struct Bar : public Foo<T>, Baz
{
using Foo<T>::i; // { dg-message "previous declaration" }
using Baz::i; // { dg-error "redeclaration" }
int foo () { return i... |
google | android | crash7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash7.C | 434 | utf_8 | 02c633425e2b805230994cdd35d274f1 | // { dg-do compile }
// PR c++/10108: ICE in tsubst_decl for error due to non-existence
// nested type.
template <typename> struct A
{
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
// We currently don't give the "no match" error because we don't add the
// invalid constructor template to TYPE... |
google | android | memtmpl3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memtmpl3.C | 391 | utf_8 | 65b31c49b4254df68b854aca90f1aa6a | // PR c++/33239
struct null_type;
template<typename T1, typename T2>
struct tuple_impl
{
template<typename U>
struct append
{
typedef tuple_impl<U, null_type> type;
};
int data;
};
template<typename T1>
class tuple
: public tuple_impl<T1, null_type>::template append<T1>::type
{
using tuple_impl<T1, ... |
google | android | ttp8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp8.C | 408 | utf_8 | ad156dec50f1d7aecc0ad4207046c838 | // { dg-do compile }
// Contributed by: Niall Douglas <s_gccbugzilla at netprod dot com>
// PR c++/14284: Failure to select specialization
template<typename> struct S;
template<template<class> class> struct I {};
template<class, int> struct Match;
template<template<class> class C>
struct Match<I<C>, 0> {};
... |
google | android | ttp13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp13.C | 376 | utf_8 | dcb32e2136f330749a2276bb4d351b2b | // { dg-do compile }
// PR c++/15664: Template substitution of template template parameter
template <int N> struct S {
template<template<typename> class A>
friend void foo();
};
template<template<typename> class A>
void foo();
template <typename> struct X {};
int main () {
S<1> s;
foo<X>();
... |
google | android | arg3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/arg3.C | 371 | utf_8 | f455d543dc6a4d6f270fe652fcc368e7 | // { dg-do compile }
// PR 10224. Rejected a valid constant argument.
template <bool B> struct X {
struct I {};
};
template <typename T> struct Y {
static const bool selector = true;
typedef typename X<selector>::I helper;
};
Y<int> i; |
google | android | fntype1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/fntype1.C | 392 | utf_8 | c3025665d58f3b1443b5cbb53b5bd0f6 | bool f(int i) { return i != 5; }
template <class X, class P = bool(X)>
struct Traits
{
typedef P type;
};
template <class X, class P = typename Traits<X>::type>
struct S
{
const P& p_;
S( const P& p ) : p_(p) {} // const reference
};
template <class X>
S<X> make_s(const typename Traits<X>::type & p) // const refe... |
google | android | static28 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static28.C | 215 | utf_8 | 3f4fc4769c54c1f623ff36f774008e54 | // PR c++/29518
template< bool C > int assertion_failed( int);
template< class >
struct N
{
static bool const okay = true;
enum {
t = sizeof( assertion_failed<okay>( 0))
};
};
int main()
{
N<int> n;
}
|
google | android | crash32 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash32.C | 204 | utf_8 | b17b6f8116ba3725c4d80f6dcdfb1f41 | // PR c++/19667
struct integral_constant { };
template<typename _Tp>
struct is_function : public integral_constant { };
template<>
struct is_function : public integral_constant { }; // { dg-error "" }
|
google | android | enum1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/enum1.C | 129 | utf_8 | 7c10af58e57cd68a834ce883259ef847 | // PR c++/15554
template <int n> struct T1 { enum { N = 3 }; };
template <int n> struct T2 { enum { N = 3, N1 = T1<N>::N }; };
|
google | android | access15 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access15.C | 328 | utf_8 | fc82819a276388c85441dd10835850d1 | // { dg-do compile }
// Bug 17149: ICE with TEMPLATE_TYPE_PARM
template <class super,
int (super::tdata::*member)() const = &super::tdata::operator()>
struct x {}; |
google | android | void8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/void8.C | 213 | utf_8 | d7375b6b148303af73024b27635ad7cd | //PR c++/28737
template<void> struct A; // { dg-error "not a valid type" }
template<typename> struct B;
template<void N> struct B<A<N> > {}; // { dg-error "not a valid type|declared|invalid" }
|
google | android | error2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error2.C | 655 | utf_8 | f556ed7a64b4803b65cf453e32939515 | // { dg-do compile }
// required from did not indicate the nested class
template<class T> struct X
{
T m; // { dg-error "as type 'void'" "void" }
// { dg-error "incomplete type" "incomplate" { target *-*-* } 10 }
// { dg-error "invalid" "invalid" { target *-*-* } 10 }
};
template<class T >
struct Derived
{
class ... |
google | android | meminit3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/meminit3.C | 224 | utf_8 | 2814897eaaeccebed1436472d893ffd3 | // PR c++/54744
template <typename T>
struct base {
typedef base base_type;
};
template <typename T>
struct derived : base<T> {
typedef typename derived::base_type::base_type base_type;
derived() : base_type() {}
};
|
google | android | non-dependent12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/non-dependent12.C | 259 | utf_8 | c68de3013fc66d5b9ca387b1f0f294ad | template<typename T> void foo(T &t)
{
int i = static_cast<int>(t);
} |
google | android | memfriend16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memfriend16.C | 610 | utf_8 | 589793a48cdfb3f51df2530b2474a85c | // { dg-do compile }
// Nested class of class template as friend
template<class T> struct A
{
template <class U> struct B1
{
};
template <class U> struct B2
{
void f();
};
};
class C {
int i; // { dg-error "private" }
template<class T> template <class U> friend struct A<T>::B1;
};
template<class T> ... |
google | android | sizeof7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof7.C | 337 | utf_8 | 0c4917a1350de8892aea4bca2d593036 | // { dg-do compile }
// PR c++/10858: failure with calling a method inside sizeof in a template
template <int> struct P {};
void bar ();
template <class T> struct X {
static int foo(void (*)());
P<sizeof(foo(&bar))> p;
};
template class X<int>; |
google | android | crash40 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash40.C | 157 | utf_8 | 0e9a3be86c767d4c26ffb432816872ef | // PR c++/22180
struct A {};
template<typename T> void foo()
{
T::~T(); // { dg-error "member" }
}
template void foo<A>(); // { dg-message "required" }
|
google | android | operator2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/operator2.C | 123 | utf_8 | 08eba0ef43fd418e3505a0132a2e9c05 | template <typename T> struct A {};
struct B {
operator A<B>();
};
template <typename T>
void f() { B::operator A<T>; }
|
google | android | non-dependent13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/non-dependent13.C | 146 | utf_8 | 40b38a3d73d53481f9e1570a38ed4eab | // PR c++/26266
template <int I>
struct S;
template <int I>
void f() {
if (const int i = 3) {
S<i>::j; // { dg-error "incomplete" }
}
}
|
google | android | array24 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array24.C | 279 | utf_8 | a1f7515ba86f0bee05a8d1da2482e446 | // PR c++/55032
template<typename T>
struct vec3t {
T c[3];
};
typedef vec3t<float> vec3;
class Bounds {
public:
Bounds(const vec3 bb[2]);
void foo(const vec3 & v) { v.c[0]; }
};
template<typename T>
void work(T& value);
void foo() {
vec3 bb[2];
work(bb);
}
|
google | android | friend36 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend36.C | 413 | utf_8 | 4a3d535a6673c42778883751bb5d71cd | // PR c++/22139
// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
template <int rank, int dim> class Tensor;
template <int rank, int dim> struct SymmetricTensor {
SymmetricTensor (const Tensor<2,dim> &t);
friend void foo();
};
template <> SymmetricTensor<2,2>::SymmetricTensor (const Te... |
google | android | array13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array13.C | 226 | utf_8 | 29ac13549ace1bb08c2a718d6a2f3d31 | // PR c++/20208
// { dg-do run }
// { dg-options "-O2" }
extern "C" void abort();
template <typename T>
inline void *Foo (T arg) { return &arg[0]; }
int main () {
int bry[2];
if (Foo<int[2]>(bry) != bry)
abort();
}
|
google | android | instantiate10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate10.C | 972 | utf_8 | b6f93db83699b516b0d1578a6c9649ac | /* PR c++/39242, xplicit instantiation declaration prohibits implicit
instantiation of non-inline functions. */
/* { dg-do compile } */
/* { dg-options "-O" } */
class Rep {
public:
void unref() const { }
static void unref (const Rep * obj_r) { obj_r->unref(); }
};
template<typename _Tp, typename _Bt = _Tp... |
google | android | qualttp6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp6.C | 335 | utf_8 | b353c34b9ab8c3b3ac91f9acd132ffc6 | // { dg-do compile }
template <template <class> class TT> class C {
};
template <class T> struct D {
C<T::template B> c; // { dg-error "no class template" }
};
struct E {
};
D<E> d; // { dg-message "required" } |
google | android | ref7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ref7.C | 338 | utf_8 | 2928bc911881998ad77feee4157cbfa5 | // PR c++/60274
typedef const char *const& ProtocolIdType;
template <ProtocolIdType protocolId>
struct C {
typedef int ProtocolVersion;
struct D {
ProtocolVersion GetProtocolVersion();
};
};
template <ProtocolIdType protocolId>
typename C<protocolId>::ProtocolVersion C<protocolId>::D::GetProtocolVersion()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.