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 | chromium | const3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/const3.C | 232 | utf_8 | 968e9c62934ef6030d7cf2cf43e79dbf | // Origin PR c++/42251
// { dg-do "compile" }
struct foo
{
static const bool b = false;
};
template<bool x>
struct S1
{
};
template<bool x>
struct S2
: S1<foo::b>
{
}; |
google | chromium | access1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/access1.C | 400 | utf_8 | 1c360b630dc5835068452f918bda8fb6 | // { dg-do compile }
// It is legal to specialize a template with a different class-key.
template<typename T> class X;
template<typename T> struct X<T *>
{
int i;
};
template<> struct X<int>
{
int i;
};
void foo ()
{
X<int *> xip;
X<int> xi;
xip.i;
xi.i;
} |
google | chromium | crash41 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash41.C | 247 | utf_8 | 0e53425dee35e3cd8bc31b131a4010d7 | // PR c++/22464
template<typename T>
void do_something(const T* A) // { dg-error "declared" }
{
struct helper_t{
helper_t() {
A[0]; // { dg-error "use" }
}
} helper;
}
void sub1() {
double A[7];
do_something (A);
}
|
google | chromium | repo4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/repo4.C | 228 | utf_8 | f10e1edc05a835217893fc70b84d288e | // PR c++/17775
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
namespace {
struct Foo {};
}
template <typename Tp>
void foo(Tp) {}
int
main()
{
foo(Foo());
}
|
google | chromium | func1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/func1.C | 254 | utf_8 | d5d24fc94d133229a10c5b13f44c253b | template <typename T1,typename T2>
inline void f(const T1&,const T2&) { }
template <typename T1,typename T2,void F(const T1&,const T2&)>
struct A {
template <typename T> void g(T& i) { }
};
int main() {
int i;
A<int,int,f> a;
a.g(i);
}
|
google | chromium | using2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/using2.C | 542 | utf_8 | e9e248a8b33d03f5bc104a6797cdacef | // { dg-do compile }
// PR 9447. Using decls in template classes.
template <class T>
struct Foo {
int i; // { dg-error "Foo" }
};
struct Baz
{
int i; // { dg-error "Baz" }
};
template <class T>
struct Bar : public Foo<T>, Baz {
using Foo<T>::i;
using Baz::i;
int foo () { return i; } // { dg-error "request fo... |
google | chromium | access12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/access12.C | 265 | utf_8 | 20c6114a3d4d0119b052ef6635d54a2c | // { dg-do compile }
// PR c++/10849: Incorrect access checking on class template partial
// specialization.
class X {
private:
template <typename T> struct Y;
};
template <typename T> struct X::Y<T*> {}; |
google | chromium | pseudodtor2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/pseudodtor2.C | 206 | utf_8 | 632dfaf82a330021f820250c7641745b | // PR c++/32384
// { dg-do compile }
template<typename S> struct D
{
typedef int T;
S foo ();
D () { foo ().~T(); } // { dg-error "is not of type" }
};
struct Z
{
Z () {}
~Z () {}
};
D<Z> d;
|
google | chromium | crash16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash16.C | 308 | utf_8 | 0b7b35a94bb1a8a5457b2c3bd299d5e2 | // { dg-do compile }
// PR c++/10079
template <bool> struct A {};
template <typename> struct B
{
enum { e };
};
template <typename T> A<(B<T>::e && 0)> foo(T) {}
template <typename T> void foo(B<T>) {}
void bar()
{
B<int> b;
foo(b);
} |
google | chromium | typedef20 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typedef20.C | 490 | utf_8 | b699615985c7e85aa36ba74242c11af6 | // Origin PR c++/40007
// { dg-do compile }
class x
{
typedef int privtype; // { dg-error "is private" "" { xfail *-*-* } }
protected:
typedef int type;
};
template<typename T>
struct y : public x
{
typename x::type z;
};
template<typename T>
struct y<T*> : public x
{ // { dg-error "within this context" "" { xfai... |
google | chromium | pr39425 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/pr39425.C | 346 | utf_8 | d5bdded25e31421ba955d833faff7fbc | // PR c++/39425
// { dg-do compile }
class a {
template<unsigned int s>
struct _rec {
static const char size = _rec< (s >> 1) >::size;
};
template<> // { dg-error "explicit" }
struct _rec <0> {
static const char size = 0;
};
static const unsigned int value = _rec < 1 >::size;
} // { dg... |
google | chromium | crash87 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash87.C | 314 | utf_8 | 3bc6fcf9c80c2cc5aa0d5c1c4ec47445 | // Origin: PR c++/38357
// { dg-do compile }
class BUG
{
public:
bool name() { return true; }
};
template <bool T>
struct BUG1_5
{
};
template <bool name>
class BUG2 : BUG
{
public:
typedef BUG1_5<name> ptr; // { dg-error "could not convert template argument" }
};
int main()
{
BUG2<false> b;
return 0;
}
|
google | chromium | array2-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/array2-1.C | 269 | utf_8 | b197e9f6e5275f99d9ff3c22fe947550 | // { dg-do compile }
// { dg-options "-fabi-version=1" }
// PR c++/13494. ICE
template<typename T>
int foo(int d[][4])
{
return d[0][0];
} |
google | chromium | void4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/void4.C | 187 | utf_8 | f52ef262006018fae2f9121ca966abcd | //PR c++/28638
template<void> struct A; // { dg-error "not a valid type" }
template<template<int> class> struct B {};
B<A> b; // { dg-error "template|invalid type" }
|
google | chromium | dependent-name1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/dependent-name1.C | 218 | utf_8 | f23d748a70179cdd1a4176b5cf3a3e9b | // { dg-do compile }
// PR c++/10347: Dependent type checking of array new expression
void bar (int *);
template <int> void foo() {
bar(new int[1]);
} |
google | chromium | conv6 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/conv6.C | 576 | utf_8 | a99117f536bfae5da72de6e056eca4b9 | // { dg-do compile }
// PR 9898, DR 322. Conversion to reference type.
template <typename> struct Ref {};
template <typename> struct Val {};
struct Wrapper
{
template <typename U> operator Ref<U> & ();
template <typename U> operator Val<U> ();
};
void Foo (Wrapper l)
{
static_cast <Ref<int> &> (l);
static_cast ... |
google | chromium | spec17 | .C | native_client/nacl-gcc/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 | chromium | ptrmem15 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ptrmem15.C | 197 | utf_8 | fc34e5a77f3c541c87a72c30f4204b25 | // PR c++/19894
template<typename T> struct A
{
T A::* p; // { dg-error "void" }
};
A<void> a; // { dg-message "instantiated" } |
google | chromium | crash12 | .C | native_client/nacl-gcc/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 | chromium | void9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/void9.C | 156 | utf_8 | 42bf2400e0a1970f537c01ac0e7a5a9f | //PR c++/28738
template<int,void> struct A {}; // { dg-error "not a valid type" }
template<int N> struct A<N,0> {}; // { dg-error "not a valid type" }
|
google | chromium | typename18 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typename18.C | 223 | utf_8 | 281d5672faf3e37ce44792d24c1cc723 | // { dg-do compile }
// These typename should work as they are types.
struct A
{
typedef int a;
template <int>
struct f {};
template<int> void foo(int i)
{
typename A::a(i1);
typename A::f<0>(i2);
}
};
|
google | chromium | non-dependent6 | .C | native_client/nacl-gcc/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 | chromium | nontype2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype2.C | 151 | utf_8 | 00bcc57cb7d33b0250bf5efd8de34dbf | template <bool> struct A {};
template <bool> struct B
{
void foo()
{
const int i=0;
typedef A< i<=1 > C;
typedef A< i<=2 > C;
}
};
|
google | chromium | operator2 | .C | native_client/nacl-gcc/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 | chromium | deduce2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/deduce2.C | 478 | utf_8 | 3cc52990bce905a42f91a2dab1c65c77 | template <typename T0> struct tuple {
typedef tuple<int> tail;
};
template <> struct tuple<int> {
};
template <typename L>
struct length {
static const int i = length<typename tuple<L>::tail>::i;
};
template<>
struct length<tuple<int> > {
static const int i = 1;
};
template <int> struct M {};
template <... |
google | chromium | spec27 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/spec27.C | 124 | utf_8 | 5549dda851b53530395009f544d09652 | // PR c++/24139
template<typename T>
struct O {
struct I;
};
template<>
struct O<int>::I
{
I();
};
O<int>::I::I() {}
|
google | chromium | array8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/array8.C | 283 | utf_8 | 9135445bfc294af3cf8b77142f5e8782 | // PR c++/18121
// We were trying to layout the array
// type but since the type/value of A<N>::i
// was not known at template declation type,
// we were crashing
template<int> struct A
{
static int const i = 1;
};
template<int N> struct B
{
typedef int (*p)[A<N>::i];
};
|
google | chromium | pseudodtor4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/pseudodtor4.C | 212 | utf_8 | b2d3a32829fc6808db1b3b6f0e96ef74 | // PR c++/34068
// { dg-do compile }
template <typename> struct A
{
typedef int X;
A () { T (). ~X (); } // { dg-error "there are no arguments to|fpermissive|was not declared in this scope" }
};
A <int> a;
|
google | chromium | spec34 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/spec34.C | 164 | utf_8 | 1503455e6bff13911dd306082359dbdf | // PR c++/26988
struct B{};
struct Bar : virtual B {
template <typename T> Bar( T const& cast );
};
template <> Bar::Bar( int const & cast ) {}
|
google | chromium | ntp1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ntp1.C | 396 | utf_8 | 72688e70f855e78a966cd593acf9f923 | // { dg-do compile }
// PR 35. We were default promoting template PARM_DECLs
template <short B> class R {};
template <class T> class A
{
public:
template <short B>
void operator() (R<B> const &);
};
int main() {
A<int> a;
R<1> r;
a (r);
return 0;
} |
google | chromium | crash19 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash19.C | 310 | utf_8 | f106c764c1ea09eba893e334ab4c71d8 | // PR c++/15165
struct S
{
template <class T> S(const T &e);
};
int operator *(const double, const S &);
template <class T>
struct X {
enum { SIXTY_FOUR=64 };
struct node {
unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
void d() {}
};
node *head;
};
template struct X<int>;
|
google | chromium | typename1 | .C | native_client/nacl-gcc/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 | chromium | crash49 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash49.C | 78 | utf_8 | cf864ea56a274c6c9a392f3a5f2f5910 | // PR c++/27102
template <typename T>
void T::foo; // { dg-error "invalid" }
|
google | chromium | member3 | .C | native_client/nacl-gcc/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 | chromium | spec23 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/spec23.C | 483 | utf_8 | 27f9cbb46ad58d9e144b84e0550d6e27 | struct Foo
{
template <typename T>
Foo (const T &); // { dg-message "T = Bar" }
};
struct Bar
{
template <typename T>
operator T () const; // { dg-message "T = Foo" }
};
Foo Quux (Bar const &b)
{
return b; // { dg-error "ambiguous" }
} |
google | chromium | copy1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/copy1.C | 195 | utf_8 | b01ae36f64077c7d852f5e2037aea1f6 | // { dg-do compile }
// PR 5189
struct A
{
A(A&); // { dg-message "candidate" }
template <class T> A(T);
};
A a = 0; // { dg-error "no matching function" } |
google | chromium | typedef19 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typedef19.C | 378 | utf_8 | 921f2dfc9a3afa3309aa7aac0ef2103d | // Origin PR c++/40007
// { dg-do compile }
class A
{
typedef int mytype; // { dg-error "'typedef int A::mytype' is private" "" { xfail *-*-* } }
};
template <class T>
class B : public A
{
};
template<class T>
class B<T*> : public A
{ // { dg-error "within this context" "" { xfail *-*-* } }
mytype mem;
};
B<int*> b... |
google | chromium | nontype9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype9.C | 221 | utf_8 | 51239a3dafd7ee56283d919ab1900e0a | // { dg-do compile }
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
int i;
template <void (&FN)()>
struct g {
void foo(void) {
FN ();
}
};
void h ()
{
i = 7;
}
template struct g<h>;
|
google | chromium | arg3 | .C | native_client/nacl-gcc/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 | chromium | error36 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error36.C | 203 | utf_8 | a17a0188621ff6205e2133c232c6aa5f | // PR c++/37719.C
template <typename T>
class foo {
void bar() throw(int); // { dg-error "throw \\(int\\)" }
};
template <>
void foo<int>::bar() throw(float) {} // { dg-error "throw \\(float\\)" }
|
google | chromium | instantiate9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/instantiate9.C | 289 | utf_8 | a878afcf9f90a453ed681637411b0961 | /* PR c++/14622. The invalid explicit instantiation was not reported. */
/* { dg-do "compile" } */
template<class T>
class A
{
static T a;
};
template<class T>
T A<T>::a;
struct B {};
template B A<int>::a; /* { dg-error "does not match declared type" } */
template float A<float>::a;
|
google | chromium | call1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/call1.C | 251 | utf_8 | 11d89720e8ea4a5f11553338c13ffab9 | //PR c++/10804
// G++ was not emiting the function foo.
// { dg-do run }
template<class T>
struct A
{
A() { const void (*a)() = foo; }
static const void foo() {}
};
int main(int argc, char *argv[])
{
A<int> a;
} |
google | chromium | incomplete4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/incomplete4.C | 291 | utf_8 | eabe7e04370a04b24f7218770fb6ae2f | // PR c++/33501
// { dg-do compile }
class A; // { dg-error "forward declaration" }
template <typename T> struct X
{
static int f (T);
static const T &make ();
};
int
main ()
{
return X<A>::f (X<A>::make ()); // { dg-error "invalid use of incomplete type|initializing argument" }
}
|
google | chromium | local5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/local5.C | 206 | utf_8 | cdb30bf1f7ce096f5aff97aa15fa35ce | struct Attribute { };
template <class T> bool operator == (const Attribute &attr, const T &value);
enum {
anon = 123
};
void test(int foo)
{
if (foo == anon) ; /* { dg-bogus "anonymous type" } */
}
|
google | chromium | error27 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error27.C | 96 | utf_8 | 585707d1420049ffe49f33789d19dc53 | // PR c++/27211
struct A {};
template<int> void A::foo() {} // { dg-error "member function" }
|
google | chromium | void12 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/void12.C | 121 | utf_8 | 2a5a8ea7e9d97750e220094aef1a6168 | // PR c++/28639
template<void> struct A // { dg-error "not a valid type" }
{
static const int i = 1;
char a[i];
};
|
google | chromium | error22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error22.C | 191 | utf_8 | 54b3e85a8d8f9bc805e7795860ec08ba | //PR c++/27821
struct A
{
template<void (A::*)()> struct B {};
void ::foo(); // { dg-error "invalid use" }
B<&A::foo> b; // { dg-error "incomplete type|template argument" }
};
|
google | chromium | member8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/member8.C | 261 | utf_8 | 0e4a3e1cc8686f6abd2b23333d6678de | // PR c++/35138
// { dg-do compile }
namespace N1 { struct A { }; }
namespace N2 { struct A { }; }
using namespace N1;
using namespace N2;
template <typename T> int
foo (T const &t)
{
return t.A;
}
struct B
{
int A;
};
int
main ()
{
B b;
foo (b);
}
|
google | chromium | ttp16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ttp16.C | 152 | utf_8 | 93f5f30ce330a50c0d7dc80278b3e0d8 | template <template <typename> class C>
void f() {}
template <typename T, typename U = int>
struct S {};
template void f<S>(); // { dg-error "match" }
|
google | chromium | param1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/param1.C | 217 | utf_8 | c0cfbde9ee0e8aa2f87970485b568e4d | // PR c++/22233
// { dg-do compile }
template<int> struct A
{
A();
};
template<int N, char> A<N>::A() {} // { dg-error "got 2|but 1 required" }
A<0> a; |
google | chromium | spec22 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/spec22.C | 605 | utf_8 | 695a1e41c59f2bac005e4788d5a7f4b9 | template <typename T> class srp;
template <typename T> struct ptr
{
template <typename U> ptr(const srp<U> &other); // { dg-message "ptr<T>::ptr" }
};
template <typename T> struct srp
{
template <typename U> operator ptr<U>(void) const; // { dg-message "srp<T>::operator" }
};
ptr<int> parent_get()
{
srp<int> pare... |
google | chromium | dependent-expr6 | .C | native_client/nacl-gcc/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 | chromium | using11 | .C | native_client/nacl-gcc/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 | chromium | typedef25 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typedef25.C | 720 | utf_8 | 7b7d7acd3f627bf5dad56718a978812f | // Origin PR c++/42225
// { dg-options "-std=c++0x" }
// { dg-do compile }
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;
typede... |
google | chromium | ctor4 | .C | native_client/nacl-gcc/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 | chromium | ptrmem4 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ptrmem4.C | 370 | utf_8 | 8ae47dd36706d3817783e1bad776829e | // { dg-do compile }
// PR c++/8849
// Pointer to member function template argument deduction ICE.
template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "candidates" }
struct SpyExample
{
void ready();
void inputs();
};
void SpyExample::ready()
{
queryAliases(inputs); // { dg-error "matching" }
... |
google | chromium | error35 | .C | native_client/nacl-gcc/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 | chromium | builtin1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/builtin1.C | 142 | utf_8 | 479ce6c62d0ab31928edd3bcef27bd5c | // PR c++/26559
template<bool> struct cond;
template<int> struct S {
void f(int i) {
cond<__builtin_constant_p(i)>();
}
};
S<1> s;
|
google | chromium | ttp27 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ttp27.C | 170 | utf_8 | 052744e1f403dbb8b61873044725e659 | // PR c++/35678
template<typename T, T> struct A;
template<typename> struct B;
template<template<typename T, T> class U> struct B<U<char, 'h'> > {};
B<A<char,'h'> > x;
|
google | chromium | crash56 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash56.C | 393 | utf_8 | c24c12b86131d56696207838a75e70c3 | // 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*); }; // { dg-error "lookup finds" "" }
}
template<typename T> void g (N::A *p)
{
(void) A (p); // { dg-erro... |
google | chromium | crash59 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash59.C | 681 | utf_8 | 1453e3b7b4d89a8e161a789b6ab2a65b | //PR c++/27329
template<int> struct A // { dg-error "forward declaration" }
! // { dg-error "expected unqualified-id" }
;
template<int> struct A { int foo(); }; // { dg-error "not a template" }
int i = A<0>().foo(); ... |
google | chromium | crash90 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash90.C | 142 | utf_8 | 7310dea3510c812336ce63b0a3ce4416 | // PR c++/39750
template < unsigned >
struct A ;
template < typename >
struct B ;
template < typename T , A < B < T > // { dg-error "" }
{ }
|
google | chromium | friend33 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend33.C | 165 | utf_8 | ed2b58353effe4479fb3ba174d53040c | // { dg-do compile }
// PR c++/18733: Validation of template headers in friends
template<int> struct A
{
void foo();
};
struct B
{
friend void A<0>::foo();
};
|
google | chromium | array15 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/array15.C | 156 | utf_8 | e9bc7a53116f8cc44a505ea2700b2054 | // PR c++/28595
template<int> struct A
{
static const int i;
};
template<int N> struct B
{
char c[A<N>::i], d; // { dg-error "constant" }
};
B<0> b;
|
google | chromium | dependent-name5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/dependent-name5.C | 1,171 | utf_8 | e11707dffcc625042f15f6d621ee1079 | // PR c++/9634, c++/29469, c++/29607
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR224: Make sure that a name is *truly* semantically dependent.
struct D {
typedef int K;
};
template <typename T>
struct A
{
typedef int Bar;
template <typename>
struct N {};
typedef Bar ... |
google | chromium | crash63 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash63.C | 165 | utf_8 | aa734f014cf5d00d10906b6c35b3de27 | // PR c++/29729
template<typename T> void foo(T)
{
struct A
{
template<int> struct B // { dg-error "local class" }
{
typedef B<0> C;
}
};
}
|
google | chromium | array3 | .C | native_client/nacl-gcc/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 | chromium | defarg3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/defarg3.C | 542 | utf_8 | e55baeaf118c452b9f707b8236ee86b1 | // { dg-do compile }
// PR c++ 11596
template <int V, bool F = V < 1> struct A { enum { value }; };
template <int V> struct B { enum { value = A<1>::value }; };
int ary[!B<1>::value ? 1 : -1];
template <int V, bool F = V < 1> struct A1 { enum { value = 1}; };
template <int V> struct A1<V,false> { enum { value}; };
temp... |
google | chromium | spec3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/spec3.C | 326 | utf_8 | f5581de159c7b5592926840478d5c5fb | // PR c++/3870
// Test that performing a type instantiation in order to match up a
// specialization doesn't clobber last_function_parms.
template <class T>
struct A { typedef int I; };
template <class T>
inline typename T::I
foo (typename T::I, const T*);
template <>
int foo (int i, const A<long>*)
{
return i +... |
google | chromium | union1 | .C | native_client/nacl-gcc/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 | chromium | canon-type-1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/canon-type-1.C | 324 | utf_8 | 2d98bdfa44c532cb4b0e17bf57cbc687 | // Origin PR c++/39754
// { dg-do "compile" }
template < typename > struct A ;
template < typename T , typename = A < T > > struct B { } ;
template < class W , class > struct D
{
typedef W X ;
A<X*> a ;
};
template < class Y > struct E
{
B<Y*> b ;
} ;
E<int> e ; |
google | chromium | friend20 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend20.C | 121 | utf_8 | 9d4f5b3213673d62379489a71f82b196 | template <class T>
struct A
{
friend void bar(A<T> a) {}
};
void bar(A<int>);
int main()
{
A<int> a;
bar(a);
}
|
google | chromium | friend22 | .C | native_client/nacl-gcc/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 | chromium | crash70 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash70.C | 193 | utf_8 | e7c65b521cffd29e1a3625614a4329be | // PR c++/32113
template<int> struct A;
template<typename T> void foo (A<&T::template i>); // { dg-error "not a template" }
template void foo<A<0> > (A<0>); // { dg-error "does not match" }
|
google | chromium | array4 | .C | native_client/nacl-gcc/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 | chromium | nested1 | .C | native_client/nacl-gcc/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 | chromium | unify8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/unify8.C | 479 | utf_8 | d04f9d4f8d36c0325245fb8a7df506ad | // { dg-do link }
// PR 21799: deduction of cvqualifiers on member functions was wrong
template <class T> void f (T &, void (T::*)() );
template <class T> void f (const T &, void (T::*)() const) {}
struct X {
void g() const {}
};
const X *x;
int main () {
f (*x, &X::g);
} |
google | chromium | init7 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/init7.C | 216 | utf_8 | 449f6814f4d979ec3743b87b9b4e5f78 | /* PR c++/31517. This used to ICE. */
/* { dg-do "compile" } */
template<typename> struct A
{
static const int i=0;
};
template<typename T> const int A<T>::i = 0=0; /* { dg-error "duplicate initialization" } */
|
google | chromium | call3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/call3.C | 172 | utf_8 | 938ec709598c5f0853b88b4eb0ccdebb | // PR c++/18436
void foo(int);
struct A
{
static void foo(A);
};
template <typename T> struct B : T
{
B() { foo(T()); } // { dg-error "cannot convert" }
};
B<A> b;
|
google | chromium | complit2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/complit2.C | 204 | utf_8 | 77418f7f80d69270d799af7b1a478dee | // PR c++/31038
// { dg-options "" }
template<int> void foo()
{
int i = (int) { 0 };
}
template void foo<0>();
int f();
template<int> void bar()
{
int i = (int) { f() };
}
template void bar<0>();
|
google | chromium | crash23 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash23.C | 205 | utf_8 | 0ebb4bf976e610e29316a5634702a44e | // PR c++/17642
template<int dim>
int f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d)
{
for (int d=0; d<dim; ++d)
lsh[d] - (bbox[2*d+1] ? 0 : nghostzones[d]);
}
|
google | chromium | spec14 | .C | native_client/nacl-gcc/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 | chromium | memtmpl2 | .C | native_client/nacl-gcc/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 | chromium | nontype1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype1.C | 177 | utf_8 | 0841e0681f53f5792b711984e991f3a8 | // PR c++/4934
// dump_expr didn't know how to deal with a CONVERT_EXPR with no type.
template<unsigned> struct A {};
template<typename T> struct B { A<sizeof(+int())> a; };
|
google | chromium | error30 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error30.C | 138 | utf_8 | 1c44a4e548dcd05ce209cc978411cde0 | // PR c++/33210
template<int> struct A;
template<template<typename> class B> A<B<int>::x> operator() (); // { dg-error "A<B<int>::x>" }
|
google | chromium | memfriend17 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/memfriend17.C | 740 | utf_8 | 30ec1243ed2ec3bf2de0a4ffac633029 | // { dg-do compile }
// PR c++/13495: Nested class as template friend.
template<typename T>
class A{
public:
class B
{
void func1(void);
void func2(void);
};
};
template<typename Q>
class F1
{
friend class A<Q>::B;
enum { foo = 0 }; // { dg-error "private" }
};
template<typename Q>
c... |
google | chromium | qualttp5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/qualttp5.C | 507 | utf_8 | 255bbb87a1cc490d42481388183e9650 | // { dg-do compile }
template <class U> struct A
{
template <class T> class B {}; // { dg-message "candidates" }
};
template <template <class> class TT> void f()
{
TT<int> y;
y = 0; // { dg-error "no match" }
}
template <class T> struct C
{
void g() { f<A<T>::template B>(); } // { dg-message "instantiated" }
};
int... |
google | chromium | nontype16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype16.C | 167 | utf_8 | efe778ec780ff5ae0b39781a917ca677 | //PR c++/27962
template<int> struct A
{
template<typename> void foo();
};
template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type" }
|
google | chromium | error9 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error9.C | 85 | utf_8 | 6c82c4d5cc4e1f6f70e1b41aa6299b35 | // PR c++/10926
struct Foo
{
template <int i>
~Foo(); // { dg-error "" }
};
|
google | chromium | sizeof7 | .C | native_client/nacl-gcc/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 | chromium | static29 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/static29.C | 115 | utf_8 | e9b1989c04a7b26eeb97573f87c42c52 | // PR c++/29570
template<int> struct A { static const int i; };
template<int N> const int A<N>::i = { A<N>::i };
|
google | chromium | crash73 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash73.C | 184 | utf_8 | b6d335f5ace93b3d4a0fd5d2614a2df2 | // PR c++/34100
// { dg-do compile }
template<typename T> struct A
{
typedef typename T::X Y __attribute__((vector_size(8))); // { dg-error "is not a class, struct" }
};
A<int> a;
|
google | chromium | friend16 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend16.C | 320 | utf_8 | 594b1d8549baa1139753596a807dbd91 | // { dg-do compile }
// PR c++/9602: Inline friend/pure virtual tree data sharing in
// class template.
template <typename T> struct X {
void foo (X);
friend void bar () {}
};
template <typename T>
void X<T>::foo (X x) {}
template struct X<int>; |
google | chromium | instantiate3 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/instantiate3.C | 459 | utf_8 | 22f8825ee5e0b4f528d3d4f91590529f | // { dg-do compile }
// PR c++/7639
// ICE when accessing member with incomplete type.
class ACE_Null_Mutex; // { dg-error "forward declaration" }
template <class TYPE>
struct ACE_Cleanup_Adapter
{
TYPE &object ()
{ return object_; } // { dg-error "invalid" }
TYPE object_; // { dg-error "incomplete type" }
};
te... |
google | chromium | func2 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/func2.C | 406 | utf_8 | d68216ca94895657c1d7e1a9deffaa6e | // { dg-do compile }
typedef void (*fptr)();
fptr zeroptr = 0;
template<typename T, fptr F> struct foo { };
template<typename T> struct foo<T,zeroptr> { };
// { dg-error "not a valid template argument" "not valid" { target *-*-* } 6 }
// { dg-error "must be the address" "must be the address " { target *-*-* } 6 }
//... |
google | chromium | typename6 | .C | native_client/nacl-gcc/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 | chromium | init8 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/init8.C | 888 | utf_8 | 64a05fc8eebed95ff925e08b8a3bf935 | // PR c++/36089
// { dg-do run }
extern "C" void abort ();
int f ()
{
const int c(2);
int d[c] = { 0, 0 };
return d[0] + sizeof d;
}
struct A
{
static int f ()
{
const int c(2);
int d[c] = { 0, 0 };
return d[0] + sizeof d;
}
};
template <int> struct B
{
static int f ()
{
const int c ... |
google | chromium | nested5 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nested5.C | 223 | utf_8 | 73ab67ac2716db374ac0d80e7ae5b200 | // PR c++/33959
template <typename T> struct A
{
struct C
{
template <typename U> struct D {};
};
template <typename S> static C::D<S> bar (S const &);
};
struct E {};
int
main ()
{
E e;
A<E>::bar (e);
}
|
google | chromium | sizeof-template-argument | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/sizeof-template-argument.C | 483 | utf_8 | 901ce4250ef5db01f31c0ba99aafac18 | /* This used to ICE (PR c++/29573) */
/* { dg-do "compile" } */
template<int> struct A {};
template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
int a;
tem... |
google | chromium | const1 | .C | native_client/nacl-gcc/gcc/testsuite/g++.dg/template/const1.C | 442 | utf_8 | 2096b2764f21d9bd35c06fef449c8404 | // PR c++/28385
// instantiating op() with void()() was making the compiler think that 'fcn'
// was const, so it could eliminate the call.
// { dg-do run }
extern "C" void abort (void);
int barcnt = 0;
class Foo {
public:
template<typename T>
void operator()(const T& fcn) {
fcn();
}
};
void bar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.