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
friend43
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend43.C
183
utf_8
d9e6aaa893125e91967d2b2ffd7b8e4d
// PR c++/28111 // { dg-do compile } template<typename> void foo(); template<typename T> struct A { friend void foo<>(typename T::X); // { dg-error "not a class" } }; A<int> a;
google
chromium
typename15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typename15.C
287
utf_8
6b4d640645eea393c4b9454635e1b913
// PR37314 ice-on-valid-code, from w.doeringer template <typename T> class Cdeque { typedef T *pointer; class iterator { typedef typename Cdeque<T>::pointer pointer; pointer operator->(); }; }; template <typename T> T* Cdeque<T>::iterator::operator->() { }
google
chromium
cond6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/cond6.C
82
utf_8
4dd7f1eb24dbb37103343db71513bcb3
// PR c++/27801 template<int> int foo(int i) { return !( (1 && i) ? 0 : 1 ); }
google
chromium
typedef8
.C
native_client/nacl-gcc/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; pair<type, type> f(); }; void g(A<int> a) { typedef A<int>::type type; type begin1, end1; tie(begin1, end1) = a.f(); }
google
chromium
scope1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/scope1.C
126
utf_8
b8b893e1844c502297d1e4e9591779ef
// PR 8327 template <class T> class X { static const int a = 5; static T b[a]; }; template <class T> T X<T>::b[X::a];
google
chromium
access14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/access14.C
196
utf_8
6c52ea9bb0501f9eab65ebd5d8a85cb9
// PR c++/14777 template <typename T> struct B { protected: typedef int M; }; template <typename T> struct A : B<T> { typedef typename B<T>::M N; A (int = N ()); }; A<int> a = A<int> ();
google
chromium
explicit-instantiation
.C
native_client/nacl-gcc/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
chromium
typedef6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typedef6.C
246
utf_8
22d0973a2715188331b77478c9e8d13e
//PR c++/28303 template<typename T> struct A { typedef struct typename T::X X; // { dg-error "expected identifier|two or more" } }; template<typename T> A<T>::X::X() {} // { dg-error "not a type|forbids declaration|invalid use of" }
google
chromium
instantiate8
.C
native_client/nacl-gcc/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> type; };
google
chromium
addr1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/addr1.C
212
utf_8
baa333203039ed72606c24494f2ff44e
// PR c++/15542 template <typename> struct S_T { const char** operator & (); }; template <class T> void foo(T **) {} template <typename> void templateTest() { S_T<const char> s_t; foo(&s_t); }
google
chromium
init3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/init3.C
157
utf_8
64314d0aa5b3600547adc69b42ab8e3c
// PR c++/11027 template <class T> struct X { typedef void (X::*pfun)(); static pfun p[]; }; template <class T> typename X<T>::pfun X<T>::p[] = {};
google
chromium
memtmpl3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/memtmpl3.C
391
utf_8
65b31c49b4254df68b854aca90f1aa6a
// PR c++/33239 struct null_type; template<typename T1, typename T2> struct tuple_impl { template<typename U> struct append { typedef tuple_impl<U, null_type> type; }; int data; }; template<typename T1> class tuple : public tuple_impl<T1, null_type>::template append<T1>::type { using tuple_impl<T1, null_type>::template append<T1>::type::data; }; tuple<int> my_tuple;
google
chromium
pure1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/pure1.C
86
utf_8
0dfc11dc9c413e7a1c5f2489b51a2c3d
// PR c++/26122 struct A { template<int> void foo() = 1; // { dg-error "pure" } };
google
chromium
cond5
.C
native_client/nacl-gcc/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
chromium
friend17
.C
native_client/nacl-gcc/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
chromium
overload4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/overload4.C
176
utf_8
7d2609e7f82311b3100345f65467e041
// PR c++/20679 template <class T> struct foo { struct bar { int m; }; void m() const {} void m() {} bool n() const { return b->m < 42; } bar *b; };
google
chromium
crash81
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash81.C
275
utf_8
e6fd7aa5beafbc46191aa7493ee2f2a9
// PR c++/34485 struct A { template<T::X> struct X; // { dg-error "'T' has not been declared" "T" } // { dg-error "declaration of 'template<int X> struct A::X'" "A::X" { target *-*-* } 5 } // { dg-error "shadows template parm 'int X'" "shadow" { target *-*-* } 5 } };
google
chromium
typename9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/typename9.C
341
utf_8
951143bd9928716b4f5d4f181539733a
// { dg-do compile } template <class T> struct tree { struct iterator; struct sibling_iterator { friend struct tree<T>::iterator; }; };
google
chromium
cond
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/cond.C
424
utf_8
3f33c9a7b6007a62a4f60e27a3126fc3
// PR c++/8080 // Bug: the transformation in finish_while_stmt_cond produced something // that tsubst_expr handled badly. Fixed by not doing the transformation // while parsing a template. class TObject {}; struct TIter { TObject *operator()(); }; template<class T> void get_root_object(TIter& iobj) { while ( TObject* pnew_obj = iobj() ) ; } void foo(TIter& iobj) { get_root_object<int>(iobj); }
google
chromium
ttp15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ttp15.C
342
utf_8
c09549e0b04f66b0e190b742362d2eb7
struct Dense { static const unsigned int dim = 1; }; template <template <typename> class View, typename Block> void operator+(float, View<Block> const&); template <typename Block, unsigned int Dim = Block::dim> struct Lvalue_proxy { operator float() const; }; void test_1d (void) { Lvalue_proxy<Dense> p; float b; b + p; }
google
chromium
member
.C
native_client/nacl-gcc/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
chromium
sizeof12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/sizeof12.C
210
utf_8
085b9f955b319ea26fa659b0342a998f
// Origin PR c++/41863 template<int X> struct Bar { }; template<typename T> class Foo { T m_foo; void crash() { Bar<sizeof(m_foo)> bar; } };
google
chromium
ttp14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ttp14.C
292
utf_8
a99b4acb0aa2cbfbcb364a40252b33e0
// { dg-do compile } // PR c++/18276: Template substitution of template template parameter template<template<int> class> struct A; template<int> struct B { template<template<int> class> friend class A; }; B<0> b;
google
chromium
qualttp8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/qualttp8.C
397
utf_8
2dc5d41f20c78393f107a96ffa3ef1b4
// { dg-do compile } template <template <class> class TT> class C { }; template <class T> struct D { C<T::template B> c; // { dg-error "context" } }; struct E { private: template <class T> class B {}; // { dg-error "private" } }; D<E> d; // { dg-message "instantiated" }
google
chromium
sizeof11
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/sizeof11.C
211
utf_8
2bf35536cb5d6363ce87a1698f385906
// PR c++/29435 template < class T > struct A {}; template < int> void g() { sizeof (A < int>); } template < class T > struct B; template < int> void f() { sizeof (B<int>); // { dg-error "incomplete" } }
google
chromium
crash60
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash60.C
153
utf_8
2f12f2c641a872263f9bf48d48db92c0
//PR c++/27961 struct A { template<int> void foo(X); // { dg-error "declared" } }; template<int> void f()(0); // { dg-error "initialize" }
google
chromium
unify7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/unify7.C
323
utf_8
4d15ff2e283fb0fb69b0b5b7104a57ed
// PR c++/3518 template <typename T> void Foo (const T &); template <typename T> void Baz (const T (*)()); int &f (); int main() { Foo (f); Baz (f); // { dg-error "no matching function" "" } }
google
chromium
explicit1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/explicit1.C
230
utf_8
610a5ce174887479710ddef7e050b0e9
// { dg-do link } // { dg-options "-fno-implicit-templates" } template <class T> struct C { ~C(); }; template <class T> C<T>::~C() {} struct X { C<X> *p; ~X() { delete p; } }; template class C<X>; C<X> x; int main () {}
google
chromium
nontype18
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype18.C
179
utf_8
2e2e9f4aee22cc3045d21afc23fb88ce
// PR c++/28743 template<int I> struct A { template<typename T> void foo(); }; template<int I> template<typename T> void A<0>::foo() {} // { dg-error "template parameter" }
google
chromium
crash64
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash64.C
93
utf_8
69101056de35d35b2e70204d02965d45
// PR c++/29730 struct A { template<int> void foo()(0); // { dg-error "initializer" } };
google
chromium
dependent-expr3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/dependent-expr3.C
325
utf_8
c386ca54a462a789ddb63d04e8dfa817
// { dg-do compile } // PR c++/12573: COMPONENT_REFs must be inspected for dependness. template <bool> struct S; template <typename K> struct Y : K { int x; }; template <class T> struct Z { S< (bool)(&static_cast<Y<T> *>(0)->x == 0) > // { dg-error "" } s; };
google
chromium
friend41
.C
native_client/nacl-gcc/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
chromium
mem-partial3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/mem-partial3.C
365
utf_8
bb1864ad7f8c081274c8cf093f07ecb0
// PR c++/33342 template <bool B, class T = void> struct enable_if_c { typedef T type; }; template <class T> struct A { template <class U, class V> struct B; template <class U> struct B<U, typename enable_if_c<U::sub::value==0>::type> { }; }; struct C { struct sub { static const int value = 0; }; }; A<int> a; A<int>::B<C, void> b;
google
chromium
friend39
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend39.C
114
utf_8
cd6ce0696ef298db39c645f06d6053d9
// PR c++/8355 namespace Foo { template <typename T> void foo();} struct Bar { friend void Foo::foo<int>(); };
google
chromium
qualttp3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/qualttp3.C
396
utf_8
7991785282262d725582f0e27fb5866e
// { dg-do compile } struct A { template <class T, class U> class B {}; }; template <template <class> class TT> struct X { TT<int> y; }; template <class T> struct C { X<T::template B> x; // { dg-error "type" } }; int main() { C<A> c; // { dg-message "instantiated" } }
google
chromium
friend25
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend25.C
293
utf_8
39dede1aeda6ca93984f81431de77fb6
// { dg-do compile } // PR c++/12369: ICE for specialization of member function template // as friend in ordinary class. struct A { template<class T> T* make() { return new T(); } }; struct B { friend B* A::make< B >(); // (1) };
google
chromium
typedef24
.C
native_client/nacl-gcc/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 main() { foo<A<int> >(); }
google
chromium
call5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/call5.C
256
utf_8
36a3f07072e917bab86270ea2e45099e
// PR c++/36631 // { dg-options "-O0" } template <typename T> struct B { struct C { __attribute__ ((always_inline)) C (C const &c) {} }; void __attribute__ ((always_inline)) g (C c) {} }; void trigger (B <int> b, B <int>::C c) { }
google
chromium
pseudodtor5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/pseudodtor5.C
240
utf_8
bb39ba4948ed54bad8f9e9fc8e3fbb26
// PR c++/37563 struct A {}; template<int> struct Traits { typedef void X; }; template<> struct Traits<0> { typedef A X; }; template<int N> struct B { typedef typename Traits<N>::X Y; void foo(Y y) { y.Y::A::~A(); } };
google
chromium
crash2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash2.C
339
utf_8
334a10e7ca4d9cb602c8a73576e5fff3
// { dg-options "" } template <class EnumType> class A { public: static const EnumType size = max; // { dg-error "" } int table[size]; // { dg-error "constant" } }; template <class EnumType> const EnumType A<EnumType>::size; namespace N { enum E { max = 5 }; struct B { A<E> a; }; } int main() { N::B b; return 0; }
google
chromium
field1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/field1.C
137
utf_8
f8aa89e0edae3ef78836a8cc046f0550
struct A { void (*f)(void); }; template< typename R > struct B : public A { void g() { A::f(); } }; template class B<bool>;
google
chromium
incomplete5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/incomplete5.C
346
utf_8
acdcbca8fd37e8b3134edc8b2c699259
// PR c++/33501 // { dg-do compile } class A; // { dg-error "forward declaration" } template <typename T> struct X { static int f (T); static const T &make (); static const bool value = sizeof (f (make ())) == sizeof (int); // { dg-error "invalid use of incomplete type|initializing argument" } }; int main () { return X <A>::value; }
google
chromium
error33
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/error33.C
206
utf_8
23c1c937dffecf0165fe2c2bd7f041ae
// PR c++/24791 template<int> struct A { static int i; A() { ++i; } }; template<int> int A<0>::i(0); // { dg-error "template" "error" } // { dg-message "note" "note" { target *-*-* } 9 } A<0> a;
google
chromium
crash25
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash25.C
86
utf_8
a9a41c255aa794f8caef16dd63a3534d
// PR c++/18124 template <template <int> class class> class A {}; // { dg-error "" }
google
chromium
static4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/static4.C
182
utf_8
aff424d9ff8963c8d5348142b8c5e169
template <class R> struct A { static int _test; // { dg-error "" } static int _test; // { dg-error "" } }; template <class R> int A<R>::_test = 0; struct B : public A <int> { };
google
chromium
ctor1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ctor1.C
744
utf_8
50bb5f64947bd92da66029bd39fa5eed
// { dg-do compile } // PR 5132. ICE on struct constructors in templates. // snippets from bits/huge_val.h #define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } #define __huge_val_t union { unsigned char __c[8]; double __d; } #define HUGE_VAL (__extension__ \ ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) void foo( const int&) { HUGE_VAL; // no problem here } template <class F> void Tfoo( const F&) { HUGE_VAL; // g++ fails here } template <typename T> struct M { T m; }; void Foo () { Tfoo (1.2f); (__extension__ ((M<int>) {m:3})); (__extension__ ((M<short> []) {{m:3}})); }
google
chromium
pr32519
.C
native_client/nacl-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/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/template/arg5.C
162
utf_8
578d898bb69e2e67cdcccff713390fe6
// PR c++/30534 // { dg-do compile } template<bool> struct A; template<int> void foo() { A<__builtin_constant_p(.)> a; // { dg-error "template argument" } }
google
chromium
nontype3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/nontype3.C
1,027
utf_8
d6f9c639ea162b5b3e91a6a5d10175bf
// { dg-do compile } // 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. template <int T> class foo {}; template <int *T> class bar {}; template <int *PI> void dep5(bar<PI> *); template <int *PI> void dep6(bar<PI+1> *); // { dg-error "" "integral or enumeration" } template <int I> void dep7(bar<I+1> *); template <int *PI> void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" } template <int PI[1]> void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" } template <int PI[1]> void dep9a(foo< sizeof(*PI) > *); template <int PI[1]> void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" } template <int I> void dep11(foo< *&I > *); // { dg-error "" "constant-expression" } template <int I> void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
google
chromium
conv7
.C
native_client/nacl-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/nacl-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/nacl-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/nacl-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/nacl-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/nacl-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/nacl-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/nacl-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> (); }; void f() { foo<Outer>(); }
google
chromium
canon-type-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/canon-type-6.C
354
utf_8
597aacb49894ec14d71e29a599a72dbf
// 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/nacl-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/nacl-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> {}; }; Outer<int>::Foo<int,void,void> f;
google
chromium
crash38
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/crash38.C
149
utf_8
74bcc108f79c60692f6080a58062dc02
// PR c++/23307 class A { template<class R> static void f(X&); // { dg-error "" } inline void A::f<void>(X&); // { dg-error "f|expected" } };
google
chromium
crash55
.C
native_client/nacl-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/nacl-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
memclass1
.C
native_client/nacl-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> c;
google
chromium
new6
.C
native_client/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/template/qualttp17.C
446
utf_8
a7a6daf9801ba47ba9d71b2750b8819b
// { dg-do compile } // { dg-options "-fno-inline -fabi-version=1" } 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\[: \t\n\]" } }
google
chromium
friend32
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/friend32.C
376
utf_8
62041e4ca7a531f9401f6c712f865ee8
// { 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 "instantiated" } }
google
chromium
member5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/member5.C
807
utf_8
f55822b31212bb396fd035c9619488f8
// { 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(); }; template< typename A > void S::foo() {} template< typename B, typename A > void S::foo() {} template void S::foo<void> (); template void S::foo<void,void> (); } namespace N2 { struct S { template< typename _A > void foo(); template< int _i > void foo(); }; template< typename _A > void S::foo() {} template void S::foo< 0 >(); // { dg-error "no definition available" "no def" } // { dg-message "instantiated" "instantiated" { target *-*-* } 30 } }
google
chromium
ctor5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/ctor5.C
136
utf_8
2bddf74a0547409b836f2944b1ad6dc3
// PR c++/24278 template<typename T> struct A { A() : T(0) {} // { dg-error "base" } }; A<int*> a; // { dg-message "instantiated" }
google
chromium
ttp1
.C
native_client/nacl-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/nacl-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/nacl-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
ttp18
.C
native_client/nacl-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/nacl-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
memfriend15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/memfriend15.C
530
utf_8
18277a86be979bd1b7f73a6049f55f43
// { 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 "context" } } int main() { A<int>::B2 b1; b1.f(); // { dg-message "instantiated" } }
google
chromium
invalid1
.C
native_client/nacl-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
ttp23
.C
native_client/nacl-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/nacl-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
error7
.C
native_client/nacl-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
partial5
.C
native_client/nacl-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" } template<typename T, T V> struct Z { }; template<typename T> struct Z<T, (T)0> { }; // { dg-error "involves template parameter" }
google
chromium
friend15
.C
native_client/nacl-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/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/template/dtor6.C
144
utf_8
9dcac13004026b924fd770a17bcae100
// PR c++/40139 template<int> struct A { static int i; }; template<int N> int A<N>::i = { A::~A }; // { dg-error "" } template class A<0>;
google
chromium
typedef18
.C
native_client/nacl-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/nacl-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/nacl-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
static31
.C
native_client/nacl-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 "compound expression" } template<int N> const int A<N>::i4 = (C::j, 7);
google
chromium
error41
.C
native_client/nacl-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
fnspec1
.C
native_client/nacl-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" } template <> void foo(double alpha, S<double>* x) { alpha; x; }
google
chromium
new7
.C
native_client/nacl-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
cond7
.C
native_client/nacl-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/nacl-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/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/template/ptrmem2.C
321
utf_8
84010e00560365f022f7d4c351fe97bf
// { dg-do compile } // We'd tsubst a pointer to member reference struct A {}; template <typename T> T A::* Foo (); void Baz () { Foo <int &> (); // { dg-error "no matching function" "" } }
google
chromium
crash36
.C
native_client/nacl-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/nacl-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/nacl-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/nacl-gcc/gcc/testsuite/g++.dg/template/qualttp20.C
801
utf_8
4221f7241f9e9dc35dbcdf746f8ade75
// { 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 following are DR 295 dependent typedef typename T::myT volatile *myvolatile; typename T::myT volatile *a; myvolatile b; }; template <typename T> struct B2 : T { // The following are DR 295 dependent typedef typename T::myT const *myconst; typename T::myT const *a; myconst b; }; B1<AS> b1; // { dg-message "instantiated" "" } B2<AS> b2;
google
chromium
operator9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/template/operator9.C
184
utf_8
722c2530bfe88264a0b4771ad01a1280
//PR c++/27670 template<operator+> void foo(); // { dg-error "before|non-function|template" } void bar() { foo(); // { dg-error "no matching function" } }