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
sfinae2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae2.C
424
utf_8
ef7c07b739f13546538449ba7789b15b
// PR c++/19989 // Don't instantiate a function template if it would generate an // array of size zero. // { dg-do compile } template<int T> struct cl { const static int value = T; }; template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-error "zero-size array" } void foo (void) { fn<0> (); // { dg...
google
android
crash52
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash52.C
172
utf_8
f58855114e5ac6f9d257056219515c0c
// PR c++/27665 template<int> struct A { struct B { struct C {}; }; }; template<int N> void foo() { class A<N>::B::C X; } void bar() { foo<0>(); }
google
android
defarg7
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg7.C
188
utf_8
8fdfe04193de5eb0eac57ce398f4c5ec
// PR c++/25337 template <typename T> T& MakeT(); template <typename U, int N = sizeof (MakeT<U>().operator[](0))> struct helper{}; template <typename U> static char is_here(helper<U>*);
google
android
dependent-name5
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-name5.C
1,171
utf_8
e11707dffcc625042f15f6d621ee1079
// PR c++/9634, c++/29469, c++/29607 // Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org> // DR224: Make sure that a name is *truly* semantically dependent. struct D { typedef int K; }; template <typename T> struct A { typedef int Bar; template <typename> struct N {}; typedef Bar ...
google
android
dependent-name6
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-name6.C
339
utf_8
a2d8358dfed423c4946dd5255b3cc157
// PR c++/26261 // { dg-final { scan-assembler "_ZN1YIiE1fIiEE1XILi1EEv" } } template <int dim> class X {}; template <class T> struct Y { static const unsigned int dim = 1; template <class U> X<Y<T>::dim> f(); }; template <class T> template <class U> X<Y<T>::dim> Y<T>::f() { return X<dim>(); } int main() { Y<...
google
android
template-id-4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/template-id-4.C
311
utf_8
3eeb73c9e211131164ee26dc577c50c2
// PR c++/48157 struct AType { template<class AA> void SomeFuncTemplate() { } }; template < class T > struct TTest2 { template<T> struct helper; template<class U> static void check(helper<&U::template SomeFuncTemplate<int> > *); }; int main() { TTest2< void (AType::*)() >::check<AType>(0); }
google
android
lookup3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/lookup3.C
196
utf_8
0287287b4b02081228b1429a9526248d
// PR c++/12397 struct foo { }; template <typename T> struct bar { bar(){} int i; bar (const bar<T>& foo) : i (foo.i) {} }; int main() { bar<int> b1; bar<int> b2(b1); }
google
android
void13
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/void13.C
129
utf_8
562f64a462f01cebdb6f2624c9cbaf03
// PR c++/30299 struct A { int i; }; template<void> struct B : A // { dg-error "not a valid type" } { B() { this->i; } };
google
android
array15
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array15.C
156
utf_8
e9bc7a53116f8cc44a505ea2700b2054
// PR c++/28595 template<int> struct A { static const int i; }; template<int N> struct B { char c[A<N>::i], d; // { dg-error "constant" } }; B<0> b;
google
android
crash96
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash96.C
130
utf_8
b80f828624f99069397d41d1df746903
// PR c++/40406 template<int> struct A { template<int> template<int> void A::foo() {} // { dg-error "extra qualification" } };
google
android
qualified-id1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualified-id1.C
611
utf_8
2a70b459ac169aad03656f55acdf1bd5
// { dg-do compile } // PR 11922 struct A { template <bool> struct B; struct C; }; template <> struct A::B<false> {}; template <typename T> void foo() { T::C (); // { dg-error "parsed as a non-type|if a type is meant" } T::template B<false>(); // { dg-error "parsed as a non-type" "non-type" } // { dg-messa...
google
android
ttp3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp3.C
745
utf_8
dae42b78445fb03f0f7c80954fe880b4
// { dg-do compile } // PR 5213. We failed to spot that class List was a template, rather // than a non-template or specialization template <class T> class vector { }; class OUTER { public: template <class T> class List { }; vector<class List> data; // { dg-error "invalid|required|ISO C" "" } }; template <cl...
google
android
pseudodtor6
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/pseudodtor6.C
108
utf_8
3db5c6a0f3565dd475506157d06e140a
// PR c++/47971 template <typename> struct S { typedef double T; S () { T ().~T (); } }; S<double> s;
google
android
inherit9
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/inherit9.C
153
utf_8
19797273bb7cf4155972bbcb4d4fb8c3
// PR c++/58273 class A {}; class B { int goo(A); }; template<typename E> class D : public B { void foo(A t) { int const i(B::goo(t)); } };
google
android
nontype19
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype19.C
251
utf_8
03c70922eb3eb5694336f20230eab2eb
// PR c++/42466 template<class IntT, IntT X> struct A { A(); template<IntT X2> A(const A<IntT, X2>& other); }; int main(int argc, char** argv) { A<int, 42> a; A<int, 100> b = a; A<unsigned, 42u> c; A<unsigned, 100u> d = c; }
google
android
field1
.C
toolchain/gcc/gcc-4.8.3/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
android
string1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/string1.C
70
utf_8
e7593ecf5b119a379bc82dc107ccab12
// PR c++/28337 template <int> void foo() { (0 ? "" : "X") + 1; }
google
android
member7
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/member7.C
243
utf_8
a1171f569cb38a793af833ae3af0599e
// PR c++/29080 struct Base { template<class C> void method() { } }; struct Left : public Base { }; struct Right : public Base { }; struct Join : public Left, public Right { }; void function() { Join join; join.Left::method<int>(); }
google
android
sfinae22
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae22.C
1,007
utf_8
ba70b90a27c132c51709894b862a9fa7
// PR c++/44908 // { dg-options "-std=c++0x" } #include <utility> struct A { }; struct B : public virtual A { }; template<typename From, typename To> class mini_is_convertible { typedef char one; typedef struct { char arr[2]; } two; template<typename To1> static void test_aux(To1); temp...
google
android
conv5
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/conv5.C
386
utf_8
65388659b6ed4f0befbd55edf3402b26
// { dg-do compile } // PR 764. Failed to find friend in overload resolution template <class T> struct S { friend bool operator== (const S&, const S&) { return true; } }; int main () { // S<int> s; const S<int> *p = 0; *p == *p; // error }
google
android
lookup2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/lookup2.C
365
utf_8
e1e6ffb2ea2a524c64cbcc0a6f97459a
// { dg-do compile } // PR 11617: Failed to diagnose missing function. struct B {}; template <typename T> void Bar () { T::foo (); // { dg-error "is not a member of" "" } } void Foo () { Bar<B> (); // { dg-message "required" "" } }
google
android
unify4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/unify4.C
435
utf_8
feb3d3e768d415765fa75c15289189a8
// { dg-do compile } // PR 9437. We'd unify 'T *' with 'U C::*', which is obviously broken struct X { template <typename T> operator T* () const { return static_cast<T*> (0); } } null; struct A { int i; }; static void f (int A::* pmi) { } int main () { f (null); } // { dg-error "cannot convert" "" }
google
android
sizeof10
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof10.C
125
utf_8
c3dde08186236701373c41bd64c9338e
// PR c++/23357 template<typename T> bool foo() { const long int i = sizeof(T) > 1 ? sizeof(T) : 0; return i > 0; }
google
android
spec3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec3.C
326
utf_8
f5581de159c7b5592926840478d5c5fb
// PR c++/3870 // Test that performing a type instantiation in order to match up a // specialization doesn't clobber last_function_parms. template <class T> struct A { typedef int I; }; template <class T> inline typename T::I foo (typename T::I, const T*); template <> int foo (int i, const A<long>*) { return i +...
google
android
cond6
.C
toolchain/gcc/gcc-4.8.3/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
android
array8
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array8.C
283
utf_8
9135445bfc294af3cf8b77142f5e8782
// PR c++/18121 // We were trying to layout the array // type but since the type/value of A<N>::i // was not known at template declation type, // we were crashing template<int> struct A { static int const i = 1; }; template<int N> struct B { typedef int (*p)[A<N>::i]; };
google
android
crash80
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash80.C
190
utf_8
c9dc4ab7acea171537b7ea2d00500ffa
// PR c++/37087 namespace a { template <typename T> class Foo; } namespace b { template <> class ::a::Foo<double> {}; // { dg-error "global qualification of class name is invalid" } }
google
android
canon-type-11
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/canon-type-11.C
479
utf_8
839b78a8760c0ceeabf6faa7c1d3df53
// { dg-do compile } template<class T> struct C { void bar(); }; template<class T> void C<T>::bar() { } template<class U, template<class TT0_T0> class TT0 = C, template<class TT1_T0> class TT1 = TT0> struct S { C<U> s; void foo(TT1<U>); void bar() { foo(s); } }; template<class T, template<class TT...
google
android
using14
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using14.C
318
utf_8
38f3caa7ff64898ee3a493900a978770
// PR c++/26102 template <class T> struct B1 { int i(); }; struct B2 { int i(); }; template <class T> struct C : public B1<T>, public B2 { using B2::i; void f() { i(); // should be accepted i.i(); // { dg-error "member" } } }; int main() { C<int> c; c.f(); // { dg-message "required" } }
google
android
sizeof2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sizeof2.C
281
utf_8
6ebf0c32bb2f9f68d5de8a2eb380e74b
// { dg-do compile } template<int size> struct Foobar { // Contents irrelevant }; template <typename A> struct Wrapper { // Contents irrelevant }; template <typename A> Foobar<sizeof(Wrapper<A>)> * compiler_bug (A) { return 0; } int main() { compiler_bug(1); }
google
android
typedef2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef2.C
164
utf_8
91560e6058fa7ce0edbd4239eb12b810
// PR c++/18155 template<int> typedef struct A; // { dg-warning "'typedef' was ignored" } // { dg-error "" "" { target *-*-* } 3 }
google
android
sfinae10
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae10.C
6,463
utf_8
08e40e1ccd7635d093d248a8b6295788
// DR 339 // // Test of the use of various unary operators with SFINAE // { dg-options "-fmessage-length=0 -pedantic-errors -Wno-long-long -ftrack-macro-expansion=0 " } // Boilerplate helpers typedef char yes_type; struct no_type { char data[2]; }; template<typename T> T create_a(); template<typename T> struct type { ...
google
android
arg8
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/arg8.C
146
utf_8
ab34028d94948742f14d5352356f20d5
template<typename T, void, typename U> // { dg-error "void" } void foo(T, U, int) {} void bar() { foo(0, 0, 0); // { dg-error "no match" } }
google
android
qualttp18
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp18.C
363
utf_8
6a1877e8c019018ed6950e7a3201b7ac
// { dg-do compile } struct A { template <class T> class B {}; }; template <template <class> class TT> struct X { TT<int> y; }; struct C { X<A::template B> x; // { dg-error "template" "" { target c++98 } } }; int main() { C c; }
google
android
friend9
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend9.C
442
utf_8
59b5bf61b7f6210d3cf3b9b45692794a
// { dg-do compile } // PR c++/8099 // Partial specialization as friend class template <int N, typename T> struct X; template <typename T> struct X<1,T>; template <typename P> class Y { static int i; template <int N, typename T> friend struct X; friend struct X<1,P>; }; template <typename T> struct X...
google
android
array6
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array6.C
174
utf_8
294448858892b33e7116237b86ab785a
// PR c++/15287 struct S {}; struct Array { S operator[](int); } array; void (S::*mem_fun_ptr)(); template <int> void foo() { (array[0].*mem_fun_ptr)(); }
google
android
partial3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial3.C
370
utf_8
629ba41b72a6f4a573aa2b2fc66bf5c8
// { dg-do compile } // Origin: John Maddock <john at johnmaddock dot co dot uk> // PR c++/13997: Error while matching partial specialization of array type template <typename T> struct is_array; template <typename T, unsigned int N> struct is_array<T[N]>; template <typename T, unsigned int N> struct is_array<const T...
google
android
builtin1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/builtin1.C
142
utf_8
479ce6c62d0ab31928edd3bcef27bd5c
// PR c++/26559 template<bool> struct cond; template<int> struct S { void f(int i) { cond<__builtin_constant_p(i)>(); } }; S<1> s;
google
android
ref2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ref2.C
380
utf_8
a02f5612e9219b8cd807bc11c6baa86d
struct t { void f() const; }; template <typename _Tp> struct A { static t const& c; }; template <typename _Tp> void g(void) { A<_Tp>::c.f(); } void h(void) { g<int>(); }
google
android
void6
.C
toolchain/gcc/gcc-4.8.3/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
android
crash17
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash17.C
223
utf_8
78327c2d24f8befdc8bd1b4f71aa2928
template <int I> struct A { }; template <typename T> struct B { typedef typename T::type type; static const type j = T::j; A<j> b; }; struct C { typedef int type; static const int j = 3; }; int i = B<C>::j;
google
android
crash85
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash85.C
274
utf_8
fac18fbcfe10c67843c28437a6b92d3c
// Origin: PR c++/37142 // { dg-do compile } template<typename T, const T a, template <typename U, U u> class W> struct A {}; template<typename T, const T t> struct B {}; int main () { A<long, 0, B> a; return 0; }
google
android
array18
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array18.C
162
utf_8
8287a01c520c57028e25ecbe9d2cc181
// PR c++/30924 template<typename T> struct x {}; template<typename T, unsigned N> struct x<T*[N]> {}; int main() { x<int> a; x<int*[10]> b; return 0; }
google
android
sfinae24
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae24.C
689
utf_8
957e4f34f89fa7b743d63c424c24528e
// PR c++/44969 template<bool, typename T = void> struct enable_if { typedef T type; }; template<typename T> struct enable_if<false, T> { }; template<typename Tp, typename Arg1, typename Arg2> class mini_is_constructible { typedef char one; typedef struct { char arr[2]; } two; template<typename Tp1, ...
google
android
ptrmem2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ptrmem2.C
418
utf_8
af6766db6bcf0d158ef96c3e85df7e6b
// { dg-do compile } // We'd tsubst a pointer to member reference struct A {}; template <typename T> T A::* Foo (); // { dg-error "reference" } void Baz () { Foo <int &> (); // { dg-error "no matching function" "" } // { dg-message "candidate" "candidate note" { target *-*-* } 14 } }
google
android
typedef6
.C
toolchain/gcc/gcc-4.8.3/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
android
array23
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array23.C
159
utf_8
0218cd33eef2d06ff1cf3f60e250aed7
// PR c++/53989 struct Foo { int value; typedef Foo Foo2; static Foo2 const foos[2]; }; template <class T> void g (T); void bar() { g(&Foo::foos); }
google
android
crash2
.C
toolchain/gcc/gcc-4.8.3/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 ...
google
android
sfinae27
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae27.C
534
utf_8
ae991b2f4a945b814f41ee4ceb9ae3e5
// Origin: PR c++/46162 struct small_type { char dummy; }; struct large_type { char dummy[2]; }; template<class T> struct has_foo_member_variable { template<int T::*> struct tester; template<class U> static small_type has_foo(tester<&U::foo> *); template<class U> static large_type has_foo(...); static const b...
google
android
inherit3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/inherit3.C
186
utf_8
1c9360dccd50f544e413d4c00432d88e
template <typename T> struct set { void insert (const T&); template <class X> void insert (X, X); }; struct C : public set<int> { void f (const int i) { insert (i); } };
google
android
arg5
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/arg5.C
170
utf_8
758ffa88d8ad3bfc5f84d3141ceeb13d
// PR c++/30534 // { dg-do compile } template<bool> struct A; template<int> void foo() { A<__builtin_constant_p(.)> a; // { dg-error "template argument|invalid" } }
google
android
partial8
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/partial8.C
125
utf_8
2b23d416282107a906fcf6e2b3a898e7
// PR c++/32505 template <class T> struct A { }; A<int*> a; template <class T> struct A<T*> { }; // { dg-error "A<int\\*>" }
google
android
conv13
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/conv13.C
174
utf_8
c31c403acbaa655ae0413e1d4350ae4b
// PR c++/52088 struct S { template <typename T> operator T *() { return 0; } }; int main() { S s; delete s; // { dg-error "ambiguous|template|pointer" } }
google
android
error8
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error8.C
107
utf_8
087bbcdc150fa765a03be550dd7193ce
// PR c++/11116 template <typename T> struct S {}; void f() { throw S (); // { dg-error "template" } }
google
android
cond7
.C
toolchain/gcc/gcc-4.8.3/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
android
qualified-id6
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualified-id6.C
115
utf_8
c8588eeab6350990eb0794100158ead1
// PR c++/54913 struct E { static const int& e; }; template<typename> struct R { R() { E::e; } }; R<int> r;
google
android
overload13
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/overload13.C
236
utf_8
a47f093138ae4461a058f2bc00d23fb8
// PR c++/56998 class Secret; char IsNullLiteralHelper(Secret* p); char (&IsNullLiteralHelper(...))[2]; struct C { int val() { return 42; } }; template <typename T> unsigned f() { return sizeof(IsNullLiteralHelper(C().val())); }
google
android
ttp19
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/ttp19.C
184
utf_8
00132c35b440c6f38de75bfaed01af9d
// PR c++/27689 void f (...); template <template <typename> class F, typename T> void f (F<T>); template <typename> struct foo { struct bar {}; }; void g (foo<int>::bar x) { f(x); }
google
android
error22
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/error22.C
191
utf_8
54b3e85a8d8f9bc805e7795860ec08ba
//PR c++/27821 struct A { template<void (A::*)()> struct B {}; void ::foo(); // { dg-error "invalid use" } B<&A::foo> b; // { dg-error "incomplete type|template argument" } };
google
android
dependent-name4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-name4.C
349
utf_8
147338e18276d105fca28005404df2a8
// { dg-do compile } // Dependent arrays of invalid size cause template instantiation failure. // We'll get an error message (duplicate matching templates) if the first // pattern is incorrectly allowed to match. template<int M> void foobar (int (*) [M] = 0 ); template<int M> void foobar ( ); void fn (void) { fo...
google
android
defarg3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/defarg3.C
542
utf_8
e55baeaf118c452b9f707b8236ee86b1
// { dg-do compile } // PR c++ 11596 template <int V, bool F = V < 1> struct A { enum { value }; }; template <int V> struct B { enum { value = A<1>::value }; }; int ary[!B<1>::value ? 1 : -1]; template <int V, bool F = V < 1> struct A1 { enum { value = 1}; }; template <int V> struct A1<V,false> { enum { value}; }; temp...
google
android
void3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/void3.C
133
utf_8
30d3ef85884811b1e84895da90d2a724
//PR c++/28637 template<void> struct A {}; // { dg-error "not a valid type" } A<0> a; // { dg-error "type" }
google
android
crash14
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash14.C
159
utf_8
7c732ef3b17279bd746eb1196b0d76fe
// { dg-options -std=c++98 } template <int T> class foo { public: foo() { } class Z { };}; template <int I[2]> void dep7(foo<I[0]> *) { } // { dg-error "" }
google
android
typedef14
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef14.C
220
utf_8
906e6fd9c2cee3f79fa553d5d06adfdb
// Origin: PR c++/26693 // { dg-do compile } template <class T> struct A { typedef int mytype; void foo () { mytype v = ~static_cast<mytype> (0); } };
google
android
qualttp5
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp5.C
586
utf_8
2dca6e0250f75868ac66daef15cdbb55
// { dg-do compile } template <class U> struct A { template <class T> class B {}; // { dg-message "operator=|no known conversion" } }; template <template <class> class TT> void f() { TT<int> y; y = 0; // { dg-error "no match" } // { dg-message "candidate" "candidate note" { target *-*-* } 13 } } template <class T> ...
google
android
unify7
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/unify7.C
446
utf_8
ef808a68d269a5f2b1da508db1d2b2b3
// PR c++/3518 template <typename T> void Foo (const T &); template <typename T> void Baz (const T (*)()); // { dg-message "note" } int &f (); int main() { Foo (f); Baz (f); // { dg-error "no matching function" "" } // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 13 } }
google
android
pseudodtor1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/pseudodtor1.C
431
utf_8
b1805d4b386b8dcd432f41c68e255100
// PR c++/32384 // { dg-do compile } struct A { typedef int T; T foo (); A () { foo ().~T (); } }; template<typename> struct B { typedef int T; T foo (); B () { foo ().~T (); } }; template<typename T> struct C { T t; C () { t.~T (); } }; template<typename S> struct D { typedef int T; S foo ();...
google
android
typedef37
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef37.C
1,030
utf_8
eb3abfc5e71e3a935092fd52c8240bfb
// Origin: PR c++/47398 // { dg-do compile } template<int> struct A { typedef int INT; }; template<int I> struct transform { static int bar(); }; template<class T, int a, class U, int b> struct B { typedef typename A<a>::INT TINT; void baz(); }; template<class T, int a, class U> struct B<T, a, U, 1> { typ...
google
android
qualttp19
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/qualttp19.C
918
utf_8
5d01ff95ca3a7d8da4e70d7477555e72
// { dg-do compile } // PR 2645 template <typename T> struct call_traits { public: typedef T type_less_spec; }; template <typename T> struct call_traits<T&> { typedef T type_more_spec; }; int main() { int num; // Two typedefs lead to the instant. of the less spec. ("wrong") template typedef int& r_type;...
google
android
dependent-expr4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-expr4.C
342
utf_8
b4bc25a86f512c4a58cc90654edd346f
// { dg-do compile } // PR c++/12573: COMPONENT_REFs must be inspected for dependness. // Or, more specifically OFFSETOF. template <bool> struct S; template <typename K> struct Y { int x; }; template <class T> struct Z { S< (bool)(__builtin_offsetof (Y<T>*, x) == 0) > s; };
google
android
nontype13
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/nontype13.C
372
utf_8
01f5dcd70f36488761ff2e33d0886f6d
// PR c++/19004 template<typename T> struct Dummy { void evil() { this->template tester<true>(); } template<bool B> void tester() { bar<evil>()(); // { dg-error "constant|template" } } template<bool B> struct bar { void operator()() { } }; }; int main() { Dummy<int> d; ...
google
android
arg2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/arg2.C
357
utf_8
d4cdd40bc9751e0b8bec432ef613e8de
// { dg-do compile } // PR 9708. We accepted a local class template <typename T> class X {}; void fn () { class L {}; X<L> f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" { target c++98 } } }
google
android
instantiate4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/instantiate4.C
243
utf_8
7d69f16e359b40571c6da6dde60dde8d
// { dg-do compile } // PR c++/10682: Typedef to enum template instantiation logic. template <typename T> struct Foo { enum E {a,b,c}; typedef E EE; }; void Baz(Foo<int>::EE x);
google
android
operator1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/operator1.C
519
utf_8
b690784559e05afd43e95b8cf36b03eb
class test { public: float operator[]( int index ) { return testFloat[index]; } private: float testFloat[3]; }; template < class typeA > float operator*( typeA a, float b ) { return a[0] * b; } template < class typeB > float operator*( float a, typeB b ) { return a * b[0]; } template < class typeA, class...
google
android
friend52
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend52.C
175
utf_8
7f28d81dd24446e217e792a31a338161
// PR c++/50344 // { dg-options "" } template <typename T> class C { friend T; int i; }; struct S { int f() { C<const S> c; return c.i; } };
google
android
friend46
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend46.C
177
utf_8
b6050fc706b8413aeac096dd69086d72
// 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
android
using4
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using4.C
553
utf_8
cd698ebd98a80f55920d17ae629b4d9b
// { dg-do run } // PR 9447. Using decls in template classes. template <class T> struct Foo { int k (float) {return 1;} }; struct Baz { int k (int) {return 2;} }; template <class T> struct Bar : public Foo<T> , Baz { using Foo<T>::k; using Baz::k; int foo() { if (k (1.0f) != 1) return 1; if (...
google
android
friend20
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/friend20.C
121
utf_8
9d4f5b3213673d62379489a71f82b196
template <class T> struct A { friend void bar(A<T> a) {} }; void bar(A<int>); int main() { A<int> a; bar(a); }
google
android
crash49
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash49.C
78
utf_8
cf864ea56a274c6c9a392f3a5f2f5910
// PR c++/27102 template <typename T> void T::foo; // { dg-error "invalid" }
google
android
crash102
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash102.C
116
utf_8
f75072de1c2abdfca708b732cbfafa89
// PR c++/45043 template < typename > class A; template < typename T > A < T >::B::~B () // { dg-error "type" } {}
google
android
spec24
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec24.C
443
utf_8
756d8965e92fbeb951248f1d353ce9a9
template <int i> struct Mutex { static int mutex; }; template <int i> int Mutex<i>::mutex = {1}; template <> int Mutex<0>::mutex; template <> int Mutex<0>::mutex = 0; void g() { Mutex<0>::mutex = 0; }
google
android
crash11
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash11.C
275
utf_8
5fdda9a20dcbd6e2fccb01f28292529e
// { dg-do compile } // PR c++/7939: ICE for invalid function parameter after template // substitution. template <class T, class U> void foo(T, U) {} template <class T> void foo<T,void>(T, void) {} // { dg-error "incomplete|invalid|partial" }
google
android
typedef23
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef23.C
303
utf_8
a2356f34f02acc6500996b77569f619f
// Origin PR c++/42069 // { dg-do compile } struct A { static const int N = 0; }; template<int> struct B {}; template<typename T, int> struct C { typedef T U; B<U::N> b; }; template<typename T> struct C<T*, 0> { B<T::N> b; }; C<A*, 0> c;
google
android
sfinae26
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae26.C
1,381
utf_8
8ddef44076eb6e19a48862cb31a69912
// Origin: PR c++/46170 // { dg-do compile } namespace util { struct option_value { }; template <class T> struct options_map_impl { typedef T options_struct_type; typedef bool (*opt_func)(const option_value&, options_struct_type&); template <class V, V K> static bool set_member_constant(const opti...
google
android
spec29
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec29.C
397
utf_8
9b290630d01c434872c1ed3db6067a4f
// PR c++/25855 // { dg-do run } template <typename T> int qCompare(const T *t1, const T *t2) { return 1; } template <typename T> int qCompare(T *t1, T *t2) { return 2; } template <typename T1, typename T2> int qCompare(const T1 *t1, const T2 *t2) { return 3; } template<> int qCompare(const char *t1, const char *t...
google
android
typedef3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/typedef3.C
126
utf_8
ccd975f84b8531606ff90ff87ff98010
// PR c++/19397 // { dg-do compile } template<typename> struct A { typedef int ::template; // { dg-error "template" } };
google
android
sfinae7
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae7.C
6,738
utf_8
ddcb9be925a64a1c49b8f8cc6c154cf3
// DR 339 // // Test of the use of various binary 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 T>...
google
android
conv2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/conv2.C
521
utf_8
383f6618c1ccaddea23b36ff23d6d35e
// { dg-do run } // PR 4361. Template conversion operators were not overloaded. class C { public: operator float () {return 2;} operator int () { return 0; } template<typename T> operator int () { return 1; } }; int main () { C p; int r; r = p.operator int (); if (r) return r; r...
google
android
crash42
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash42.C
150
utf_8
7845da4d1b1384a76c0c0244fc45ef41
// { dg-do compile } // PR c++/22153 template<int> void foo(); template<int> struct A { template<> friend void foo<0>(); // { dg-error "" } };
google
android
koenig1
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/koenig1.C
130
utf_8
6dfc1674746db8a02b5504e177f5aca0
namespace NS { struct C {}; } template <class T> void bar() { T t; foo (t); } template void bar<NS::C> ();
google
android
spec16
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec16.C
329
utf_8
2bf40965be588d9d8b5690c13033104d
// { dg-do compile } // Contributed by Giovanni Bajo <giovannibajo at gcc dot gnu dot org> // PR c++/14497: Reject specialization without template headers template <int N> struct A { template<int M> void B () ; }; void A<0>::B<0>() { // { dg-error "specializing member 'A<0>::B<0>' requires 'template<>' synt...
google
android
explicit-instantiation3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/explicit-instantiation3.C
549
utf_8
7c2daced476ed6b72c25a10611af9a2c
// { dg-do compile } // Origin: <sebor at roguewave dot com> // c++/8266: Explicit instantiation of a template outside its namespace is // broken namespace N { template <class T> T foo (T) { return T (); } struct A { template <int N> struct B {}; }; template <int M> struct C {}; template do...
google
android
sfinae25
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/sfinae25.C
126
utf_8
25850e96e227cc1a22c96c82d5c6ff4c
template <int I> struct A { }; template <int J> void f(A<1/J>); template <int J> void f(...) { } int main() { f<0>(); }
google
android
non-dependent5
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/non-dependent5.C
153
utf_8
7e000c3eaeb33b0cda5191bb78ee313d
// PR c++/15299 template <class T> void fun_ptr(T (*)()); template <class T> T bar(); template <class> void foo () { fun_ptr(bar<int>); }
google
android
spec36
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/spec36.C
322
utf_8
1ff4e553eeebbb6941b32728ea24e2cf
/* PR c++/38089 */ /* { dg-do compile } */ struct basic_string { basic_string(const int __s); }; namespace MyNS { class MyClass { template <typename T> T test() { } /* { dg-error "from definition" } */ }; } template <> basic_string MyNS::MyClass::test() /* { dg-error "specialization of" } */ { return 1; ...
google
android
unify9
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/unify9.C
560
utf_8
bc4e62ef740da093be11d3311efeee99
// PR 21799: deduction of cvqualifiers on member functions was wrong template <class T> void f (T &, void (T::*)() ); // { dg-message "note" } struct X { void g() const {} }; const X *x; int main () { f (*x, &X::g); // { dg-error "no matching function" } // { dg-message "(candidate|incomp...
google
android
crash63
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/crash63.C
165
utf_8
aa734f014cf5d00d10906b6c35b3de27
// PR c++/29729 template<typename T> void foo(T) { struct A { template<int> struct B // { dg-error "local class" } { typedef B<0> C; } }; }
google
android
using3
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/using3.C
607
utf_8
2131f7be9d523457118116995b368d74
// { dg-do run } // PR 9447. Using decls in template classes. template <class T> struct Foo { int i (int) {return 1;} }; struct Baz { int k (int) {return 2;} }; template <class T> struct Bar : public Foo<T> , Baz { using Foo<T>::i; using Baz::k; int i (float) {return 3;} int k (float) {return 3;} int ...
google
android
dependent-expr7
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/dependent-expr7.C
181
utf_8
62547428f2604bbed7afb83c31bfb8cb
// Origin PR c++/48574 // { dg-do compile } struct A { virtual void foo(); }; template <typename T> void bar(T x) { A &b = *x; b.foo (); } void foo() { A a; bar(&a); }
google
android
array1-2
.C
toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/template/array1-2.C
418
utf_8
075227803fea6455eb958b3d2d173e9b
// { dg-do compile } // { dg-options "-fabi-version=2" } // PR c++/12774 Array domains compared unequal void Foo(double r[3][3]) { } void Baz() { double m[3][3]; Foo(m); } template <class T> void Bar() { double m[3][3]; Foo(m); } int main() { Baz(); Bar<int>(); return 0; }