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
array7
.C
toolchain/gcc/gcc-4.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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
ref8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ref8.C
118
utf_8
a83323a3a58fc6939825b82ec71d661a
// PR c++/60222 template<int&> struct A { template<typename> struct B; template<typename T> struct B<T*> {}; };
google
android
defarg16
.C
toolchain/gcc/gcc-4.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/gcc/testsuite/g++.dg/template/sfinae23.C
523
utf_8
d3563277f19308849fcd4549cbe2c20d
// PR c++/44969 // { dg-do compile { target c++11 } } 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<type...
google
android
typename11
.C
toolchain/gcc/gcc-4.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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.9/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
crash117
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash117.C
142
utf_8
c46bfc45cf117d650bdd4a356b6c84a3
// PR c++/58649 template<typename> void foo() { E(); // { dg-error "declaration|declared" } enum E {}; } template void foo<int>();
google
android
crash27
.C
toolchain/gcc/gcc-4.9/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 "" } };
google
android
operator11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/operator11.C
394
utf_8
eb35e1face3b65b2aae71fc55558b420
// PR c++/48594 // Test for uses of (X->*Y)() that don't actually involve a // pointer to member function. struct A { } a; struct B { } b; struct C * cp; struct Func { void operator()(); }; Func operator->* (A, int); typedef void (*pfn)(); pfn operator->* (B, int); pfn C::*cpfn; Func C::*cfunc; template <class T> ...
google
android
repo6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo6.C
432
utf_8
936f4808a4e8d1dca305df8e8a638a2a
// PR c++/34178 // { dg-options "-frepo" } // { dg-final { cleanup-repo-files } } // { dg-require-host-local "" } // { dg-skip-if "dkms are not final links" { vxworks_kernel } } template<typename T> class A { private: static const int x; static int y; public: int getX () { return x + y; } }; template<typename ...
google
android
strlen1
.C
toolchain/gcc/gcc-4.9/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
android
access4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access4.C
354
utf_8
7ea6af968e54287945d17d2352e36fd6
// { dg-do compile } // PR c++/7347 // Access control for typename during instantiation template <int dim> class Base { protected: typedef int T; }; template <int dim> class D : public Base<dim> { public: typedef typename Base<dim>::T T1; D (T1 t); }; D<2> d(1);
google
android
friend41
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend41.C
131
utf_8
7fe00e3075eb0a577c681969f5282929
// PR c++/26912 struct Foo { template<class T> int func() const; }; class Bar { friend int Foo::func<int>() const; };
google
android
error38
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error38.C
1,086
utf_8
ef729125b542acc67fddf740325e1903
// Testcase for printing typename/typedef bindings as well as template args // in diagnostics (PR c++/25185) template <class T> struct A { typename T::type f(); // { dg-message "typename T::type = void*" } void f(int i = 0); // { dg-message "" } typedef typename T::type mytype; mytype g(); // { dg-message...
google
android
lookup6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lookup6.C
142
utf_8
90ee492e747c2328ed39e4f06ad61d36
struct S { template<typename T> static void g(); }; template<typename T> void f() { return S::template g<T>(); } void g() { f<int>(); }
google
android
error4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error4.C
245
utf_8
767c10eb63bc3c8f259a1f247aad4fe4
template<class T> struct C1 { template<class U> struct C2 { class Type { }; }; }; template<class T, class U> void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" "error " } // { dg-message "note" "note" { target *-*-* } 8 }
google
android
array17
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array17.C
272
utf_8
d745bc63c8c200e57c116976bd79e9b1
// { dg-do compile } template <typename T> struct V { T& operator[](int); }; struct S { S operator +(int); template <typename T> T value(); }; template <typename T> void R (T v) { v[(S() + 0).template value<int>()][0] = 0; } int main () { R(V<V<int> >()); }
google
android
virtual1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/virtual1.C
111
utf_8
574d531cbef985e82a8a2c3a60d75a38
// PR c++/51029 struct A { void foo(); }; struct B : virtual A { template<int> B() { foo(); } };
google
android
crash119
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash119.C
166
utf_8
36bbabd9c454600f8b5832f5f8b2a00b
// PR c++/59115 template<typename T, float, int, typename U> void foo(T, U) {} // { dg-error "valid type" } void bar() { foo(0, 0); // { dg-error "matching" } }
google
android
loop1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/loop1.C
155
utf_8
fd7fa8f7d113f75acd95e3226df41c18
// PR c++/60379 template <int> struct A { void m_fn1(int p1) { int *a; while (p1 && *static_cast<int *>(static_cast<void *>(a))) ; } };
google
android
typedef29
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef29.C
537
utf_8
9b9621e40fbf5b850fdc826d2bc3ea2f
// Origin: PR c++/42820 // { dg-do compile } template <class T> struct vector{}; template<class T>struct Traits{struct Primitive{struct Id{};};}; template <template<class T> class Tree, class Polyhedron> struct Tree_vs_naive { typedef typename Tree<int>::Primitive Primitive; void f() const { typedef vector...
google
android
lvalue2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lvalue2.C
197
utf_8
8772fb1af327a84b88b8190f6c94ee33
// PR c++/50835 struct A {}; struct B { explicit B(A &); operator A&() const; }; void should_be_lvalue(A&); template <typename> void f() { A v; should_be_lvalue(true ? B(v) : v); }
google
android
spec19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec19.C
405
utf_8
f5d160027a38c58d8d22ae4a510839c8
// PR c++/18962 template<class T1,int N1> class Klasse { public: template <class T2,int N2> void function( const Klasse<T2,N2>& ); }; template<> template<class T2,int N2> void Klasse<int,1>::function( const Klasse<T2,N2>& param ) { param; // make sure we use the argument list from the definition. } int main()...
google
android
memfriend5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend5.C
580
utf_8
b29c5ddfeb79a3077e908d0877024b79
// { dg-do compile } // Member template function of member class template as friend template <class T> struct A { template <class U> struct B { template <class V> void f(V); }; }; class X { int i; template <class T> template <class U> template <class V> friend void A<T>::B<U>::f(V); }; template <class T...
google
android
nontype16
.C
toolchain/gcc/gcc-4.9/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
android
typedef4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef4.C
266
utf_8
2ffbcc1ef99f24c2acacaeb4f1276cb4
// PR c++/27572 // { dg-do compile } template<typedef> void foo(); // { dg-error "no type|typedef declaration|template" } void bar() { foo<int>(); // { dg-error "matching" } // { dg-message "candidate" "candidate note" { target *-*-* } 8 } }
google
android
param3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/param3.C
113
utf_8
9cdc0ea3c87c4634fd17c85b389758e3
// PR c++/49418 template <class T> void f (const T t) { t = 1; // { dg-error "" } } int main() { f(1); }