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 | pr28301 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr28301.C | 239 | utf_8 | d3ba333f92088ba255ebad2bc17cd0cf | // PR c++/28301
// { dg-do compile }
template<typename> struct A
{
template<int> void foo()
}; // { dg-error "initializer" }
template<> struct A<void>
{
template<int> void foo();
};
void bar()
{
A<void> a;
a.foo<0>();
}
|
google | android | error20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error20.C | 88 | utf_8 | c76b01c2f7357d4400cd8e049826cc38 | // PR c++/25439
template<int> struct A;
template<> int A<0>; // { dg-error "invalid" }
|
google | android | error46 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error46.C | 262 | utf_8 | d9a7aa2040681bdfe2554b4abe8205e0 | // PR c++/51230
template<int> struct A {};
template<int N> void foo(A<N>, A<N>); // { dg-message "template" }
void bar()
{
foo(A<0>(), A<1>()); // { dg-error "no matching" }
}
// { dg-message "candidate|parameter 'N' ('0' and '1')" "" { target *-*-* } 9 }
|
google | android | conv9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv9.C | 163 | utf_8 | 8de20cec2491fd7ca8d7d9e44e45478a | // PR c++/28557
struct A
{
template<typename T> operator T() { return T(); }
};
template<int> void foo()
{
A().operator int();
}
void bar()
{
foo<0>();
}
|
google | android | partial2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial2.C | 388 | utf_8 | e2ea27f4d30c89986de472da016881a2 | // { dg-do compile }
// PR c++/11154: Multi-level template argument in partial ordering of
// class template
template <class A> struct Outer {
template <class T, class U = void, class V = void> struct Foo {};
template <class T, class U> struct Foo<T,U,void> {};
template <class T> struct Foo<T,void,void> {};
};... |
google | android | using20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using20.C | 196 | utf_8 | 320afc20e453862a122ac3d0bdda181b | // PR c++/51925
struct E
{
int e ();
};
template <typename T1>
struct G : public E
{
using E::e;
template <int> void e ();
void f () { e <0> (); }
};
int f(void)
{
G<int> a;
a.f();
}
|
google | android | call4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/call4.C | 331 | utf_8 | 865f009ddc0a20c3f776c322940208a1 | // PR c++/25364
class OFX_PropertySuiteV1
{
static int propGetDouble ();
};
template<int dimension,
class T,
int (*PROPGET)()
>
struct OFX_AnimatedNumberParam
{
virtual int paramSetValueAtTime()
{
return PROPGET();
}
};
void f()
{
new OFX_AnimatedNumberParam<2,double,OFX_PropertySuiteV1::propGetDo... |
google | android | nested4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nested4.C | 196 | utf_8 | b12c9a151e46871b430564ee47c57714 | template <typename T> struct A {
template<typename S> struct B { typedef A<S> X; };
};
template<typename> void f() {
typedef A<int>::B<double>::X X;
}
template void f<int> ();
|
google | android | static14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static14.C | 176 | utf_8 | ff5a3d46b4c279a829a0b1e0eb4acdac | struct Base {
int x;
};
template <typename T>
struct A {
static const int N = sizeof(static_cast<Base*>(T()));
int a[N];
};
struct Derived : Base {
A<Derived*> a;
};
|
google | android | unify1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/unify1.C | 439 | utf_8 | 450c0b9e346d4201c85d9055f20ebf1a | // Test non-type template argument folding.
// { dg-do compile }
template < int I1, int I2 >
class unit
{
public:
unit() {}
unit( const unit<I1,I2>& ) {}
template< int Q1, int Q2 >
unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const {
return unit< I1 - Q1, I2 - Q2 >();
}
};
int m... |
google | android | sizeof13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof13.C | 392 | utf_8 | 52cb6bded099df9ce613e3e3e21f7a8a | // PR c++/42623
// We should choose f(B) because f(A<undef>) involves applying sizeof to
// an incomplete class, so it is removed by SFINAE.
// { dg-do link }
struct undef;
template <typename U, int N = sizeof(U)> struct A { A(int); };
template <typename U> void f(A<U>);
template <typename U> struct B { B(int) { } }... |
google | android | stmtexpr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/stmtexpr1.C | 150 | utf_8 | 53fcc90b25ad8744232fbb7b915d3d89 | // PR c++/17404
// { dg-do compile }
// { dg-options "" }
template <int> void foo ()
{
__builtin_expect (({0;}), 1);
}
template void foo<1> ();
|
google | android | ptrmem18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem18.C | 606 | utf_8 | c29b186e715b166abc3703fea2205647 | // PR c++/33616
// { dg-do run }
// { dg-options "-O2" }
extern "C" void abort ();
struct S {
int c;
S () : c (0) {}
virtual void f1 () { c += 1; }
virtual void f2 () { c += 16; }
};
struct T {
S s;
};
typedef void (S::*Q) ();
template <Q P>
void test1 (T *t)
{
(t->s.*P)();
}
template <Q P>
void test2... |
google | android | ttp20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp20.C | 193 | utf_8 | e418b0b8fa3fa6c89ea62a249937f9c4 | // PR c++/27424
// Bug: failing to substitute the 'int' into C
template<typename T> struct A
{
template<template<T> class> struct B {};
template<T> struct C;
B<C> b;
};
A<int> a;
|
google | android | overload11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/overload11.C | 450 | utf_8 | 36f046a8855c4966a1c3643a3557e887 | // PR c++/39413
// We don't need to instantiate Wrapper<int> to check the
// foo(const Thingy&) overload.
template <class T> struct Incomplete;
template <typename T> class Wrapper
{
Incomplete<T> i;
};
template <typename T> struct Thingy
{
Thingy();
Thingy(const Wrapper<T>& v);
template <typename X> void fo... |
google | android | using26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using26.C | 707 | utf_8 | fbf75eab6df8d2c0fa0b3e5eac70d4b5 | // PR c++/21682
namespace one {
template<typename T> int bar1(T);
}
using one::bar1;
template<typename T> void bar1(T);
template<typename T> void bar1r(T);
namespace oner {
template<typename T> int bar1r(T);
}
using oner::bar1r;
namespace two {
template<typename T, typename U> void bar2(T);
}
using two::b... |
google | android | crash53 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash53.C | 229 | utf_8 | 31afa14b98908513c290d08fb3c8185c | // PR c++/28110
// { dg-do compile }
template<int> struct A {};
template<typename T> struct B
{
template<T I> B(A<I>); // { dg-error "template non-type parameter" }
};
B<double> a=A<0>(); // { dg-error "non-scalar type" }
|
google | android | ptrmem24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem24.C | 299 | utf_8 | 8694ad15b71a480035424c4134c7c412 | // PR c++/59818
template <class T>
struct Identity {
typedef T type;
};
struct Foo {
template <typename T>
Foo(T*, void (Identity<T>::type::*m)(void));
};
struct Bar {
void Method(void) const;
};
void Bar::Method(void) const
{
Foo foo(this, &Bar::Method); // { dg-error "no match" }
}
|
google | android | array9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array9.C | 277 | utf_8 | 9ff0e683b6d55fee7915dd8f28470138 | // PR c++/18429
int subtrees = 4;
template< class T >
struct Tree {
Tree* L[subtrees]; // { dg-error "" }
Tree* R[subtrees]; // { dg-error "" }
~Tree()
{
delete [] L[0]; // { dg-error "" }
delete [] R[0]; // { dg-error "" }
}
};
void f()
{
Tree<int> t;
}
|
google | android | enum3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/enum3.C | 299 | utf_8 | dfe8fe9abce8be55414485a111a8c15f | // PR c++/17327
enum E { E0, E1 };
template <class T,class U> class A {};
template <class T> void f(A<E,T>) {}
// We used to issue a "sorry" message. By using an explicit error
// message below, we make sure that we will not match "sorry".
template void f(A<int,E>); // { dg-error "template-id" }
|
google | android | typedef15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef15.C | 390 | utf_8 | b9875172b6e849d858fc2d69a332444c | // Origin: PR c++/26693
// { dg-do compile }
template<class T> struct C0;
struct Foo {
typedef int TypedefedFoo;
typedef C0<Foo> TypedefedC0;
};
template<class T>
struct C0
{
typedef Foo TypedefedFoo;
typename T::TypedefedC0::TypedefedFoo m;
};
template<class U>
struct C1
{
typedef C0<Foo> TypedefedC0;
};
C0<... |
google | android | const5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const5.C | 206 | utf_8 | d75b945d8bfffb304a8d55dc4a97d457 | // PR c++/49176
// { dg-do compile { target c++11 } }
struct A { static int a(); };
template<int>
struct B { static int const b; };
int f() { return B<0>::b; }
template<int I>
int const B<I>::b=A::a();
|
google | android | crash9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash9.C | 131 | utf_8 | 44592f20d07e36f90633528dd90bfad3 | struct A { };
struct B { };
A f(const B & b) {
return A();
}
template<>
B f(const A & a) { // { dg-error "" }
return B();
}
|
google | android | ptrmem12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem12.C | 442 | utf_8 | adf178bf638c6b871c4bd9abf0c44c53 | template <class _Ret, class _Tp>
void mem_fun_ref(_Ret (_Tp::*__f)());
struct A {
double f();
};
void h ()
{
mem_fun_ref(&A::f);
}
template <class T>
void f()
{
mem_fun_ref(&A::f);
}
void g()
{
f<int>();
} |
google | android | unify5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/unify5.C | 303 | utf_8 | a356fc4e8d85f399c730f255f0823551 | // PR:c++/14007
template <typename T> struct X {}; // #1
template <typename T> struct X<const T>; //#2
template struct X<int&>; //#3 |
google | android | memtmpl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memtmpl2.C | 341 | utf_8 | 742c5d9c3baa52309d717d8a67cb74e7 | // { dg-do compile }
// PR c++/12332. ICE
template <unsigned D> class TPL;
template <typename T> struct X {
template <template <typename> class V>
V<TPL<V<int>::d> > operator () ();
};
void Foo (X<int> x) {} |
google | android | constant1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/constant1.C | 236 | utf_8 | 86a7d82d7e4fadd71353ebf643d761f0 | // PR c++/49855
extern void foo(int);
template <class Key, class Value> void Basic() {
const int kT = 1.5e6; // <--- causes ICE
int size = kT*2/3;
do {
foo(size);
size = size * 0.5 - 1;
} while (size >= 0 );
}
|
google | android | crash90 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash90.C | 177 | utf_8 | 36b0f029ca4df92d2fde216b9443c83b | // PR c++/39750
template < unsigned >
struct A ;
template < typename >
struct B ;
template < typename T , A < B < T > {}// { dg-error "initializer|parse error|type|expected" }
|
google | android | ptrmem20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem20.C | 302 | utf_8 | 81a6774120ce149534db6fc79b3ba354 | // PR c++/43079
struct A {};
struct B
{
void foo() const;
void foo();
};
template<void (A::*)()> void bar(); // { dg-message "note" }
void baz()
{
bar<&B::foo>(); // { dg-error "not a valid template argument|no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
|
google | android | static27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static27.C | 169 | utf_8 | 1b82adb3481fed24cf9d4678fad7ec3a | // PR c++/28235
template<typename> struct A
{
static const bool i = true;
template<bool = i> struct B {};
B<> b;
};
void f() {
A<int> a1, a2;
a1.b = a2.b;
}
|
google | android | anon5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/anon5.C | 166 | utf_8 | c49d0d53d89b9f43c9efd96309b57cfa | // PR c++/45651
namespace { template <int T> struct A {}; }
template <int T> struct B { void f(A<T>); };
template struct B<1>;
template<int T> void B<T>::f(A<T>) {}
|
google | android | using24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using24.C | 542 | utf_8 | 052b106a563f3e99ad99e5b1a509d09b | // PR c++/21682
template <class T>
struct t
{
typedef typename T::type type;
};
template<> class t<int>{};
template <class T> struct t1{ };
template<> struct t1<int>
{
typedef int type;
};
namespace name1
{
template <class S> typename t<S>::type begin(S const& s);
namespace name2
{
template <class S> t... |
google | android | non-dependent6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent6.C | 137 | utf_8 | 45dd220f658e86742366772757b041e2 | // PR c++/15285
void foo(void (*func)()) {}
template<typename T>
void bar()
{}
template<typename T>
void baz()
{
foo(&bar<long>);
}
|
google | android | sizeof1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof1.C | 261 | utf_8 | 8af3d67f6d9f4dd6cda097137e1aaa5e | // Test use of `sizeof' as a template parameter.
// { dg-do compile }
template <unsigned I> struct A { static char *value; };
template <typename SizeType>
struct B
{
char * f() const
{
return (A<sizeof(void *)>::value);
}
}; |
google | android | crash56 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash56.C | 354 | utf_8 | 33e6f2d8b3773c0bca8704049deea0c9 | // PR c++/28705
// DR 218 is debating whether this is well formed or not. We've never
// accepted it (because we'd crash), so we continue to reject it, but
// without crashing.
namespace N
{
struct A { A (A*); };
}
template<typename T> void g (N::A *p)
{
(void) A (p); // { dg-message "" "" }
} |
google | android | sfinae6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae6.C | 1,947 | utf_8 | 2622d4a8e2409cf748878b7d2db89477 | // DR 339
//
// Test of the use of the function call operator with SFINAE
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<fal... |
google | android | using1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using1.C | 562 | utf_8 | 36bc33b0a7d4f4c6efc1f83c1b6bf13b | // { dg-do run }
// PR 9447. Using decls in template classes.
template <class T>
struct Foo {
int i;
};
struct Baz
{
int j;
};
template <class T>
struct Bar : public Foo<T>, Baz {
using Foo<T>::i;
using Baz::j;
int foo () { return i; }
int baz () { return j; }
};
int main()
{
Bar<int> bar;
bar.i = 1... |
google | android | array1-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array1-1.C | 418 | utf_8 | 99d7b1deba3ad5e11fcbd2dc7d70e9ee | // { dg-do compile }
// { dg-options "-fabi-version=1" }
// PR c++/12774 Array domains compared unequal
void Foo(double r[3][3])
{
}
void Baz()
{
double m[3][3];
Foo(m);
}
template <class T>
void Bar()
{
double m[3][3];
Foo(m);
}
int main()
{
Baz();
Bar<int>();
return 0;
} |
google | android | crash98 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash98.C | 251 | utf_8 | 04c7e0cdc041fdd2a9bee1cb186e590a | // PR c++/43630
template < typename > struct A;
template < typename > struct A < int > // { dg-error "not deducible|template\\-parameter|declaration" }
{
int i;
int f ();
};
int A < int >::f () // { dg-error "incomplete type" }
{
return i;
}
|
google | android | sfinae6_neg | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae6_neg.C | 1,235 | utf_8 | 8d9554dc6976327bd3dd118e393c6f24 | // DR 339
//
// Test of the use of the function call operator with SFINAE
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<fal... |
google | android | repo5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo5.C | 402 | utf_8 | 4a25565c9833beec64e5bf027190e23a | // PR c++/25625
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template< typename T, T N > struct integral_c {
static const T value = N;
typedef integral_c< T, value + 1 > next;
};
template< typename... |
google | android | explicit-args1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit-args1.C | 483 | utf_8 | e55630cc11be91571d5b580292e51090 | // PR c++/34950
template <class T = int> struct policy {
typedef int unnecessary;
};
template <class Policy> struct A {
typedef int type;
typedef typename Policy::unnecessary unused;
};
template <class T> struct S {
typedef int type;
typedef typename A<T>::type unused;
};
template <class, class ... |
google | android | incomplete2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/incomplete2.C | 297 | utf_8 | e8b18c9093eb547e76b1598e177671b2 | // PR c++/27427
// { dg-do compile }
struct A;
template<A&> void foo(); // { dg-message "note" }
A a; // { dg-error "incomplete type" }
void bar()
{
foo<a>(); // { dg-error "(no matching function|could not convert)" }
// { dg-message "candidate" "candidate note" { target *-*-* } 12 }
}
|
google | android | friend53 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend53.C | 259 | utf_8 | c02ac6cbb6d31fb45edabe8ff6c697a7 | // PR c++/53403
template <typename T>
class Foo
{
typedef void type;
template <typename U> friend void f();
public:
Foo() {}
};
template class Foo<void>;
template <typename T>
void f()
{
typedef Foo<void>::type type;
}
int main()
{
f<void>();
}
|
google | android | access25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access25.C | 385 | utf_8 | 8fd60bfd6c2c2368d8cb3afb7640aa87 | // PR c++/56359
typedef int (*InvocationCallback) (const int &);
template < typename target_t >
void SetPrototypeMethod (target_t, const char *, InvocationCallback);
class A
{
void Initialize ();
protected:
static int Stop (const int &);
void Stop (); // comment out to make the bug disappear.
};
void
A... |
google | android | ptrmem27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C | 327 | utf_8 | 5825625a5ba7d28fd8a1fdd113dde9c2 | // PR c++/61500
struct X {
int i;
int j;
int foo(int X::* ptr);
template <int X::* ptr>
int bar();
};
int X::foo(int X::* ptr) {
int* p = &(this->*ptr); // OK.
return *p;
}
template <int X::* ptr>
int X::bar() {
int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
return... |
google | android | nontype12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype12.C | 1,173 | utf_8 | e4176144e393e4accb07877196c4e693 | // PR c++/20172
template<typename T> struct A
{
template<T> int foo(); // { dg-error "double" }
template<template<T> class> int bar(); // { dg-error "double" }
template<T> struct X; // { dg-error "double" }
};
A<char> a1;
A<double> a2; ... |
google | android | ttp6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp6.C | 415 | utf_8 | ede8e95c1aeeeb0cf1c4cfb0fd860e07 | // { dg-do compile }
// PR c++/10552: Member class template as template template argument
// substitution issue.
template <template <typename> class A, typename>
struct B
{
typedef typename A<int>::t t;
};
template <typename D>
struct E
{
template <typename> struct F { typedef int t; };
typedef typename B<F, D>::... |
google | android | nontype8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype8.C | 439 | utf_8 | 2db8591db13ac8e8cf2e26468f9d18e3 | // { dg-do compile }
// Origin: C++ standard, [temp.arg.nontype]/3
template<int* p> class X { };
int a[10];
struct S { int m; static int s; } s;
X<&a[2]> x3; // { dg-error "" } address of array element
X<&s.m> x4; // { dg-error "" } address of non-static member
X<&s.s> x5; ... |
google | android | static15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static15.C | 3,226 | utf_8 | c3b36a59772fbeeb2232e39c7ec7b99c | // PR c++/23667
// { dg-options "-std=gnu++98" }
template<int dummy>
struct X
{
static const int n_primes = 256;
static const unsigned long primes[n_primes + 1];
};
template<int dummy>
const int X<dummy>::n_primes;
template<int dummy>
const unsigned long X<dummy>::primes[n_primes + 1] =
{
2ul... |
google | android | ptrmem16 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem16.C | 211 | utf_8 | df5cd343f05e3fae16de3ecb28034b53 | // PR c++/25369
// { dg-do link }
template <typename> struct A
{
void foo() {}
};
void bar(void (A<int>::*)()) {}
template <int> void baz()
{
bar(&A<int>::foo);
}
int main()
{
baz<0>();
return 0;
}
|
google | android | spec32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec32.C | 118 | utf_8 | f2a0b8ac9757fbcaba8addb591bb1e06 | //PR c++/28861
struct A
{
template<template<int> class B> struct B<0>; // { dg-error "name of class shadows" }
};
|
google | android | abstract1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/abstract1.C | 361 | utf_8 | c07d50142bc334d2ce490d4f68be9ca4 | // PR c++/58022
template <class T> struct A { };
template <class T> A<T> & operator<< (A<T>&, T);
template <class T> class foo;
template <class T> A<char> & operator<<(A<char>& o, const foo<T>& l);
template <class T> class foo {
friend A<char>& operator<< <T> (A<char>& o, const foo<T>& l);
};
class bar;
foo<bar> ... |
google | android | crash110 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash110.C | 152 | utf_8 | bc34a5c1a684295dab662a89dc6697f6 | // PR c++/51402
template<void> struct A // { dg-error "not a valid type" }
{
template<int,int> struct B {};
template<int N> struct B<N,N> {};
};
|
google | android | repo1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo1.C | 299 | utf_8 | 0a632cddef1c669686cf95071e3afa4f | // { dg-options "-frepo" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
struct A {
A();
};
A::A() {}
template <typename T>
struct B : public A {
B() {} // { dg-bogus "" }
};
B<int> b;
int main () {}
// { dg-final { cleanup-repo-files } }
|
google | android | access17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access17.C | 274 | utf_8 | 092b63314ea4c83dfe2ff66c762901cd | // PR c++/27339
class A
{
private:
enum private_enum {a};
template<A::private_enum v> // OK
struct B
{
void bm();
};
public:
void am()
{
B<a> instance; //OK
instance.bm();
}
};
template<A::private_enum v> // FAIL
void
A::B<v>::bm(){}
|
google | android | incomplete3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/incomplete3.C | 166 | utf_8 | b6192cd189e5459a84384348bf07ab8a | // PR c++/27315
// { dg-do compile }
struct A; // { dg-error "forward declaration" }
template void A::foo<0>(); // { dg-error "before|incomplete" }
|
google | android | ctor7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor7.C | 309 | utf_8 | 0572945ccfe2a2369a8e72b22dab3d97 | // PR c++/27640
template < class T > struct refcounted :
virtual T
{
template < class A1 > refcounted (const A1 & a1) : T () { }
};
struct nfsserv {};
template < class T >
void
sfsserver_cache_alloc (int *ns)
{
new refcounted < nfsserv > (*ns);
}
void
usage ()
{
sfsserver_cache_alloc < int > ( 0);
}
|
google | android | crash105 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash105.C | 275 | utf_8 | f07fd8a3820e9db30fbbab54d71dd891 | // PR c++/44118
template < typename > struct S;
template < typename > struct S < int >; // { dg-error "template" }
template < typename > struct S < int >
{
void f ();
};
void
f ()
{
S < int >::f ();
}
// Don't be picky about error-recovery.
// { dg-prune-output "." }
|
google | android | defarg11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg11.C | 512 | utf_8 | d4611f4846a0b498f17d4173fb4e9cfb | // { dg-do compile }
// We used to reject this code as the extension
// for default arguments being accepted as less the
// needed template arguments.
template<typename> struct match { };
template<template<typename> class t,typename T>
struct match<t<T> > { typedef int type; };
template<template<typename,typ... |
google | android | new11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new11.C | 262 | utf_8 | 8a3716757b496de374cb6d6a4f5b6a64 | // PR c++/54984
// { dg-do run }
int n = 1;
void* operator new(__SIZE_TYPE__)
{
n = -1;
return &n;
}
template <class T>
struct Foo
{
Foo()
: x(new int)
{
if (*x != -1)
__builtin_abort();
}
int* x;
};
int main()
{
Foo<float> foo;
}
|
google | android | friend14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend14.C | 414 | utf_8 | 2c569073aac74ea8a9886428ec873202 | // { dg-do compile }
// Perform access checking to parameter and return type of
// function template correctly when the template is friend.
template <class T> class O {
struct I { I (int); };
template <class T_>
friend typename O<T_>::I f ();
};
template <class T_>
typename O<T_>::I f () { return 1; }
struct X {... |
google | android | crash36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash36.C | 263 | utf_8 | f8bee91d29458817363bd2ca4c94d704 | // { dg-do compile }
// PR c++/20333: ICE parsing typename without nested-name-specifier
template<class> struct f {};
f<int> f2[2] = {typename f<int>()}; // { dg-error "" } |
google | android | nested2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nested2.C | 115 | utf_8 | 1cf2f3c9d70e586c16763a10c08d9972 | template <class T> class CO {
class CI1 {
class CI2;
};
};
template <class T>
class CO<T>::CI1::CI2 {};
|
google | android | non-type1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-type1.C | 911 | utf_8 | c68d85d18e13eca7b98c51e07b278cf0 | // PR c++/4377
template < int I1, int I2 >
class unit
{
public:
typedef unit<I1,I2> my_type;
unit() {}
unit( const unit<I1,I2>& ) {}
template< int Q1, int Q2 >
unit< I1 + Q1, I2 + Q2 > operator * ( const unit< Q1, Q2 >& rhs ) const {
return unit< I1 + Q1, I2 + Q2 >();
}
template< int Q1, int ... |
google | android | array11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array11.C | 462 | utf_8 | 5c9702e760be4db613f93c64564000c5 | // { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// PR c++/19208: Fold dependent array domains
template <class C> struct if_t { typedef int type; };
template <class T> struct ffff { static const bool value = true; };
template <class A>
struct bound_member_action
{
typedef char f[ff... |
google | android | spec28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec28.C | 180 | utf_8 | d7344703a351e2d4d50cf9f8383b2013 | // PR c++/25854
// Bad diagnostic
// { dg-do compile }
template<typename> struct A {}; // { dg-error "provided" }
template<> struct A<> {}; // { dg-error "wrong number" }
|
google | android | friend37 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend37.C | 194 | utf_8 | 19ae206b65ef32c57066f4c9d603d478 | // PR c++/22147
template<typename> struct A;
template<typename T> void foo(A<T>* p) { *p; }
template<typename> struct A
{
friend void foo<class X>(A<X>*);
};
void bar()
{
foo<int>(0);
}
|
google | android | dependent-expr6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dependent-expr6.C | 301 | utf_8 | 0c0a12ab75ecc281ca68babd4d565ce5 | // { dg-do compile }
// PR C++ 34081 ICE
class Foo;
template < class Foo > class Bar
{
enum Status
{ OK, NO };
enum Status getStatus ()
{
return status;
}
Status status;
}; |
google | android | overload3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/overload3.C | 179 | utf_8 | 98ebf130b836485f9a7ceae171151be5 | // PR c++/16870
struct A
{
int operator[](int) const;
};
template<int> A foo();
A bar(A(*)());
template<int> int baz() { return (bar(&foo<0>))[0]; }
template int baz<0>();
|
google | android | cast1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/cast1.C | 451 | utf_8 | dae4547b0ed98c262ad1adff2778e177 | // { dg-do compile }
struct A
{
void foo();
};
template<int> void bar(A& a)
{
const_cast<A&>(a).foo();
static_cast<A&>(a).foo();
reinterpret_cast<A&>(a).foo();
((A&)a).foo();
}
template void bar<0>(A& a); |
google | android | sfinae28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae28.C | 364 | utf_8 | 071c3f65cf279133e0877210d8149c4e | // Origin: PR c++/44267
struct B {};
struct D : B {};
struct VD : virtual B {};
template <class T> T create();
typedef char one[1];
typedef char two[2];
template <class D, class B>
one& f(char (*)[sizeof(static_cast<D>(create<B>()))]);
template <class D, class B>
two& f(...);
int main()
{
f<D*, int>(0);
f<D... |
google | android | init6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init6.C | 515 | utf_8 | 65a281c41b82251552faaf8359766e91 | // PR c++/25836
template <class T>
class Iter {};
template <class T>
class SubIter : public Iter<T> {
void insert(T);
};
class GraphBase {
public:
class Node;
};
template<class T>
class Graph : public GraphBase {
class Inner {
Iter<typename Graph<T>::Node*> *get();
};
};
template<class T>
Iter<typename... |
google | android | static11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static11.C | 90 | utf_8 | d208baa6490e1bda86ed7140d7cc233b | // PR c++/19826
template<typename T> struct A
{
static const T i = 1;
char a[i];
};
|
google | android | memtmpl4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memtmpl4.C | 211 | utf_8 | 7dfe03ecbca075fc2421fa72bbaedb9d | // PR c++/53492
template<typename T> struct A
{
template<typename U> struct B;
};
template <> template<class T> struct A<T>::B { }; // { dg-error "expected 2 levels" }
A<int>::B<int> b; // { dg-error "" }
|
google | android | defarg4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg4.C | 190 | utf_8 | 64d2588370b2c020d9d5828deadfc7dc | // PR c++/14763
struct A {
int get() const {}
static A *foo();
};
template<bool> struct S {
S(unsigned int = A::foo()->get()) ;
};
void foo() throw() {
S<false> f;
}
|
google | android | member2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/member2.C | 254 | utf_8 | cabe816ff29ed547a0c78ab109ad97d0 | // PR c++/8660
// Bug: we were treating the definition of the non-template as a definition
// of the template, which broke.
struct BadgerBuf
{
void ReadPod();
template<class B>
void ReadPod();
};
void BadgerBuf::ReadPod ()
{ ReadPod<int> (); }
|
google | android | access6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access6.C | 421 | utf_8 | 3f2e5ae210f767c1589637afbcf45353 | // { dg-do compile }
// PR c++/8389
// Access control ICE for typename during instantiation and name mangling
template <class> class Base {
protected:
typedef int Type;
};
template <class T> struct Derived : public Base<T> {
typedef typename Base<T>::Type Type;
template <class Arg> void f(Type = Type()) ... |
google | android | ctor5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor5.C | 132 | utf_8 | efa9db39e10b4576a573bca4b38cf74b | // PR c++/24278
template<typename T> struct A
{
A() : T(0) {} // { dg-error "base" }
};
A<int*> a; // { dg-message "required" }
|
google | android | spec14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec14.C | 374 | utf_8 | 8c1a1dce043f50d8d866a9779357c645 | // { dg-do compile }
// Origin: <weissr at informatik dot uni-tuebingen dot de>
// PR c++/3671: Non-type enum parameters must not be converted
enum T1 {a};
enum T2 {b};
struct Y {
template <T1 i> void foo() {}
template <T2 i> void foo() {}
};
struct Z {
template <T1 i> void foo() {}
};
template void Y::foo<b>... |
google | android | crash35 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash35.C | 194 | utf_8 | 8df742184e3299064aab4742d5bbf80b | // PR c++/20463
// { dg-do compile }
template <typename T> struct C; // { dg-error "declaration" }
template <typename T> void C<T>::f() // { dg-error "invalid|template" }
{
const foo bar;
}
|
google | android | static32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static32.C | 163 | utf_8 | ddaf68e1fab11516ec3373cfa6be7fd8 | // PR c++/51430
// { dg-do compile }
template<int> struct A
{
static const int x[] = 0; // { dg-error "in-class initialization|initializer fails" }
};
A<0> a;
|
google | android | koenig9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/koenig9.C | 866 | utf_8 | 0e217ccc45d6ea239c0b368c1909c623 | // PR c++/29131
// int has no associated namespaces, so arg-dep lookup doesn't find g(int).
template <class T> int f() { return g(T()); } // { dg-error "argument-dependent" }
int g(int); // { dg-message "declared here" }
int i = f<int>();
// PR c++/24163
// Unqualified lookup doesn't find names from dependen... |
google | android | friend22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend22.C | 290 | utf_8 | dbfcd529175cac71265e5dff4f4513fe | // { dg-do compile }
// PR c++/641: Duplicate friend diagnostics
template <class T> class iterator { };
template <class T> class item {
friend class iterator<T>;
friend class iterator<const T>;
};
class A { };
item<const A> i; |
google | android | ctor4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor4.C | 1,083 | utf_8 | 517013de9505a99dcece802cdd7f1c6d | // { dg-do compile }
// Bug 16174, SFINAE failure.
template <class T> struct K
{
K();
K(K<T> & rhs);
K(K<T> const& rhs);
template <class U> K(K<U> const& rhs);
private:
template <class U> struct A;
template <class U> struct A< K<U> const>
{ typedef typename K<U>::compile_time_error type; };
// This is... |
google | android | sizeof8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof8.C | 191 | utf_8 | 84c8e28b3b15370829046813c1fbb7b3 | // { dg-do compile }
// PR c++/11406: ICE
template <int> struct S{};
template <int N> S<sizeof(new double[N])> f() {}
template S<sizeof(void*)> f<2>(); |
google | android | defarg6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg6.C | 513 | utf_8 | 74543160bb89c6fe96c522faabe5c5e0 | enum X{ a, b, c };
struct C
{
static void func (X &ref = a); // { dg-error "" }
};
template <typename T>
struct D
{
static void func (X &ref = a); // not an error at this point
};
void Foo (X & obj)
{
D<int>::func (obj);
D<int>::func (); // { dg-error "" }
}
// { dg-prune-output "passing argument" } |
google | android | void9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void9.C | 149 | utf_8 | 40eb8a19e0fcd553ccef6d762b7efceb | //PR c++/28738
template<int,void> struct A {}; // { dg-error "not a valid type" }
template<int N> struct A<N,0> {}; // { dg-message "invalid" }
|
google | android | sizeof14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof14.C | 113 | utf_8 | f3d1c78c98af6fc6f4d1fbc648a31143 | // PR c++/54844
// { dg-do compile }
template <int N> int fn () { return sizeof (double); }
int var = fn <0> ();
|
google | android | using11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using11.C | 89 | utf_8 | a3ac6b8050e3adf5b98b0e28e64070fc | struct X {
void f();
};
template <typename T>
struct S : public T {
using X::f;
};
|
google | android | vtable1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/vtable1.C | 315 | utf_8 | 98fb9a7526b5989b48ce49e7131f8f76 | // Test that vtables are set up properly for constructors and destructors
// of template classes.
// { dg-do run }
int r;
template <class T>
struct A {
virtual void f () { }
A() { f (); }
~A() { f (); }
};
struct B : public A<int> {
virtual void f () { ++r; }
};
int main ()
{
{ B b; }
return r;
}
|
google | android | crash78 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash78.C | 114 | utf_8 | 63aa4ea81419f0f2436d71c62bb543c3 | // PR c++/35077
template<typename=int struct A __attribute((aligned(4))); // { dg-error "declaration|expected" }
|
google | android | crash25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash25.C | 86 | utf_8 | a9a41c255aa794f8caef16dd63a3534d | // PR c++/18124
template <template <int> class class> class A {}; // { dg-error "" }
|
google | android | crash103 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash103.C | 95 | utf_8 | 44d05d042dc79a79585f17b3bcda6ec0 | // PR c++/45665
template < typename > struct S;
void (S <0>::*ptr) (); // { dg-error "type" }
|
google | android | friend40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend40.C | 216 | utf_8 | e91add4174f6722fc0ed3c0bbd420d70 | // PR c++/24173
// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
template <int> struct A;
void foo(A<0>);
template<int> struct A
{
friend void foo(A<0>);
};
void bar()
{
foo(A<0>());
}
|
google | android | typedef17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef17.C | 338 | utf_8 | 1b0cfbee8f3caf6029a657e5011d2adc | // PR c++/37806
extern "C" int printf (const char *, ...);
template <typename T>
struct S1
{
typedef void (function_type)(int) const;
};
struct S2: public S1<int>
{
virtual function_type f = 0;
};
struct S3: public S2
{
void
f (int i) const
{
printf ("Hello world: %d\n", i);
}
};
int
main()
{
... |
google | android | arg9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arg9.C | 140 | utf_8 | 9a06687b448bfad17e2e10a4c58cfcf5 | // PR c++/57771
// { dg-do compile }
template <int N>
struct S {};
S <static_cast <int> (4>>2)> s1;
S <reinterpret_cast <int> (4>>2)> s2;
|
google | android | ttp15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp15.C | 342 | utf_8 | c09549e0b04f66b0e190b742362d2eb7 | struct Dense {
static const unsigned int dim = 1;
};
template <template <typename> class View,
typename Block>
void operator+(float, View<Block> const&);
template <typename Block,
unsigned int Dim = Block::dim>
struct Lvalue_proxy {
operator float() const;
};
void
test_1d (void)
{
Lvalue_proxy<Dense> p;
... |
google | android | template-id-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/template-id-1.C | 474 | utf_8 | 2f6494bf04dd960a886f4ba09c1a1bcf | // { dg-do compile }
struct A {
typedef int Y;
typedef double Z;
};
struct B {
template<typename T>
void func(typename T::Y, typename T::Z) { }
};
template<typename T>
struct X {
void gunc();
};
template<typename T>
void X<T>::gunc()
{
B b;
b.func<A>(0, 3.);
}
int main()
{
X<int> x;
x.gunc();... |
google | android | meminit1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/meminit1.C | 197 | utf_8 | 48dda08b0e2ac380dce61a5c6861505f | // { dg-options "-std=gnu++98" }
template <class T >
struct S
{
S() : S() {} // { dg-message "delegating constructors" }
}; // { dg-error "delegates to itself" "" { target *-*-* } 5 }
S<int> s;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.