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 | memfriend8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend8.C | 340 | utf_8 | 975bbbbf89c7ed7467afe0db4642b444 | // { dg-do compile }
// PR c++/5369: Member function of class template as friend
template <class T>
struct S
{
int foo () {
return S<int>::bar ();
}
private:
template <class U>
friend int S<U>::foo ();
static int bar () { return 0; }
};
int main ()
{
S<char>().foo ();
} |
google | android | pretty1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pretty1.C | 691 | utf_8 | 04907f98f8eab7c64ced6646f5140346 | // { dg-do run }
// PR 7768 template dtor pretty function wrong
#include <string.h>
static size_t current = 0;
static bool error = false;
static char const *names[] =
{
"X<T>::X() [with T = void]",
"X<T>::~X() [with T = void]",
0
};
void Verify (char const *ptr)
{
error = strcmp (ptr, names[current++]);
}
te... |
google | android | explicit3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit3.C | 499 | utf_8 | 3b0207ca15de6320946949f657d95b9a | // { dg-do compile }
// Failed to spot specialization using a template-id expr
template <int n> class A {};
template <int m> class R {};
template <int n, int x> struct Trait { enum {m = n}; };
template <int n, int x> R<Trait<n,x>::m> f(A<x>);
template <> R<Trait<1,1>::m> f<1>(A<1>) {return R<1>();}
void Baz ()
{
R<Tr... |
google | android | crash67 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash67.C | 91 | utf_8 | 4d18a79ebe27fdc9fc1cfb181d77510d | // PR c++/32561
template<int N, int N> struct A; // { dg-error "redefinition|declared" }
|
google | android | operator8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/operator8.C | 131 | utf_8 | 008f8ee400a759592c959c78c66d11b2 | //PR c++/27494
struct A
{
template<operator+> void foo() {} // { dg-error "identifier|non-function|template arguments" }
};
|
google | android | crash118 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash118.C | 179 | utf_8 | 6c418d187f79d11a3f9864df6523f98c | // PR c++/60383
template<int> struct A
{
template<typename> struct B
{
template<typename T> struct B<T*> {}; // { dg-error "specialization" }
};
};
A<0>::B<char*> b;
|
google | android | init4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init4.C | 326 | utf_8 | e920cba477d63f2866ea0710ce55a2ce | // { dg-do compile }
int f1(char);
template <int t>
void f(void)
{
const char* const suffixes = "plpv";
f1(suffixes[t]);
} |
google | android | crash75 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash75.C | 130 | utf_8 | 3f3886cb6cade0a026bbcff85e44887b | // PR c++/34776
template<typename T> struct A
{
T::X<0> x; // { dg-error "non-template|T::template|base type" }
};
A<int*> a;
|
google | android | subst1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/subst1.C | 549 | utf_8 | 65ffda86719727c560bb58b2ddc37078 | // { dg-do compile }
// PR 7718. ICE.
template <typename OBJECT>
void default_initializer(const OBJECT &) { }
template <typename OBJECT, void init_function(const OBJECT &)>
class cContainer {
public:
template <typename INITIALIZER>
void Add(const INITIALIZER &initializer) {
init_function(initializer);
}
};
... |
google | android | crash111 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash111.C | 116 | utf_8 | f5c17c8c05a6c2d1d6b29054c88125a1 | // PR c++/51398
template<void, int N> struct A // { dg-error "not a valid type" }
{
static const int i = N;
};
|
google | android | friend26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend26.C | 216 | utf_8 | 6013e213776d77767ad0de2ceddba65f | // PR c++/14359
template<typename> struct A {};
template<typename> struct B
{
template<typename T> friend void foo(const A<T>& a, const B&) { a; }
};
void bar()
{
A<void> a;
B<void> b;
foo(a,b);
}
|
google | android | linkage1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/linkage1.C | 475 | utf_8 | 9eed8ce0831bf0313cab105488a8b9f3 | // PR c++/50372
// Test that a template instantiation has the same linkage as its argument.
// { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z3fooIXadL_Z13external_funcvEEEvv" } }
// { dg-final { scan-assembler-not "(weak|glob)\[^\n\]*_Z3fooIXadL_ZL11static_funcvEEEvv" } }
template<void (*fptr)(void)>
void foo() { ... |
google | android | friend3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend3.C | 520 | utf_8 | d4c8a44deef0bfb76c6964c75b741416 | // { dg-do compile }
// PR 775 friend classes with qualified names inside template classes.
struct A
{
struct B {
B () { }
};
};
template <class T>
struct C: A {
friend A::B::B (); // 2.95.2 ICE
friend struct A;
friend struct A::B; // 2.97 error
};
template class C<char>;
template <typename T> class TPL
{... |
google | android | friend8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend8.C | 223 | utf_8 | ceb858e95982ac0af2e9168f31aea229 | template <int N> struct ivector
{
template <int r, int c> friend void
mult_mv ();
};
template struct ivector<3>;
template <int r, int c> void
mult_mv ()
{
c;
}
void get_local_point_pos ()
{
mult_mv<7, 3> ();
}
|
google | android | friend48 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend48.C | 121 | utf_8 | 5087337546b38ddcc68287f9759e1504 | // PR c++/29020
template<int> struct A
{
void foo();
};
struct B
{
template<int N> friend void A<N>::A::foo();
};
|
google | android | void7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void7.C | 184 | utf_8 | 507e9e60c4e8d6cbeaf93b654efa9b91 | //PR c++/28741
template<void> struct A // { dg-error "not a valid type" }
{
static int i;
};
A<0> a; // { dg-error "invalid type|not a valid type" }
|
google | android | dependent-args1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dependent-args1.C | 265 | utf_8 | 3e39818cd75d670c263210d492e83fc2 | // PR c++/27582
// { dg-do compile }
struct A
{
template<int> void foo();
};
template<int N, void (A::*)() = &A::foo<N> > struct B {};
B<int> b; // { dg-error "type/value mismatch|expected a constant|invalid type" }
// { dg-prune-output "could not convert" }
|
google | android | typename5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename5.C | 445 | utf_8 | 657b2e18e1c5bda47ab17e796163c009 | // { dg-do compile }
// PR c++/2513: typename handling when scope is dependent as
// described in DR108.
template <bool flag> struct Select {
typedef int Result;
};
template <template<class> class Pred> struct FindType {
typedef typename Select<true>::Result Result;
};
template <int bits> struct Int {
template<ty... |
google | android | conv10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv10.C | 119 | utf_8 | 2c3b429768e3e6f954114fbd126e3122 | // PR c++/41994
template<typename T> struct A
{
operator T();
A() { T (A::*f)() = &A::operator T; }
};
A<int> a;
|
google | android | error13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error13.C | 113 | utf_8 | 23d1d88880eac44a4f6c4209f4d1c9c0 | // PR c++/15227
template<typename> struct A {};
template<typename T> void A<T>::B::foo() {} // { dg-error "" }
|
google | android | sizeof4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof4.C | 319 | utf_8 | 70e0faea5b000e5fbde589a89ad950bd | // { dg-do compile }
// Origin: <anthwil at nortelnetworks dot com>
// c++/4933: using sizeof with comma operator as template argument
template<unsigned F>
struct Foo {};
template<typename T>
T makeT();
template<typename T,typename U>
struct Bar
{
typedef Foo
<
sizeof((makeT<T>(), makeT<U>()))
> Type;
};
|
google | android | crash115 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash115.C | 82 | utf_8 | 4881f59a4fc92a1ba6f12240d924549d | // PR c++/56534
template < struct template rebind < > // { dg-error "expected" }
|
google | android | partial11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial11.C | 793 | utf_8 | 3dc2f7f38ec49323d6044ddb2bc2e191 | // DR 115
// 14.8.1: In contexts where deduction is done and fails, or in contexts
// where deduction is not done, if a template argument list is specified
// and it, along with any default template arguments, identifies a single
// function template specialization, then the template-id is an lvalue for
// the functio... |
google | android | pr54858 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr54858.C | 1,172 | utf_8 | 6465acc359cf71ed791739a364127805 | // PR c++/54858
// { dg-do compile }
template <int> struct A {};
template <typename T, T *> struct B {};
template <typename D> struct C
{
A<0> c0; B<A<0>, &C::c0> d0; // { dg-error "could not convert template argument" }
A<0> c1; B<A<0>, &C::c1> d1; // { dg-error "could not convert template argument" }
A<0> c2; ... |
google | android | mem_func_ptr | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/mem_func_ptr.C | 1,683 | utf_8 | 08ee485d4a84252ae107afcbd8bb4b13 | // { dg-do compile }
template<typename T> struct takes_member_ptr;
template<typename T, typename Klasse> struct takes_member_ptr<T Klasse::*> {};
template<typename T, typename Klasse>
void fun_takes_member_ptr(T Klasse::*) {}
template<typename T> struct order_member_ptrs;
template<typename T, typename Klasse> struct... |
google | android | fnspec1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/fnspec1.C | 389 | utf_8 | 1581f9141ad183d6d31a009275ebf7a4 | // PR c++/35146
template <typename T> struct S {};
template <typename R> struct ref;
template <> struct ref<double> { typedef double result; };
template <typename T>
void foo(typename ref<T>::result, S<T>*);
template <>
void foo(S<double>, S<double>*); // { dg-error "does not match" }
templat... |
google | android | array19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array19.C | 364 | utf_8 | d6ed514093a999f1e4b15b3133a67692 | // PR c++/33553
// { dg-do compile }
template <class T> struct S { static const int sz = 2; };
template <class T> struct U { enum { sz = 2 }; };
template <class R>
struct P
{
template <class T> void bar (int (&x)[S<T>::sz]);
template <class T> void baz (int (&x)[U<T>::sz]);
};
P<int> p;
void
foo (void)
{
int ... |
google | android | memclass5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memclass5.C | 315 | utf_8 | d74cd6350c4311aca6356d1438d12aad | // PR c++/60241
template <typename T>
struct x
{
template <typename U>
struct y
{
typedef T result2;
};
typedef y<int> zy;
};
template<>
template<class T>
struct x<int>::y
{
typedef double result2;
};
int main()
{
x<int>::zy::result2 xxx;
x<int>::y<int>::result2 xxx2;
}
|
google | android | crash112 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash112.C | 247 | utf_8 | cafccb8ed409984b3ee5d4f9079957fa | // PR c++/51370
struct A
{
template<typename> void foo() {}
};
template<void (A::*)()> struct B {};
template<int> struct C
{
B<&A::foo<int int> > b; // { dg-error "declaration|type" }
};
C<0> c;
// { dg-prune-output "could not convert" }
|
google | android | crash4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash4.C | 189 | utf_8 | 4565662b8ea1b02f11db4b1627917693 | namespace NS {
struct C {};
void foo();
}
template <class T> struct X {};
template <class T> struct A {
A() { foo (X<T>()); }
void foo(X<T>);
};
template struct A<NS::C>;
|
google | android | call7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/call7.C | 283 | utf_8 | 4430bc3c331103d5a2ee03d64056e256 | // Origin: PR c++/17395
// { dg-do compile }
template<int> struct X { };
void fu(int a, X<sizeof(a)>) { }
template<class T>
void bhar(T a, X<sizeof(a)>) { }
int
main()
{
int x;
X<sizeof(int)> y;
fu(x, y);
bhar(x, y);
} |
google | android | arrow1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arrow1.C | 336 | utf_8 | 70d28a064929f59e11b32dff9e4de1c5 | // PR c++/49118
// { dg-do compile }
template< int n >
struct a {
a< n+1 >
operator->()
{ return a< n+1 >(); }
};
int main() {
a<0>()->x; // { dg-error "instantiation depth exceeds maximum" }
}
// { dg-prune-output "incomplete type" }
// { dg-prune-output "declaration of" }
// { dg-prune-output "used but n... |
google | android | pr28284 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr28284.C | 242 | utf_8 | 10a1cc60b3d92d61e1b34b9ac481d289 | /* { dg-do compile } */
template<int> struct A
{
static const int i=x; /* { dg-error "was not declared in this scope" } */
static const int j, k;
};
template<int N> const int A<N>::j = i;
template<int N> const int A<N>::k = j;
A<0> a;
|
google | android | operator7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/operator7.C | 142 | utf_8 | 98c4cd89cdbe74a78e512f93f452daa8 | //PR c++/27493
// { dg-options "-std=gnu++98" }
template<operator T> void foo() // { dg-error "before|template" }
{
struct A {};
}
|
google | android | union1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/union1.C | 294 | utf_8 | b60b7ba97d84900a03ad818e8de4f60d | // { dg-do run }
extern "C" void abort ();
void g (char c)
{
if (c != 'a')
abort ();
}
void h (int i)
{
if (i != 3)
abort ();
}
template <typename T> void f(T const &t)
{
union { char c; T t_; };
c = 'a';
t_ = 3;
h (t_);
}
int main () {
f (3);
} |
google | android | crash10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash10.C | 355 | utf_8 | 245c3c3a69c27117dfcc4b6588677c7d | //PR c++/11432
// The mainline ICE on this one between 2003-01-16 and 2003-07-29.
// { dg-do compile }
extern "C" void abort();
template <int A>
struct a
{
static int const value = A - 1;
};
template <int B>
struct b
{
static int foo()
{
return a<L>::value;
}
static int const L = a<B + 1>::valu... |
google | android | decl1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/decl1.C | 215 | utf_8 | 140909eaa0a4dfe8770e4810e92571cc | // PR c++/3882
// Verify that variable initialization can be
// self-referencing inside a template function.
int foo(int);
template <typename T>
void bar(const T&)
{
int i = foo(i);
}
void quus()
{
bar(0);
}
|
google | android | access18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access18.C | 391 | utf_8 | 913e0afca93ad603d70132a5830f11c1 | // DR 401
class X {
typedef int a; // { dg-error "private" }
static const int b = 5; // { dg-error "private" }
template <typename>
struct c; // { dg-error "private" }
};
template <typename = X::a> // { dg-error "context" }
struct A;
template <int = X::b> // { dg-error "context" }
struct B;
template <templat... |
google | android | friend50 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend50.C | 157 | utf_8 | 111cbc72ece5729acf873d2dfae640fd | // PR c++/34399
template<int> struct X
{
void foo();
};
struct Y {
template<long N> friend void X<N>::X::foo(); // { dg-error "declared as friend" }
};
|
google | android | non-dependent2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent2.C | 314 | utf_8 | 3ce6c8331c1ddbc56b2c89ca07992343 | //PR c++/11070
// Used to ICE
template <bool b> struct X {
template <typename T>
static int* execute(int* x) { return x; }
};
template <typename T> void foo() {
static bool const same = true;
X<same>::execute<int> (0);
}
template void foo<int> (); |
google | android | qualttp11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp11.C | 328 | utf_8 | 07ba931fb2075a068c2bb8f171d57bb1 | // { dg-do link }
struct A
{
template <class T> class B {};
};
template <template <class> class TT> struct X
{
TT<int> y;
};
template <class T> struct C
{
X<T::template B> x;
};
int main()
{
C<A> c;
} |
google | android | dtor7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dtor7.C | 277 | utf_8 | 4a814bc6794f74cc5cd4043a45a39370 | // PR c++/40373
// { dg-do compile }
struct A;
namespace
{
struct A;
}
struct B {};
template <typename T> void
foo (T t)
{
t.~A (); // { dg-error "does not match destructor name" }
}
void
bar ()
{
foo (B ()); // { dg-bogus "required from here" "" { xfail *-*-* } }
}
|
google | android | condition1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/condition1.C | 1,678 | utf_8 | a209321f63c77720a21e8e36115c2095 | // PR c++/47950
template <typename T> struct empty
{
// allow success case to build (not relevant to bug)
operator bool() { return true; }
};
template <typename T> struct from_int
{
from_int(int) {}
// allow success case to build (not relevant to bug)
operator bool() { return true; }
};
template <typ... |
google | android | init3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init3.C | 157 | utf_8 | 64314d0aa5b3600547adc69b42ab8e3c | // PR c++/11027
template <class T>
struct X {
typedef void (X::*pfun)();
static pfun p[];
};
template <class T>
typename X<T>::pfun X<T>::p[] = {};
|
google | android | template-id-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/template-id-3.C | 286 | utf_8 | e93f073f61a42e3c7ad372625dbf5491 | // PR c++/48261
typedef double (*gaddType)(double,double);
struct Foo2
{
static gaddType add;
};
template<typename T>
struct Something
{
void work()
{
double x=T::template add<double>(5.0,6.0); // { dg-error "add" }
}
};
int main()
{
Something<Foo2> s2;
s2.work();
}
|
google | android | typename1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename1.C | 153 | utf_8 | 5608e09eb5e126cbf511d7b99a577ef4 | // { dg-do compile }
template <class T>
class B : virtual T::A
{
typedef int INT;
INT i;
}; |
google | android | typedef25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef25.C | 706 | utf_8 | 17826cf2d65f1a8f6b523f5063e08389 | // Origin PR c++/42225
// { dg-do compile { target c++11 } }
template<class T>
struct A
{
typedef T I;
static const char *i;
};
template<class T, int>
struct B
{
typedef T TT;
typedef decltype(TT::i) TT_I0;
typedef decltype(&TT::i) TT_I1;
typedef decltype(*TT::i) TT_I2;
typedef A<TT_I0> TA0... |
google | android | arrow2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arrow2.C | 110 | utf_8 | 588bddbb18429763190474bb78d16fb3 | // PR c++/56639
struct A {
int i;
static A* f();
};
struct B {
void g() {
int (A::f()->i);
}
};
|
google | android | explicit4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit4.C | 448 | utf_8 | 3f7c086b1b4dd5261f5ced979a21b04b | // { dg-do compile }
// Failed to spot specialization using a template-id expr
template <typename n> class A {};
template <int m> class R {};
template <int n, int x> struct Trait { enum {m = n}; };
template <typename n, typename x> R<Trait<1,1>::m> f(A<x>);
template <> R<Trait<1,1>::m> f<int>(A<int>) {return R<1>();} |
google | android | friend31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend31.C | 587 | utf_8 | ca5a98ee9de24f0adf4f6d6da6ea4315 | // { dg-do compile }
// PR c++/15410: Declaration of friend class template with wrong
// template parameter.
template <typename T, typename U> struct F; // { dg-message "previous declaration" }
class W
{
template<int i> friend class F; // { dg-error "template parameter" }
int x; // { ... |
google | android | friend55 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend55.C | 281 | utf_8 | 07661870136ab56610aa2148517efa11 | // PR c++/59956
template <int I> struct A;
template <int I> class B {
int i;
template <int A_S> friend void A<A_S>::impl();
};
B<0> b1;
template<int I>struct A { void impl(); };
B<1> b2;
template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }
int main()
{
A<0>().impl();
}
|
google | android | crash93 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash93.C | 136 | utf_8 | 6ce63664012487deb9533d83bc1200a8 | // PR c++/40371
struct A
{
typedef void (&F)();
template<int> operator F();
};
void foo()
{
A()(); // { dg-error "no match" }
}
|
google | android | scope2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/scope2.C | 530 | utf_8 | 1ffed1eba156ff05925971c1bb91cd3d | // { dg-do compile }
// checked required bases in wrong scope.
class Helper {};
template<class T> struct X { };
template<class T> class Base
{
protected:
typedef Helper H;
};
template<class T >
struct Derived : Base<T>
{
typedef Base<T> Parent;
typedef typename Parent::H H;
class Nested : public X<H> {};
... |
google | android | crash66 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash66.C | 389 | utf_8 | e29b7df66408269c2eaea4100f6227cf | // PR c++/29535
// { dg-do compile }
template <class INDEX> struct SetRegion2D
{
struct FloodFillControl
{
struct Allocator{};
};
};
template <int DIM, class PIXELINDEX>
struct MotionSearcher
{
typedef SetRegion2D<PIXELINDEX> Region_t;
MotionSearcher (typename Region_t::FloodFillControl::Allocator &a_rAllo... |
google | android | nontype15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype15.C | 289 | utf_8 | e4e6038ded9c7ed667109894758cea89 | struct foo {
typedef int (*fun)(int);
static int f(int); // overload between static & non-static
int f();
static int g(int); // non-overloaded static
};
template<foo::fun>
struct f_obj {
// something ..
};
int foo::f() {
f_obj<f> f1;
f_obj<g> f2;
return 0;
}
|
google | android | crash76 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash76.C | 167 | utf_8 | f1a8c42b37d318db77076e2f45ccbce5 | // PR c++/34486
template<typename> struct A
{
typedef A* X;
};
template<typename T> struct B
{
using A<T>::X::Y; // { dg-error "not a base type" }
};
B<int> b;
|
google | android | ttp24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp24.C | 116 | utf_8 | 23d3457f42057bd9e65058bbe00e779f | // PR c++/30897
template<template <typename T, typename = T > class U> struct A
{
template<int> U<int> foo();
};
|
google | android | access13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access13.C | 332 | utf_8 | 76f5c8b19b7f609c01aedaee827b1931 | // { dg-do compile }
// PR c++/13262: Access checking during instantiation of static data
// member.
template <typename T> class Aclass {
private:
Aclass() {}
static Aclass instance;
};
template <typename T> Aclass<T> Aclass<T>::instance;
template class Aclass<int>; |
google | android | non-type-template-argument-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C | 298 | utf_8 | 30d31ed2484da393d79f5ad4a32e80cf | struct A { static const bool b=false; };
struct B { typedef A X; };
template <bool> struct C {};
template <typename T> struct D
{
C<T::X> c; // { dg-error "parsed as a non-type|if a type is meant" }
};
D<B> d; // { dg-message "required from here" }
|
google | android | error41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error41.C | 170 | utf_8 | 69ccae3809305b08d23a96a1e4730072 | // PR c++/40370
// { dg-do compile }
struct A
{
static int i;
};
template <int> struct B
{
int x[A::i]; // { dg-error "array bound is not an integer constant" }
};
|
google | android | sfinae9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae9.C | 7,906 | utf_8 | a9f3ce4ee662be853b285ba58e2dfe52 | // DR 339
//
// Test of the use of various assignment 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<typenam... |
google | android | decl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/decl2.C | 207 | utf_8 | 05e0d875681f42cc0eb951378ac07bd0 | // PR c++/16162
template <int N> struct O {
struct I {
template <typename T> struct II {
void f();
};
};
};
template <int N>
template <typename T>
void O<N>::I::II<T>::f () {}
|
google | android | defarg1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg1.C | 100 | utf_8 | e56cdb80a6b4148add333d45d0d83d9a | struct Outer {
template <int I, int J=I> struct Inner {};
};
void f() {
Outer::Inner<2> i;
}
|
google | android | incomplete1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/incomplete1.C | 533 | utf_8 | 43017cf348a37638085196f74ac68fe3 | // { dg-do compile }
// Origin: Ivan Godard <igodard at pacbell dot net>
// PR c++/17447: Detect parameters of dependent types even in templates
struct B; // { dg-error "forward declaration" }
template<typename T> struct A {
friend A& operator <<(A& a, B b) { return a; } // { dg-error "incomplete" }
friend ... |
google | android | typename9 | .C | toolchain/gcc/gcc-4.9/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.9/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.9/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.9/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.9/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.9/gcc/testsuite/g++.dg/template/dependent-expr8.C | 220 | utf_8 | 4737236e0209f156af2f579c8f812df3 | // Origin PR c++/48574
// { dg-do compile { target c++11 } }
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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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 | error53 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error53.C | 243 | utf_8 | 33c0775ff95272c8b33b372852b68a84 | // PR c++/57638
template<int x>
struct S {};
template<long long i>
void g(S<i>);
void f()
{
S<1000> t;
g(t); // { dg-error "no matching" }
} // { dg-message "mismatched types 'long long int' and 'int'" "" { target *-*-* } 12 }
|
google | android | array3 | .C | toolchain/gcc/gcc-4.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/gcc/testsuite/g++.dg/template/crash95.C | 214 | utf_8 | 48613c9685760a1851864e5684e9ef37 | // 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 "no matching" }
|
google | android | partial5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial5.C | 467 | utf_8 | 2028ee429fa76361e64f0f87875d394b | // PR c++/33964
template<typename T>
struct X { };
template<typename T>
struct X<typename T::foo> { }; // { dg-error "not deducible|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 d... |
google | android | error49 | .C | toolchain/gcc/gcc-4.9/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;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.