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 | pr32519 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/pr32519.C | 213 | utf_8 | 8610105067210f735139755b222f125e | // PR 32519
// { dg-do compile }
struct B
{
protected:
template <class T> void f (); // { dg-error "protected" }
};
struct D : public B
{
void g (B* b)
{
b->f<int> (); // { dg-error "context" }
}
};
|
google | chromium | conv4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/conv4.C | 440 | utf_8 | 8e48e2a0d63cdb353b4a07380c4cf577 | // { dg-do compile }
// PR 4361. Template conversion operators were not overloaded.
struct C
{
template <typename T2> operator T2 ()
{
return 1;
}
int Foo ()
{
return operator int ();
}
};
struct D
{
int Foo ()
{
return operator int (); // { dg-error "not defined" "" }
}
}; |
google | chromium | arg5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/arg5.C | 170 | utf_8 | 758ffa88d8ad3bfc5f84d3141ceeb13d | // PR c++/30534
// { dg-do compile }
template<bool> struct A;
template<int> void foo()
{
A<__builtin_constant_p(.)> a; // { dg-error "template argument|invalid" }
}
|
google | chromium | nontype3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype3.C | 1,056 | utf_8 | 2c3d3cb13e4af8be22483a8bb60a13d2 | // { dg-do compile }
// { dg-options -std=c++98 }
// Origin: <drow at gcc dot gnu dot org>,
// <giovannibajo at gcc dot gnu dot org>
// c++/13243: Template parameters of non integral or enumeration type can't be
// used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
// invalid too.
templat... |
google | chromium | conv7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/conv7.C | 215 | utf_8 | 94bd39b4081e21725b306825863ab68b | // { dg-options "-fabi-version=0" }
template <typename T> struct S {
struct I{};
operator I* ();
};
template <typename T> struct S2 : S<T> {
operator typename S<T>::I* ();
};
template struct S2<int>;
|
google | chromium | init5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/init5.C | 277 | utf_8 | ca8434716aafffaf7e37a7ea8e094cc5 | template<typename T> bool foo()
{
const int i = T();
return i > 0;
} |
google | chromium | spec9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec9.C | 414 | utf_8 | 03e26c658592047cdea1d686aa9cfacf | // { dg-do compile }
// PR c++/10956: Incorrect template substitution for member template
// specialization inside template class.
template <int> struct C {
template<typename T> void pre_add(T);
};
template<>
template<typename T>
void C<32>::pre_add(T) {
T pre;
}
int main() {
C<32>().pre_add<int>(1);
} |
google | chromium | recurse1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/recurse1.C | 420 | utf_8 | 6a7ca5e4fd47fe37ca29d61be39ecdf2 | // PR c++/5050
// Test for that excessive template recursion does not occur
// because of optimization.
// { dg-options "-ftemplate-depth-1 -O" }
struct ostream {
template<class T> ostream& foo( const T & )
{ return *this; }
};
void foo() {
ostream os;
(os.foo(1)).foo(2);
} |
google | chromium | defarg1 | .C | native_client/pnacl-gcc/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 | chromium | ptrmem16 | .C | native_client/pnacl-gcc/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 | chromium | koenig4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/koenig4.C | 156 | utf_8 | 56c1c2325d188ec369a6eca6c10766b7 | // PR c++/13978
namespace ns {
template <class TP> void func1(TP* t);
struct A {};
}
template < class TP >
void func2() {
func1( new ns::A() );
}
|
google | chromium | friend13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend13.C | 348 | utf_8 | 443d8784ec310c25ee130df06beefdd0 | // { dg-do compile }
// Perform access checking to parameter and return type of
// function template correctly when only specialization is friend.
template <class T>
typename T::Inner
foo () {
return typename T::Inner();
}
class Outer {
private:
struct Inner {};
friend Outer::Inner foo<Outer> ();
};
v... |
google | chromium | canon-type-6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/canon-type-6.C | 352 | utf_8 | c54175875559dba3c1940b58610bf79a | // Origin PR c++/39754
// { dg-do compile }
struct Foo {};
template<typename> struct A ;
template<typename T ,typename = A<T> > struct B { } ;
template<class W, class>
struct D
{
typedef W X;
A<void (Foo::*) (X)> a;
} ;
template<class Y>
struct E
{
B<void (Foo::*) (Y)> b;
};
E < int > e ; |
google | chromium | delete1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/delete1.C | 172 | utf_8 | 08e2480f72bcb72f3f0c69f74625bd4c | // PR c++/15890
template < typename T >
void operator delete ( void* raw ) { // { dg-error "" }
delete raw;
}
class A { };
int main() {
A* a = new A;
delete a;
}
|
google | chromium | partial2 | .C | native_client/pnacl-gcc/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 | chromium | ptrmem22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem22.C | 597 | utf_8 | 1deaba7f1445a234a33b8d445f9ce048 | // PR c++/44778
enum Healpix_Ordering_Scheme { RING, NEST };
class Healpix_Base
{
protected:
Healpix_Ordering_Scheme scheme_;
int nest2ring (int pix) const;
int ring2nest (int pix) const;
typedef int (Healpix_Base::*swapfunc)(int pix) const;
};
template<typename T> class Healpix_Map: public He... |
google | chromium | crash38 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash38.C | 167 | utf_8 | df38e330499294dc7efff5c11e5c3530 | // PR c++/23307
class A
{
template<class R>
static void f(X&); // { dg-error "" }
inline void A::f<void>(X&); // { dg-error "f|expected|not been declared" }
};
|
google | chromium | crash55 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash55.C | 219 | utf_8 | 76422d9ef3fa61436a0439bfaab2d350 | //PR c++/27668
template<typename class T, T = T()> // { dg-error "nested-name-specifier|two or more|valid type" }
struct A {};
template<int> void foo(A<int>); // { dg-error "mismatch|constant|template argument" }
|
google | chromium | scope3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/scope3.C | 170 | utf_8 | a7bf058a51ee7236a37311a73bf15c69 | // PR c++/41038
struct S
{
int size() const;
};
template<typename T>
struct Packer
{
int foo() {
return Packer::var.size();
}
const S& var;
};
|
google | chromium | injected2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/injected2.C | 172 | utf_8 | 32e85a6cdf780ae9bb7fc2da0ff02cee | // DR 1004
template <class T, template<class>class U = T::template B> struct A { };
template <class T> struct B {
template <class U> friend struct B;
};
A<B<int> > a;
|
google | chromium | friend52 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend52.C | 175 | utf_8 | 7f28d81dd24446e217e792a31a338161 | // PR c++/50344
// { dg-options "" }
template <typename T> class C
{
friend T;
int i;
};
struct S
{
int f()
{
C<const S> c;
return c.i;
}
};
|
google | chromium | memclass1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memclass1.C | 386 | utf_8 | 8dca5b65d4eeaa3cbfa61a1861a850d2 | // { dg-do compile }
// PR c++/10555: ICE for member class template when one of the
// template argument levels contains errors.
template <typename> struct A
{
template <typename> struct B;
};
template <typename T> struct C
{
typedef typename A<T>::template B<U> X; // { dg-error "declared|invalid" }
};
C<void> ... |
google | chromium | crash104 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash104.C | 394 | utf_8 | 1225a54926913e691b51137aef8b5d33 | // PR c++/46046
template <class T>
struct foo
{
template <class U, class V = void>
struct type
{};
template <class V>
struct type<
typename T::template some_type<int>,
V
>
{};
};
template <class T>
class bar
{};
int main()
{
typedef foo<bar<i... |
google | chromium | anonunion1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/anonunion1.C | 288 | utf_8 | 1b5ce78d8567e9f4897688b5a5aef3c0 | // PR c++/47303
// { dg-do compile }
// { dg-options "-fabi-version=1" }
struct Z
{
void foo (int);
};
struct F
{
typedef void (Z::*zm) (int);
typedef void (F::*fm) (int);
template <zm>
void bar (int)
{
union
{
Z z;
};
}
};
F::fm m = &F::bar <&Z::foo>;
|
google | chromium | new6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/new6.C | 145 | utf_8 | 4072e1463163161bf945071e8def04c3 | // PR c++/27713
// { dg-do compile }
struct A
{
template<int> friend void* operator new(__SIZE_TYPE__); // { dg-error "invalid template" }
};
|
google | chromium | qualttp17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp17.C | 455 | utf_8 | f6386fff12139cd2f16e3ef57915da43 | // { dg-do compile }
// { dg-options "-fno-inline -fabi-version=1 -Wno-abi" }
struct A
{
template <class T> class B {};
};
template <template <class> class TT> struct X
{
};
template <class T> void f(X<T::template B>)
{
}
int main()
{
X<A::B> x;
f<A>(x);
}
// { dg-final { scan-assembler "\n_?_Z1fI1AEv1XIN1T1BEE\[: \... |
google | chromium | friend32 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend32.C | 372 | utf_8 | 4b2faf990ece399ef653adf003ad8e5c | // { dg-do compile }
// PR c++/18825: ICE member as friend
template<class T> class A
{
void f (); // { dg-error "private" }
};
template<class T> class B
{
friend void A<T>::f (); // { dg-error "this context" }
};
int f ()
{
B<int> b; // { dg-message "required" }
} |
google | chromium | member5 | .C | native_client/pnacl-gcc/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 | chromium | ctor5 | .C | native_client/pnacl-gcc/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 | chromium | ttp1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp1.C | 179 | utf_8 | 016674e9e056bbda052e457c8bf91720 | // { dg-do compile }
template <template <typename T> class A >
class B : virtual A<void>
{
typedef int INT;
INT i;
}; |
google | chromium | void6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/void6.C | 81 | utf_8 | 3e91aaf45c71ca012016688078a0eac0 | //PR c++/28594
template<void, int> struct A; // { dg-error "not a valid type" }
|
google | chromium | static24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static24.C | 211 | utf_8 | 50003a8a22751483a8181b5d2eebb900 | template<typename> struct A;
template<> struct A<char>
{
static const char i = 1;
};
template<typename T> struct B
{
static const int j = A<T>::i;
static const int k = int(j);
int x[k];
};
B<char> b;
|
google | chromium | this-targ1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/this-targ1.C | 224 | utf_8 | 2633475e196e36c058cf618a862c925f | // PR c++/47904
template <bool>
struct S
{
};
template <class T>
class U
{
T t;
int foo () const
{
S <sizeof (t) == 1> s;
return 1;
}
int bar () const
{
S <sizeof (t) == 1> s;
return 1;
}
};
|
google | chromium | ttp18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp18.C | 122 | utf_8 | 51fb7506cb7843ab4fdf09b9c85c1544 | template <template <typename> class T>
void f(T<int>) {}
template <typename T>
union U {};
void g() {
f(U<int>());
}
|
google | chromium | ttp4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp4.C | 334 | utf_8 | ab6711e26bfa413d472fc55475e7cc75 | // { dg-do compile }
// PR c++/6723
// ICE when default template argument contains instantiation of
// template template parameter.
template <typename A, typename B,
template <typename,typename> class Predicate,
bool _matches=Predicate<A,B>::answer>
struct helper { }; |
google | chromium | nontype24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype24.C | 168 | utf_8 | 9b952f9c7bfac2154aa77f23f13c1fd3 | // PR c++/49808
template <class X, X g>
struct A
{
A() { float r = g(0); }
};
struct f_t
{
float operator() (float) const { return 1; }
};
f_t f;
A<f_t&, f> x;
|
google | chromium | memfriend15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memfriend15.C | 526 | utf_8 | 2f6bfd79513e89f2607e42561cd9acaa | // { dg-do compile }
// Nested class of class template as friend
template<class T> struct A
{
struct B1
{
};
struct B2
{
void f();
};
};
class C {
int i; // { dg-error "private" }
template<class T> friend struct A<T>::B1;
};
template<class T> void A<T>::B2::f()
{
C c;
c.i = 0; // { dg-error "con... |
google | chromium | invalid1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/invalid1.C | 276 | utf_8 | 1b62efdc0a239bb15d76fcf36d229cc0 | // PR c++/14883
// { dg-options "-std=gnu++98" }
template < class T > struct DomainTraits {};
template < int Dim > class Interval;
template < class DT > class Domain {};
template <> class Interval < 1 >:public Domain < DomainTraits < Interval < 1 >
>> {}; // { dg-error "" }
|
google | chromium | typedef37 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef37.C | 1,030 | utf_8 | eb3abfc5e71e3a935092fd52c8240bfb | // Origin: PR c++/47398
// { dg-do compile }
template<int>
struct A
{
typedef int INT;
};
template<int I>
struct transform
{
static int bar();
};
template<class T, int a, class U, int b>
struct B
{
typedef typename A<a>::INT TINT;
void baz();
};
template<class T, int a, class U>
struct B<T, a, U, 1>
{
typ... |
google | chromium | ttp23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp23.C | 290 | utf_8 | 57ae593180f6b5bf59a305af1a280c02 | // PR c++/29236
template <typename T> struct A {};
template <template <typename> class P>
struct B {
template <template <typename> class Q>
friend bool foo (const B<Q>& a);
};
template <template <typename> class Q>
bool foo (const B<Q>& a);
void bar () {
B<A> a;
foo (a);
}
|
google | chromium | crash3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash3.C | 94 | utf_8 | 18fc9fd079fbcb8ff4e2ad941df67718 | struct S {
};
extern S i[];
void g (S*);
template <typename T>
void f () {
g (&i[2]);
}
|
google | chromium | access21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/access21.C | 230 | utf_8 | 43eff768ad4b6ca2454cbc1618596fb1 | // PR c++/48884
class X
{
static const int I = 42;
friend struct Y;
};
template <int I> struct A { };
struct Y
{
template <typename T>
static A<T::I> f(T t)
{
return A<T::I>();
}
};
int main()
{
Y::f(X());
}
|
google | chromium | error7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error7.C | 145 | utf_8 | 3eacbecd65bcd0b71a23a9e2127f6e27 | // PR c++/13314
// { dg-options "-O2" }
struct A { template <int> struct B; };
struct A::B {}; // { dg-error "" }
A::B<0> b; // { dg-error "" }
|
google | chromium | defarg14 | .C | native_client/pnacl-gcc/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 | chromium | partial5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/partial5.C | 457 | utf_8 | c22dcd4b931c3e20f660aa27686f9a87 | // PR c++/33964
template<typename T>
struct X { };
template<typename T>
struct X<typename T::foo> { }; // { dg-error "not used|T" }
template<int N>
struct X<int[N]> {}; // okay
template<typename T, typename T::foo V>
struct Y { };
template<typename T, typename U, U v>
struct Y<T, v> { }; // { dg-error "not used|U... |
google | chromium | friend15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend15.C | 374 | utf_8 | 3655d8a40b65ebe83179f91b88fe99ac | // { dg-do compile }
// PR c++/9453
// Access checking when template friend is defined in class.
template <typename> class X {
private:
struct Inner;
template <typename R>
friend typename X<R>::Inner * foo () { return 0; }
};
template class X<void>;
struct U {
void bar () { foo<void> (); }
}; |
google | chromium | operator5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/operator5.C | 317 | utf_8 | 0e11abfb73c96739ad546cd85ff3c2e6 | struct A {
int operator() ();
};
template <int> void foo () {
A &a = *new A();
const int i = a();
} |
google | chromium | dtor6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/dtor6.C | 368 | utf_8 | 7dd092349bfef88439bfb6fe8f98d0e7 | // PR c++/40139
template<int> struct A
{
static int i;
};
template<int N> int A<N>::i = { A::~A }; // { dg-error "non-static member function" }
template class A<0>;
struct X { };
int i1 = X::~X; // { dg-error "non-static member function" }
int i2 = &X::~X; // { dg-error "address of destructor" }
int i3 = &A<0... |
google | chromium | typedef18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef18.C | 340 | utf_8 | b09a6dae97faa259ed5be887a5dd1914 | // Origin PR c++/40007
// { dg-do compile }
template<typename T>
struct x
{
protected:
typedef int type;
};
template<typename T>
struct y : public x<T>
{
typename x<T>::type z;
};
template<>
struct y<void> : public x<void>
{
typedef x<void>::type z;
};
template class y<int>; |
google | chromium | ttp26 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp26.C | 209 | utf_8 | 441677b54d35c8c2843c3ae2399b893b | // PR c++/34052
template<typename T = int, typename U> class C; // { dg-error "no default argument" }
template<template<typename T = int, typename U> class C> struct X; // { dg-error "no default argument" }
|
google | chromium | qualttp9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp9.C | 318 | utf_8 | 7dc718c320c7bd11e7b6d87b14c6bdc3 | // { dg-do compile }
template <template <class> class TT> class C {
};
template <class T> struct D : T {
C<T::template B> c;
};
struct E {
protected:
template <class T> class B {};
};
D<E> d; |
google | chromium | fn-ptr1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/fn-ptr1.C | 78 | utf_8 | fe166f987dc66815758e22b930f6d98b | // PR c++/48162
struct A { };
A (*f)();
template <class T> void g() { f(); }
|
google | chromium | static31 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static31.C | 393 | utf_8 | 0a00544e785dd73fd42954ca54bb51e0 | // PR c++/32674
class C
{
static const int j = 3;
};
template<int> class A
{
static const int i1;
static const int i2;
static const int i3;
static const int i4;
};
template<int N> const int A<N>::i1(C::j);
template<int N> const int A<N>::i2 = C::j;
template<int N> const int A<N>::i3(C::j, 5); // { dg-error... |
google | chromium | error41 | .C | native_client/pnacl-gcc/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 | chromium | canon-type-11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/canon-type-11.C | 479 | utf_8 | 839b78a8760c0ceeabf6faa7c1d3df53 | // { dg-do compile }
template<class T>
struct C
{
void bar();
};
template<class T>
void
C<T>::bar()
{
}
template<class U,
template<class TT0_T0> class TT0 = C,
template<class TT1_T0> class TT1 = TT0>
struct S
{
C<U> s;
void foo(TT1<U>);
void bar()
{
foo(s);
}
};
template<class T,
template<class TT... |
google | chromium | fnspec1 | .C | native_client/pnacl-gcc/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 | chromium | new7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/new7.C | 180 | utf_8 | e8027e6b33f47fe2a7c9fdde940f6189 | // PR c++/27714
template<typename> struct A
{
static void* operator new(__SIZE_TYPE__);
template<typename T> friend void* A<T>::operator new(__SIZE_TYPE__);
};
A<int> a;
|
google | chromium | sfinae18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sfinae18.C | 233 | utf_8 | c69bb3273ce27c4b44754551d50caaf4 | // PR c++/41468
typedef int Ft(int);
struct A { operator Ft*(); };
struct B { operator Ft*(); };
struct C : A, B { };
template<typename C> void f(int (*a)[sizeof(C()(0))]);
template<typename C> void f(...);
int main() { f<C>(0); }
|
google | chromium | cond7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/cond7.C | 206 | utf_8 | 4adf5b8994d7d8d914745e2569281502 | // PR c++/34270
// { dg-do compile }
// { dg-options "" }
void foo ()
{
__typeof__ (0 ?: 0) x;
__decltype (0 ?: 0) y;
}
template<int> void bar ()
{
__typeof__ (0 ?: 0) x;
__decltype (0 ?: 0) y;
}
|
google | chromium | crash71 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash71.C | 99 | utf_8 | 2376caa5d87197c3b097e52d7366811e | // PR c++/30659
extern "C" template A<char> foo(); // { dg-error "forbids|static data|expected" }
|
google | chromium | static12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static12.C | 201 | utf_8 | 97b78f3262c5a9c8ea6c35ce97b1d10d | // PR c++/18470
template<typename> struct A
{
static const int i=1;
};
template<typename T> struct B : A<T>
{
using A<T>::i;
char s[i]; // fails
char t[A<T>::i]; // compiles
};
|
google | chromium | ptrmem2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem2.C | 418 | utf_8 | af6766db6bcf0d158ef96c3e85df7e6b | // { dg-do compile }
// We'd tsubst a pointer to member reference
struct A {};
template <typename T> T A::* Foo (); // { dg-error "reference" }
void Baz ()
{
Foo <int &> (); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 14 }
} |
google | chromium | crash36 | .C | native_client/pnacl-gcc/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 | chromium | crash9 | .C | native_client/pnacl-gcc/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 | chromium | defarg6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/defarg6.C | 508 | utf_8 | 8027f8619f5cb154069051c6e3cd6221 | enum X{ a, b, c };
struct C
{
static void func (X &ref = a); // { dg-error "default argument" "" }
};
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 "default argument" "" }
} |
google | chromium | qualttp20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp20.C | 797 | utf_8 | ef7349a159d60a688d713b38b11fe2b4 | // { dg-do compile }
// { dg-options "-pedantic -pedantic-errors" }
// PR 2645
struct AS
{
typedef void (myT) ();
struct L {};
};
template <typename T> struct B1 : T
{
typedef typename T::L __restrict__ r;// { dg-error "'__restrict__' qualifiers cannot" "" }
typedef typename T::myT __restrict__ p;
// The f... |
google | chromium | operator9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/operator9.C | 280 | utf_8 | 531b9dd05d20385dc30e947b3b6af083 | //PR c++/27670
template<operator+> void foo(); // { dg-error "before|non-function|template" }
void bar()
{
foo(); // { dg-error "no matching function" }
// { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 7 }
}
|
google | chromium | sizeof3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sizeof3.C | 201 | utf_8 | f6e095b160ad28af4c90a4545b086bc6 | // The call to f is not potentially evaluated (3.2), so f<int> is not used,
// so it should not be required.
template <class T>
T f (T)
{
typename T::X x;
}
int main()
{
int i = sizeof (f(0));
}
|
google | chromium | friend24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend24.C | 408 | utf_8 | c81920c34b3ea8295fc494118d9e89af | // { dg-do compile }
// PR c++/495: Fail to locate primary class template that is
// injected by friend declaration.
template <int N> struct X
{
template <int dim> friend struct Y;
};
X<2> x;
template <int dim> struct Y
{
void f (Y);
void g (Y);
};
template <int dim> void Y<dim>::f (Y)
{
}
template <int dim> void... |
google | chromium | ctor8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ctor8.C | 177 | utf_8 | 4ed33c1007f1b16ad7f6fa2811b165ba | // PR c++/28711
// { dg-do compile }
// { dg-options "" }
template<int> struct A
{
int x[1][1];
A() : x((int[1][]){{0}}) {} // { dg-error "except the first" }
};
A<0> a;
|
google | chromium | crash18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash18.C | 329 | utf_8 | 3a58be91fa3ebac110f04aa317762b98 | // { dg-do compile }
// Contributed by: <leif dot lonnblad at thep dot lu dot se>
// PR c++/15064: typeid does not form an integral constant expression
#include <typeinfo>
template <typename T>
void dummy() {
const std::type_info& t = typeid(T);
const std::type_info& t2 = typeid(float);
}
template void dummy<int... |
google | chromium | memtmpl1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memtmpl1.C | 360 | utf_8 | a028161f345a592e44b9dd2c85780ba8 | // { dg-do compile }
// PR 11347. ICE in tsubst
template <class T> struct T1 {
enum {N};
};
template<class T> struct T2 {
template <class S, bool Z = T1<S>::N + 1> struct B {};
struct C {};
};
T2<int> t;
T2<int>::B<int> s; |
google | chromium | crash67 | .C | native_client/pnacl-gcc/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 | chromium | inherit7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/inherit7.C | 242 | utf_8 | 512af16a8d227668dfd611f18408ff34 | // Origin: PR c++/48656
// { dg-options "-std=c++0x" }
// { dg-do compile }
struct A {
int f();
int f(int);
};
template <typename> struct B : A
{
};
template <typename T> struct C : B<T>
{
void
g()
{
A::f();
}
};
|
google | chromium | repo3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/repo3.C | 324 | utf_8 | 8a2e51baf8c1d282bb93044b215b3c77 | // { dg-options "-frepo -DF='a'" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template <typename A, typename B> void f () {}
template <typename A, typename B> void g () { f<int,int>(); }
int main () { g<int,int>(); }
char c = F;
// { dg-final { cleanup-repo-files ... |
google | chromium | static1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static1.C | 112 | utf_8 | 0511bd747b9cf7ef36970e1f15d3bb0b | template <typename T> struct A
{
static const int t[1][1]={{0}}; // { dg-error "brace-enclosed|in-class" }
};
|
google | chromium | error29 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error29.C | 175 | utf_8 | f942827c4c8f49e463f6196ed54942bb | // PR c++/33209
template<typename T> void foo(int, T::x); // { dg-error "T::x" }
template<template<typename> class T> void foo2(int, T<int>::x); // { dg-error "T<int>::x" }
|
google | chromium | friend27 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend27.C | 308 | utf_8 | 5d0b7c7f0422e1347c115a5773dea497 | // PR c++/15265
enum Relation {equalOp};
template<typename B>
class A {
public:
static
bool Relop(const A&, const A&, Relation);
friend
bool operator==(const A& a1, const A& a2) {
return Relop(a1, a2, equalOp);
}
B* b;
};
int main() {
A<int> a; a == a;
return 0;
}
|
google | chromium | expr1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/expr1.C | 184 | utf_8 | d9a08dd82988a25d2840d767d582837f | // PR c++/18161
// { dg-options "" }
template <class T> struct Y;
template <> struct Y<bool> {};
template <typename T = typeof (1 == 1)> struct X { Y<T> a; };
template struct X <>;
|
google | chromium | sizeof1 | .C | native_client/pnacl-gcc/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 | chromium | crash102 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash102.C | 116 | utf_8 | f75072de1c2abdfca708b732cbfafa89 | // PR c++/45043
template < typename > class A;
template < typename T > A < T >::B::~B () // { dg-error "type" }
{}
|
google | chromium | repo2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/repo2.C | 438 | utf_8 | 5126d45ee77f7897ba034d0dea05e3dc | // PR c++/17163
// { dg-options "-frepo" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template <int __inst>
struct __Atomicity_lock
{
static unsigned char _S_atomicity_lock;
};
template <int __inst>
unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
te... |
google | chromium | error12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error12.C | 81 | utf_8 | 6fe651ff5a3f3b8ff9d8a9597b35e055 | // PR c++/15044
template class <num_t> class a { num_t n; } // { dg-error "" }
|
google | chromium | pseudodtor1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/pseudodtor1.C | 431 | utf_8 | b1805d4b386b8dcd432f41c68e255100 | // PR c++/32384
// { dg-do compile }
struct A
{
typedef int T;
T foo ();
A () { foo ().~T (); }
};
template<typename> struct B
{
typedef int T;
T foo ();
B () { foo ().~T (); }
};
template<typename T> struct C
{
T t;
C () { t.~T (); }
};
template<typename S> struct D
{
typedef int T;
S foo ();... |
google | chromium | unify5 | .C | native_client/pnacl-gcc/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 | chromium | partial11 | .C | native_client/pnacl-gcc/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 | chromium | strlen1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/strlen1.C | 119 | utf_8 | 3a8d2192bd70af17c62b2fedd505e1e1 | template <typename A1>
void monk2 (A1) {}
unsigned int strlen (const char*);
void monk ()
{
monk2 (strlen (""));
}
|
google | chromium | crash99 | .C | native_client/pnacl-gcc/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 | chromium | local6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/local6.C | 641 | utf_8 | 4419b1a0c4d0571cfe9b43906ee4cff8 | template <class T> struct PCVector2 // { dg-message "note" }
{
template <class T2> PCVector2(const PCVector2<T> &cv) ; // { dg-message "note" }
PCVector2<T> operator- (const PCVector2<T> &ov) const
{
return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "matching" }
// { dg-message "(candidate|expe... |
google | chromium | using15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/using15.C | 291 | utf_8 | d1497117d36ab359ffab3550670a6ba3 | // Reduced from the testcase for c++/29433
template <class T>
struct A: T
{
void f(typename T::type);
using T::f;
void g() { f(1); }
};
template <class T>
struct B: T
{ typedef int type; };
struct C
{
typedef double type;
void f();
};
int main()
{
A<B<A<C> > > a;
a.g();
}
|
google | chromium | memclass2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memclass2.C | 360 | utf_8 | cdd15f6514749074086ff789caa565f2 | namespace ns {
template<typename T>
struct Foo {
template<typename U> struct Bar;
};
template<typename T>
template<typename U>
struct Foo<T>::Bar {
template<typename V> struct Baz;
};
template<typename T>
template<typename U>
template<typename V>
struct Foo<T>::Bar<U>::Baz {
Foo<... |
google | chromium | partial7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/partial7.C | 180 | utf_8 | 27869f98e951e86a28a79500f1a221da | // PR c++/43559
template<typename T, typename U> void f(U&) { }
template<typename T, typename U> void f(T const&) { }
int main()
{
int a;
f<int, int const>(a);
}
|
google | chromium | spec21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec21.C | 554 | utf_8 | b03d3fac8b47ebc0e95fe00fc6b76bb1 | // { dg-do run }
// DR214
template <class T> T f(int) {return 0;}
template <class T, class U> T f(U){return 1;}
template <typename T, typename R> T checked_cast (R const &) {return 0;}
template <typename T, typename R> T checked_cast (R *) {return 1;}
int main ()
{
int i = 0;
if (f<int>(1))
return 1;
if (c... |
google | chromium | partial4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/partial4.C | 306 | utf_8 | dbd288590e967c40dee79909821124df | // PR c++/25342
template < typename eval >
struct tpl_seq_search {
typedef typename eval::enum_type Enum;
template < Enum first, Enum last >
struct range {
};
template < Enum val >
struct range<val,val> {
};
};
struct xxx {
typedef int enum_type;
tpl_seq_search<xxx>::range<0, 1> a;
};
|
google | chromium | typedef21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef21.C | 157 | utf_8 | 7e520cd2a2f5f287069b2ee21c8ea862 | // PR c++/37037
typedef void F(void);
template <typename T> struct S
{
static F f;
};
template class S<int>;
template <class T> void S<T>::f(void)
{}
|
google | chromium | ptrmem12 | .C | native_client/pnacl-gcc/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 | chromium | call4 | .C | native_client/pnacl-gcc/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 | chromium | typename16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typename16.C | 429 | utf_8 | 72f97d6e8b102635f9bd980db11112f9 | // PR37314 rejects-valid, from w.doeringer
template <typename T>
struct A {
typedef __PTRDIFF_TYPE__ difference_type;
struct B {
typedef typename A<T>::difference_type difference_type;
difference_type operator-(B const&) const;
T t;
};
};
//
template <typename T>
typename A<T>::B::difference_type A... |
google | chromium | member9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/member9.C | 327 | utf_8 | 807c0634d8537b12659c5c1e5946086a | // Origin PR c++/48838
// { dg-do compile }
class DUChainItemSystem
{
public:
template<class T>
void registerTypeClass();
static DUChainItemSystem& self();
};
template<class T>
struct DUChainItemRegistrator
{
DUChainItemRegistrator()
{
DUChainItemSystem::self().registerTypeClass<T>();
... |
google | chromium | friend23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend23.C | 565 | utf_8 | 7ad7118de3eccd5d74c51db173d4e326 | // { dg-do compile }
// PR c++/11876: Friend of its own class diagnostics
template <typename T>
class A
{
friend class A<int>;
friend class A<float>;
protected:
T _data;
inline A() : _data(0) {}
template <typename U>
inline A(const A<U>& r) : _data(r._data) {}
};
class B : public A<int>
{
public:
inline B() {}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.