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 | typedef5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef5.C | 431 | utf_8 | c216b7fcf0f0612e246302001f5b0d6f | // PR c++/27572
// { dg-do compile }
template<typedef,int> struct A1; // { dg-error "no type|typedef declaration|default argument" }
template<typedef x,int> struct A2; // { dg-error "type|typedef declaration|default argument" }
template<typedef x[],int> struct A3; // { dg-error "no type|typedef declarat... |
google | android | ref3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ref3.C | 209 | utf_8 | 3fe7102cd5d7b48abace464974ca16c3 | // PR c++/28341
template<const int&> struct A {};
template<typename T> struct B
{
A<(T)0> b; // { dg-error "constant|not a valid" }
A<T(0)> a; // { dg-error "constant|not a valid" }
};
B<const int&> b;
|
google | android | assign1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/assign1.C | 145 | utf_8 | 63a5e3d5f634ef4eb13aa4a9d62a8cd7 | // PR c++/16623
template <int N>
struct C
{
C& operator= (int);
};
template <int N>
C<N>& C<N>::operator= (int)
{
return *this;
}
C<0> a;
|
google | android | init5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/init5.C | 277 | utf_8 | ca8434716aafffaf7e37a7ea8e094cc5 | template<typename T> bool foo()
{
const int i = T();
return i > 0;
} |
google | android | partial12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial12.C | 681 | utf_8 | de5b350b4a291d22a6e427de9a0c69fc | // PR c++/46105
template< typename T >
struct empty { // support class is like stripped-down enable_if
typedef void type;
};
template< class T, typename v = void > // v is always void!
struct element {
typedef typename T::value_type type;
};
template< class T > // T in deduced context, T::element_type is SFI... |
google | android | friend45 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend45.C | 240 | utf_8 | e3a0414fe5ccc0a10aa6656eadd87cec | // PR c++/28025
class BaseSubmit
{
template<class T> friend class PeriodicSubmit;
};
template<class ID>
class ValuesSubmit
{
template<class T> friend class PeriodicSubmit;
};
class A;
class MultiSubmit : public ValuesSubmit<A>
{
};
|
google | android | static25 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static25.C | 143 | utf_8 | 7b985567967838ede5e338abace5eafc | // PR c++/27819
struct A
{
static const char i = 1;
};
template<int> struct B
{
static const int j = A::i;
int x[int(j)];
};
B<0> b;
|
google | android | void4 | .C | toolchain/gcc/gcc-4.8.3/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 | android | error21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error21.C | 244 | utf_8 | d8c534ccbad9bbbc650685d274b0d2ca | // PR c++/20173
template<typename AT>
struct A{
template<typename T>
void function(T){}
};
template<>
template<typename T>
void A<int>::function(T){}
template<>
template<typename T>
void A<double>::function(T*){} // { dg-error "match" }
|
google | android | new3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/new3.C | 333 | utf_8 | e803384df62d31ef9dc9c4a9a02c1eff | extern void *operator new(__SIZE_TYPE__); // { dg-message "note" }
template <class T >
struct C
{
void f() {
int* node;
new (&node) int(0); // { dg-error "new" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
};
void* operator new(__SIZE_TYPE__, void* __p);
void g() {
C<int> c;... |
google | android | canon-type-12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/canon-type-12.C | 205 | utf_8 | febd505492a8fa56d33ac1d2b69dc003 | // { dg-options "-std=c++0x" }
template<class T, T t = (T)0>
struct S
{
void
foo(decltype(t) = t);
};
template<class T, T t>
void
S<T, t>::foo(decltype(t))
{
}
void
bar()
{
S<int> s;
s.foo();
}
|
google | android | enum5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/enum5.C | 311 | utf_8 | 109e68e063340fe9a814b152f4df9eb3 | // { dg-do compile }
// PR c++/14479: Template header check for enum
template <int dim>
struct X {
enum { dimension = dim };
template<int d> void bar ();
};
template <>
template <>
void X<0>::bar<0> () {} |
google | android | access19 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access19.C | 525 | utf_8 | 5ae28145976b0327fd1368c9690c53d4 | /* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
/* { dg-do compile } */
template< class T >
class explicit_t
{
public:
explicit_t( const T& c ): value( c ) { }
operator T&() { return value; }
private:
template< class U >
explicit_t( U t ); /* { dg-error "... |
google | android | nontype22 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype22.C | 226 | utf_8 | 4104efa445f1a5c0a6ea00569a6e73b5 | // PR c++/44629
// The proper mangling is unclear.
template<typename T> int cmp1(T a, T b);
template<typename T, int (*cmp)(T, T) = cmp1> struct A { };
template <typename T> void f (A<T> &);
void g()
{
A<char> a;
f(a);
}
|
google | android | typedef40 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef40.C | 247 | utf_8 | 443d701e91eb8625219ca859d1d03f71 | // PR c++/55058
template <typename T>
struct A { };
template <typename T>
struct B {
B(const A<T> T::* p);
typedef A<T> D;
};
template <typename T>
B<T>::B(const D T::* p) { }
struct C {
C() : e() {};
const A<C> e;
};
B<C> g(&C::e);
|
google | android | dtor3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dtor3.C | 130 | utf_8 | c46251d092a454420a2658cd0fcc8c15 | // PR c++/19762
template<int> struct A { ~A(){} }; // { dg-error "" }
template A<>::~A(); // { dg-error "template|declaration" }
|
google | android | memtmpl1 | .C | toolchain/gcc/gcc-4.8.3/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 | android | qualttp20 | .C | toolchain/gcc/gcc-4.8.3/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 | android | static23 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static23.C | 200 | utf_8 | 55ffcdd6cb9d31737ce21132239b5d71 | // PR c++/26266
template<typename> struct A
{
static const int i = 1;
};
template<typename> struct B
{
static const int j = A<char>::i;
static const int k = int(j);
int x[k];
};
B<char> b;
|
google | android | ctor9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ctor9.C | 153 | utf_8 | 391626574e567f5a13e98f2a2884c8fc | // PR c++/9050, DR 147, 318
struct Y
{
template <typename T> Y (T);
template <typename T> void foo (T);
};
template <> Y::Y<int> (int) { }
|
google | android | instantiate2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate2.C | 255 | utf_8 | 88e1ec74b340410f99e5bf69122404bd | // { dg-do compile }
// PR c++/2862
// Default function argument and template instantiation.
template <int dim> void f (int=0) {}
template void f<1> (); // { dg-error "not match" } |
google | android | array7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array7.C | 175 | utf_8 | 579905889abdf110f78879708a88d557 | // PR c++/16246
template <typename T> void foo (T, T);
template <unsigned N, unsigned M>
int bar( const char(&val)[M] )
{
foo (N,M);
}
int i = bar<10>("1234");
|
google | android | anonunion1 | .C | toolchain/gcc/gcc-4.8.3/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 | android | sfinae12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae12.C | 1,504 | utf_8 | 52f7c4200182090df187eb901e5e01fe | // DR 339
//
// Test of the use of the ternary operator with SFINAE
// Boilerplate helpers
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> str... |
google | android | spec4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec4.C | 291 | utf_8 | 2a1077a58e27e49e8f92e9122c330685 | // { dg-do compile }
// PR c++/2863
// Default function argument and template specialization.
struct X {
template <int dim> void f(int=0);
};
template <> void X::f<1> () {} // { dg-error "(not match|declaration)" } |
google | android | new1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/new1.C | 628 | utf_8 | 57b33208329c8d10ea904c3d123076a9 | // { dg-do run }
// { dg-options "-O2" }
struct Aint
{
~Aint ();
Aint ();
};
Aint::Aint () {}
Aint::~Aint () {}
static int count;
template <class T>
struct A
{
unsigned Blksize() const;
void f()
{
new T[Blksize()];
}
};
template <class T> unsigned A<T>::Blksize () const
{
count++;
return 1;
}
int... |
google | android | crash113 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash113.C | 676 | utf_8 | eefdeb6db423d33961319f597beaebfa | // PR c++/53581
template<class A, int M, int N>
class Child;
template<class A, int M, int N>
class Base
{
public:
Child<A, M, N> operator-(const Base<A, M, N> &m) const
{
Child<A, M, N> diff;
return diff;
}
A test() const
{
return 0;
}
private:
A values[M * N];
};
template<class A, int N>... |
google | android | memfriend4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memfriend4.C | 847 | utf_8 | 9e0baac902249d16ec8e8d97a1ab2371 | // { dg-do compile }
// Member function of class template as friend
template<class T> struct A
{
template <T t> void f();
};
class C {
int i;
template<class T> template <T t> friend void A<T>::f();
};
template<class T> struct A<T*>
{
template <T* t> void f();
};
template<> struct A<char>
{
template <char t> v... |
google | android | static19 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static19.C | 458 | utf_8 | 0cac9c7a335a2eb97f02d3b04f03aa6a | // PR c++/24275
template <bool val> struct bool_var {
static const bool value = val;
};
namespace is_inc_ {
struct any {
template <class T> any(T const&);
};
int operator++(any const&);
template <class T> struct impl {
static T &x;
static const bool value = sizeof(++x) == 1;
};
}
template<ty... |
google | android | explicit-instantiation | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit-instantiation.C | 213 | utf_8 | 740f8870f14cf5cb47de273475c965b1 | // { dg-do compile }
// Fixed: PR 3381
namespace N
{
template<class T>
class A { };
}
template class ::N::A<int>; |
google | android | nontype14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype14.C | 209 | utf_8 | 937af4e6ac2cefe2dff1503c7819130f | // PR c++/23789
template <int W> struct X {
template <int W2>
X< (W+(W&&W) > 1 ? W+(W&&W) : 1)+1>
operator + (const X<W2>&) const;
};
template <int dummy> void foo()
{
X<6> A,B;
A + B;
}
|
google | android | memfriend13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/memfriend13.C | 1,021 | utf_8 | c4970b1b6d217a07e47b93130aff29c2 | // { dg-do compile }
// Nested class template of class template as friend
template <class T> struct A
{
template <class U> struct B
{
void f();
};
};
template <class V> class C {
int i;
template <class T> template <class U> friend struct A<T>::B;
};
template <class T> struct A<T*>
{
template <class U> s... |
google | android | ttp7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp7.C | 602 | utf_8 | 8ef73a0d2fb7b35129f101b657888692 | // { dg-do compile }
// Contributed by Andrew Pinski <pinskia at gcc dot gnu dot org>
// PR c++/13810: ICE while parsing invalid default argument for a
// template template parameter.
struct X;
template<int> struct A {};
template<template<int> class = X > struct B1 {}; // { dg-error "as a default value" }
t... |
google | android | nontype24 | .C | toolchain/gcc/gcc-4.8.3/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 | android | typename16 | .C | toolchain/gcc/gcc-4.8.3/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 | android | unify3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/unify3.C | 286 | utf_8 | 16808e8b62429d390bc5719fd2009b5c | // Test unifying SCOPE_REF.
// { dg-do compile }
template <int n> class A {};
template <int m> class R {};
template <int n> struct Trait { enum {m = n}; };
template <int n> R<Trait<n>::m> f(A<n>);
template <> R<1> f(A<1>) {return R<1>();} |
google | android | instantiate8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate8.C | 522 | utf_8 | 042508c0cf07d253053b9e66234c16c5 | struct no_context {
template< class Event > void no_function( const Event & );
};
template< class Event, class TransitionContext = no_context,
void ( TransitionContext::*pTransitionAction )( const Event & ) = &no_context::no_function< Event > >
struct transition
{
struct EvFlipBit {};
typedef transition<EvFlipBit... |
google | android | ptrmem10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem10.C | 251 | utf_8 | aa534276e0095c6eef1fe985651eee58 | // PR c++/15096
template <typename T_>
class C1
{
public:
C1 ();
~C1 ();
const int C1<T_>::* getPtr () const;
private:
int x;
T_ y;
};
template <typename T_>
const int C1<T_>::* C1<T_>::getPtr () const
{ return &C1<T_>::x; }
|
google | android | crash59 | .C | toolchain/gcc/gcc-4.8.3/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 | android | recurse | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/recurse.C | 712 | utf_8 | b2383a6b8b72c44dc2c314ba40ab4cd6 | // Test for handling of excessive template recursion.
// { dg-options "-ftemplate-depth-50 -O" }
template <int I> struct F
{
int operator()()
{
F<I+1> f; // { dg-error "incomplete type" "incomplete" }
// { dg-bogus "exceeds maximum.*exceeds maximum" "exceeds" { xfail *-*-* } 8 }
... |
google | android | ttp10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp10.C | 555 | utf_8 | 3ef16395deaff8acf9155525bf631589 | // { dg-do compile }
// PR c++/16175: Missing cv qualifier in error message output
template <typename> struct Template {};
template<template<typename> class D>
struct B {
static void foo1(const D<void> *); // { dg-error "const" }
static void foo2(volatile D<void> *);// { dg-error "volatile" }
};
class E... |
google | android | redecl1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/redecl1.C | 75 | utf_8 | c7309345696ac164222361961daab266 | // PR c++/15025
template <int> struct X;
struct X {}; // { dg-error "" }
|
google | android | typedef24 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef24.C | 405 | utf_8 | 9061e33b2fe81615387074facf2e2518 | // Origin PR c++/42225
// { dg-do compile }
template<class T>
struct A
{
typedef T I;
};
template<class T, int>
struct B
{
typedef T TT;
typedef typename TT::I TT_I;
typedef A<TT_I> TA;
};
template<class T>
void
foo()
{
typedef T TT;
typedef typename TT::I TT_I;
typedef A<TT_I> TA;
}
int
mai... |
google | android | ctor2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ctor2.C | 140 | utf_8 | 5a69c7531482ab0af57cca8c90779073 | // { dg-do run }
int i;
template <class T>
struct S
{
S () { i = 1; }
};
static S<int> s[1];
int main ()
{
if (!i)
return 1;
}
|
google | android | pr39425 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/pr39425.C | 353 | utf_8 | 65f61cad906468d3220688454e8f7d0c | // 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 | android | static20 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static20.C | 378 | utf_8 | a86e0443f116a5ab2c8f6e11d42e7473 | // PR c++/24277
template< int Bits > struct uint_t {
typedef unsigned short fast;
};
template < int Bits > struct mask_uint_t {
typedef typename uint_t< Bits >::fast fast;
static const fast sig_bits = 1;
static const fast sig_bits_fast = fast(sig_bits);
};
template < int Bits> int checksum ( ) {
return 1 & m... |
google | android | explicit2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit2.C | 128 | utf_8 | 44f3a8f925589bae9dc773b19a3fd2de | struct X {
template <class B> void foo(B);
};
template <class D>
void bar() {
X().foo<D>(1);
}
template void bar<int> ();
|
google | android | non-dependent11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/non-dependent11.C | 453 | utf_8 | 6f26c028ea69c4705c77b4a0544f848d | // { dg-do compile }
template<int> struct I {
int o ();
int o () const;
};
template <int> void bar (void) {
foo <int, I<1> > (&I<1>::o);
} |
google | android | array21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array21.C | 920 | utf_8 | 00136c7ca590bf08c5e9d3fa200ab503 | // PR c++/42447
template<int>
void* get(int);
template<typename>
struct unique_ptr;
template<typename _Tp>
struct unique_ptr<_Tp[]>
{
typedef int __tuple_type;
void*
get() const
{ return ::get<0>(_M_t); }
__tuple_type _M_t;
};
template <typename T> class dynamic_dispatch;
template <... |
google | android | canon-type-2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/canon-type-2.C | 325 | utf_8 | cb422094173e29b6267dd8e869190b16 | // 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 | android | duplicate1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/duplicate1.C | 126 | utf_8 | 8f66b4b808e15a65e9eb6c04d2d02e4e | //PR c++/19439
template<int> struct A
{
~A() {} // { dg-error "with" }
~A() {} // { dg-error "cannot be overloaded" }
};
|
google | android | error31 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error31.C | 91 | utf_8 | 0f550f42a764725b5ef085971e281ea8 | // PR c++/33493
template<int> void foo() { delete 0 ? 1 : 0; } // { dg-error "delete 0" }
|
google | android | this-targ1 | .C | toolchain/gcc/gcc-4.8.3/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 | android | recurse1 | .C | toolchain/gcc/gcc-4.8.3/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 | android | ttp5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp5.C | 402 | utf_8 | 786176b167efb2fb05f5876afccf4ea7 | // { dg-do compile }
// PR c++/8772: Incorrect diagnostics for template template parameter
// mismatch
template <int> struct A {
template <int> struct B {
enum { v = 1 };
};
};
template <template <int> class F> struct C {
enum { v = F<1>::v || 2 };
};
template <int n> struct D {
enum { v = C<A<n>::B>::v };... |
google | android | error43 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error43.C | 160 | utf_8 | d58d76bac4c95f750552f6b080278a6d | // PR c++/29363
template<int> void foo()
{
throw A(); // { dg-message "declar" }
struct A {} a;
}
template void foo<0>(); // { dg-message "required" }
|
google | android | access27 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/access27.C | 357 | utf_8 | c7c275427c1f23da1f5270746886e61d | // PR c++/57550
template <bool (double)> bool Wrapper(double);
template <class T> void MakeHandler(bool (T));
class Handler
{
public:
template <typename T> static void SetPrimitiveHandlers()
{
MakeHandler(Wrapper<Append<T> >);
}
private :
template <typename T> static bool Append(T);
};
template void Hand... |
google | android | call3 | .C | toolchain/gcc/gcc-4.8.3/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 | android | error12 | .C | toolchain/gcc/gcc-4.8.3/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 | android | friend17 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend17.C | 192 | utf_8 | 28be52aef0745966b3435343b559e859 | template <class T>
struct X {
template <class U> void operator+=(U);
template <class V>
template <class U>
friend void X<V>::operator+=(U);
};
int main() {
X<int>() += 1.0;
}
|
google | android | defarg16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg16.C | 354 | utf_8 | 7db2a0685d8f7b40467764f225a158ca | // PR c++/55127
struct some_class
{
static const bool is_valid_type = true;
};
template< typename Type
, bool Valid = Type::is_valid_type
>
struct wrapper;
template< typename Type >
struct wrapper< Type, true >
{
typedef Type type;
};
template< typename T >
void fun()
{
wrapper<some_class>::type x... |
google | android | koenig7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/koenig7.C | 344 | utf_8 | 2e7cb1dcf45bb8b5519d06247d085cc7 | // PR c++/13549
// We need to do arg-dep lookup for g<T>(j) at instantiation time because
// g<T> is dependent, even though (j) is not; at that point we can find
// g(h).
template <typename T> int g(int);
class h{};
template <typename T> int l(){h j; return g<T>(j);}
template <typename T> int g(const h&);
class j{};
i... |
google | android | spec10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec10.C | 471 | utf_8 | ad21a3b2ad2780aa2209396893143af3 | // { dg-do run }
// PR c++/10940: Problem handling parameter list for static member
// that is a specialization of a member template of a template class.
template<int b>
class o
{
public:
template<typename T> static void do_add(T* p, T v);
};
template<>
template<typename T>
inline void o<32>::do_add(T* p, T v)
{
*p... |
google | android | error34 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error34.C | 725 | utf_8 | 411a4732230a0fbd8972e03886c8d341 | // PR c++/33842
// { dg-do compile }
template<typename T> struct A
{
A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
};
template<typename T> struct B
{
B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
};
template<typename T> struc... |
google | android | crash38 | .C | toolchain/gcc/gcc-4.8.3/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 | android | overload7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/overload7.C | 535 | utf_8 | d98c22f6d2dfeb8d0131c9e0467d2655 | // { dg-do run }
struct A
{
virtual int Foo () { return 1; }
};
struct B : public A
{
virtual int Foo () { return 2; }
};
template <class T>
int Bar (T *a)
{
if (static_cast<A*>(a)->A::Foo () != 1)
return 1;
if (static_cast<A*>(a)->Foo () != 2)
return 2;
return 0;
}
int main ()
{
return Bar (new B);... |
google | android | sfinae14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae14.C | 2,421 | utf_8 | 8cbf9e9ec798570f590ac39820557fc3 | // DR 339
//
// Test of the use of the new and new[] operators with SFINAE
// Boilerplate helpers
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename... |
google | android | spec18 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec18.C | 150 | utf_8 | f9db6cb49e2fa6c6968fe9e4a6f2a111 | // PR c++/17936
template<int, int N> struct A
{
void foo();
};
template<int N> struct A<1, N>
{
void foo();
};
template<> void A<1, 2>::foo();
|
google | android | ptrmem15 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem15.C | 193 | utf_8 | bb20547b52c722a6e10e888f3f6b8bc0 | // PR c++/19894
template<typename T> struct A
{
T A::* p; // { dg-error "void" }
};
A<void> a; // { dg-message "required" } |
google | android | crash47 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash47.C | 95 | utf_8 | ecaf2d9019ae9b82fd94645b37dbc4c9 | // PR c++/27102
template<typename T> void T::X::foo() {} // { dg-error "invalid|not a type" }
|
google | android | dependent-name1 | .C | toolchain/gcc/gcc-4.8.3/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 | android | crash107 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash107.C | 697 | utf_8 | d4dfd09c7d726eae84eba12a9ee0ccfd | // PR c++/44625
// { dg-do compile }
// { dg-options "" }
template<typename FP_> struct Vec { // { dg-message "note" }
Vec& operator^=(Vec& rhs) {
union {
struct {FP_ x,y,z;};
}; // { dg-error "anonymous struct" }
X = y*rhs.z() - z*rhs.y(); // { dg-error "not declared|no mem... |
google | android | sfinae23 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae23.C | 516 | utf_8 | b7eb1eb19931468a6c6037d6f5527f39 | // PR c++/44969
// { dg-options "-std=c++0x" }
template<typename Tp, typename... Args>
class mini_is_constructible
{
typedef char one;
typedef struct { char arr[2]; } two;
template<typename Tp1, typename... Args1>
static decltype(Tp1(Args1()...), one())
test(int);
template<typename, t... |
google | android | typename11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typename11.C | 158 | utf_8 | 420551b6ca8dd7f866b6e96a62a9f7a0 | // PR c++/28999
namespace N
{
template<int> void foo();
}
template<int> struct A
{
friend void typename N::foo<0>(); // { dg-error "type|expected" }
};
|
google | android | deduce2 | .C | toolchain/gcc/gcc-4.8.3/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 | android | static13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/static13.C | 181 | utf_8 | fe8a47b8f67dd5267646e9d0116a86ca | // PR c++/23099
struct Base {
int x;
};
template <typename T>
struct A {
static const int N = sizeof(static_cast<Base*>(T()));
};
struct Derived : Base {
A<Derived*> a;
};
|
google | android | typedef8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef8.C | 447 | utf_8 | 594af50e76fdc8814e78121a8d698078 | // PR c++/34206
template<class _T1, class _T2> struct pair { };
template <class T0, class T1> struct tuple {
template <class U1, class U2>
tuple& operator=(const pair<U1, U2>& k) { }
};
template<class T1, class T2> inline tuple<T1&, T2&> tie(T1& t1, T2& t2) { }
template <class T> struct A
{
typedef T type;
... |
google | android | typedef33 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef33.C | 307 | utf_8 | 1d7cb3a11b396d2a715284cd37246728 | // Origin PR c++/43800
// { dg-do compile }
template<class T, class U=T>
struct V
{
typedef T t_type;
};
template<class T>
class J
{
typedef typename V<T>::t_type t_type;
const t_type& f(); // #0:
private:
t_type b;
};
template<class T>
const typename V<T>::t_type& J<T>::f() {return b;} // #1
|
google | android | instantiate9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate9.C | 287 | utf_8 | af3470ca5b94b44392cb92a00a9fb40f | /* 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 | android | error23 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error23.C | 235 | utf_8 | fa7f4116ebf37e2b57813ba48500f497 | // PR c++/29632
struct nullptr_type {
nullptr_type ( void ) {}
template < typename T >
operator T* ( void ) const {
return ( 0 );
}
} const nullptr_ob;
int main ( void ) {
0 == nullptr_ob; // { dg-error "match" }
}
|
google | android | operator4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/operator4.C | 135 | utf_8 | 7e567ad662951a97d90d67420df1d001 | // PR c++/17068
struct A
{
template<int> void operator()() {}
};
template<typename> void foo()
{
A().template operator()<0>();
}
|
google | android | init8 | .C | toolchain/gcc/gcc-4.8.3/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 | android | asmgoto1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/asmgoto1.C | 175 | utf_8 | 03f049d177796d104aceac695a6617c7 | // PR c++/52247
// { dg-do compile }
template <int N>
bool
bar ()
{
__asm goto ("" : : : : lab);
return true;
lab:
return false;
}
bool
foo ()
{
return bar<0> ();
}
|
google | android | enum6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/enum6.C | 136 | utf_8 | 294cb584d05edd3313c80b73e8cd5f4d | // PR c++/34774
template<int shifts>
struct shift {
enum {
n0 = (unsigned)shifts,
n = n0 ? 0 : n0,
n_comp = -n
} x;
};
|
google | android | ttp23 | .C | toolchain/gcc/gcc-4.8.3/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 | android | ptrmem7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem7.C | 447 | utf_8 | 71bf635a4274ef3549d8487b25847e94 | // { dg-do compile }
// Origin: <togawa at acm dot arg>
// c++/2094: unsupported 'ptrmem_cst' in type unification
struct R
{
int i;
};
struct S
{
int i;
int j;
};
struct S2 : S
{};
template<int S::*p, typename>
struct X
{
X ();
template<typename U> X(const X<p,U> &);
};
X<&S::i,S> x = X<&S::i,S>();
X<&S... |
google | android | param1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/param1.C | 233 | utf_8 | efb971f4591133c5f1a27dea6aeb5d1a | // PR c++/22233
// { dg-do compile }
template<int> struct A
{
A();
};
template<int N, char> A<N>::A() {} // { dg-error "got 2 template parameters|1 required" }
A<0> a; |
google | android | error44 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error44.C | 425 | utf_8 | 2dba86893fc2caac2e1fa6b9418fd32b | // PR c++/32056
template <auto int T> struct A {}; // { dg-error "storage class specified|two or more" }
template <extern int T> struct B {}; // { dg-error "storage class specified" }
template <static int T> struct C {}; // { dg-error "storage class specified" }
template <register int T> struct D {}; // { dg-error "st... |
google | android | member | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member.C | 289 | utf_8 | 06216f93446b1e4df8acba1818eeb751 | // { dg-do compile }
class BIXSet{
int z[4];
public:
void f(BIXSet &other){
z[0]=other.z[0];
}
};
class TestCase2{
public:
BIXSet a,b;
public:
void run(void){
BIXSet x,y;
process(0,x,y);
}
protected:
template<class BS> void process(const int d,BS &en,BS &lb){
a.f(en);b.f(lb);
}
};
|
google | android | cond5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/cond5.C | 128 | utf_8 | b57e771003b4e6bae893080e79c82fbc | // PR c++/18464
struct A
{
A(int);
operator void*() const;
};
template<int> void foo(const A& x) { 0 ? x : (x ? x : 0); }
|
google | android | unify10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/unify10.C | 3,018 | utf_8 | a10ab695633f63b3e958bfb839bf37d7 | // { dg-do compile }
// Origin: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
// and Rene Fonseca <fonseca at mip dot sdu dot dk>
// PR c++/8271: Check cv-qualifiers while unifying pointer to member
// functions.
struct MyClass {
void mMethod() throw() {}
void cMethod() const throw() {}
void vMet... |
google | android | partial7 | .C | toolchain/gcc/gcc-4.8.3/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 | android | partial10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial10.C | 532 | utf_8 | 44ba4af7d52ad0dba69cff7c7d026a77 | // PR c++/35255, DR 115
// { dg-do link }
// 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... |
google | android | error18 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error18.C | 195 | utf_8 | e0e0adf8e99a8d206f7e74340f4b67e5 | // PR c++/20157
template<typename AT>
struct A{
template<typename T>
void function(T);
};
template<>
template<typename ABC,typename DEF>
void A<int>::function(ABC); // { dg-error "match" }
|
google | android | typedef22 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef22.C | 334 | utf_8 | 5fcbf88741a702858c518963fa2bd54e | // Origin: PR c++/14777
// { dg-do compile }
template <typename T>
struct B
{
protected:
typedef int M; // { dg-error "protected" }
};
template <typename T>
struct A : B<T> {
typedef typename B<char>::M N; // { dg-error "context" }
A (int = N ());
};
A<int> a = A<int> (); |
google | android | using23 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using23.C | 344 | utf_8 | b6fd01563ec784b5aec55681183ee573 | // PR c++/57831
struct A {
void f();
};
template <class T> struct B : T {
typedef T base;
using base::f; // If I write "using B<T>::f" it's ok
void g( ) {
B<T>::f(); // This is OK as expected
(this->*&T::f)(); // This is also OK
(this->*&B<T>::f)(); // This causes error
}
};
... |
google | android | member6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member6.C | 205 | utf_8 | ed593b0ea0c7885cd94106b4b24d1173 | // PR c++/29105
struct Observer
{
template < typename T > void observeComponent ();
};
template < typename T >
struct TagFilter : Observer
{
TagFilter ()
{
observeComponent < int > ();
}
};
|
google | android | pr32519 | .C | toolchain/gcc/gcc-4.8.3/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 | android | wrap1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/wrap1.C | 553 | utf_8 | 577a7a4f76f06bf7384ad303d275f983 | // { dg-do compile }
// instance of an actual pattern in 252.eon from SPEC2000
// The last Wrapper<char> once wasn't completed when applying '='.
template <class T>
class Wrapper {
public:
Wrapper (T& a);
Wrapper (const Wrapper<char>& ref);
};
template <class T>
class Element {
public:
T * operator[](int x)... |
google | android | crash27 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash27.C | 97 | utf_8 | 6ef1f361b05f74553ccdc456e5d76ea9 | // PR c++/18586
template <int> struct A {
template <int N> int A<N>::i; // { dg-error "" }
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.