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 | canon-type-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-6.C | 352 | utf_8 | c54175875559dba3c1940b58610bf79a | // Origin PR c++/39754
// { dg-do compile }
struct Foo {};
template<typename> struct A ;
template<typename T ,typename = A<T> > struct B { } ;
template<class W, class>
struct D
{
typedef W X;
A<void (Foo::*) (X)> a;
} ;
template<class Y>
struct E
{
B<void (Foo::*) (Y)> b;
};
E < int > e ; |
google | android | non-dependent10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent10.C | 345 | utf_8 | c573cd5de2d4d269cb4df23ea0a36f4d | // { dg-do compile }
// Two-phase name lookup for address of member:
// Detecting overloading function error during parsing
struct S
{
int f(char);
int f(int);
};
template<int (S::*p)()>
struct X
{};
template <class T>
struct Foo
{
X<&S::f> x; // { dg-error "convert|no matches" }
}; |
google | android | qualttp9 | .C | toolchain/gcc/gcc-4.9/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 | android | dependent-expr5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dependent-expr5.C | 4,581 | utf_8 | 0d2b76dcf0f4104ca64a41e659607c89 | // { dg-do compile }
// inspired in the failure reported in Red Hat bugzilla #168260.
template<class F> void bind(F f) {} // { dg-message "note" }
template<class F> void bindm(F f) {} // { dg-message "note" }
template<class F, class T> void bindm(F (T::*f)(void)) {} // { dg-message "note" }
template<class F> void bindn... |
google | android | friend23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend23.C | 565 | utf_8 | 7ad7118de3eccd5d74c51db173d4e326 | // { dg-do compile }
// PR c++/11876: Friend of its own class diagnostics
template <typename T>
class A
{
friend class A<int>;
friend class A<float>;
protected:
T _data;
inline A() : _data(0) {}
template <typename U>
inline A(const A<U>& r) : _data(r._data) {}
};
class B : public A<int>
{
public:
inline B() {}
... |
google | android | static4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static4.C | 184 | utf_8 | b67f90f481457eed4347f5c93c64b458 | template <class R>
struct A {
static int _test; // { dg-message "" }
static int _test; // { dg-error "" }
};
template <class R> int A<R>::_test = 0;
struct B : public A <int> { };
|
google | android | ptrmem17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem17.C | 117 | utf_8 | 4e849ae08c1114a95499c4a59e027a41 | // PR c++/28346
template<int> struct A
{
int& i;
A();
~A() { &A::i; } // { dg-error "reference" }
};
A<0> a;
|
google | android | static34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static34.C | 277 | utf_8 | f1fd1e96e73f73035fc24e024a5643a1 | // PR c++/52688
// { dg-do link }
template<class T>
struct A {
static bool test() {
static bool value = false;
if (value)
return false;
struct S {
S() { value = true; }
};
static S s;
return true;
}
};
int main()
{
A<int>::test();
}
|
google | android | crash31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash31.C | 68 | utf_8 | e3731e3425655eda73d8d1ac61cdadb3 | // PR c++/19063
template<operator< struct A {}; // { dg-error "" }
|
google | android | friend10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend10.C | 833 | utf_8 | bdf8365204c19eeb87434d85b7139d2d | // { dg-do run }
// PR 5116. template instantiation can add a friend into a namespace,
// and thus change overload resolution.
#include <iostream>
static int right;
static int wrong;
struct Buggy {};
template <typename T>struct Handle
{
Handle(T* p) {}
operator bool() const { wrong++; return true; }
friend ... |
google | android | local7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/local7.C | 157 | utf_8 | e8013d76ce3f8f9574197fee5026c527 | // PR c++/53599
template <typename T>
int foo ()
{
struct F;
struct G
{
static int F::* bar();
};
return sizeof(G);
}
int z = foo <int> ();
|
google | android | typename13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename13.C | 402 | utf_8 | ca4a61ed1c2da506a98ef392ad06676a | // { dg-do compile }
template <typename T> struct A
{
struct B;
typedef typename B::type type;
};
template <typename T> struct A<T>::B
{
typedef typename A<T>::type type;
type Foo ();
};
template <typename T>
typename A<T>::B::type
A<T>::B::Foo ()
{
return 0;
} |
google | android | ttp17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp17.C | 167 | utf_8 | f66d4fc77767b484d05f73af4cc8280a | template <template <typename> class C>
void f(C<double>) {}
template <typename T, typename U = int>
struct S {};
template void f(S<double>); // { dg-error "match" }
|
google | android | local4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/local4.C | 291 | utf_8 | 0f5891073a92c0a9503b29e62dc8a462 | // PR c++/17413
// { dg-options -std=c++98 }
template <typename T> void foo() {} // { dg-message "note" }
int main () {
struct S {};
foo<S> (); // { dg-error "(match|template argument for|trying to instantiate)" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
|
google | android | arrow4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arrow4.C | 211 | utf_8 | 781b55354e14154c76cb03bee69fac5f | // PR c++/56895
// { dg-do compile }
void fn (int *);
void fn (int);
extern struct A { bool foo (); A bar (); } *a;
template <int>
void
baz ()
{
fn (a->bar().foo() ? 1 : 0);
}
void
test ()
{
baz<0> ();
}
|
google | android | canon-type-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-1.C | 322 | utf_8 | d7bcb12b4251a66478891aad1a8828b7 | // 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 | local1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/local1.C | 512 | utf_8 | b7860e67547fa0e658cae5b27a73d61b | // PR c++/4286: We were crashing when trying to set up the class bindings in
// g(), because xref wanted the mangled name, which breaks inside a template.
// Of course, the offending code is actually ill-formed anyway, so check
// for the error. Also check that it's formatted properly.
struct A
{
template<class T>... |
google | android | defarg13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg13.C | 355 | utf_8 | 0d32e667480f73ac92b20573e9641be6 | // PR c++/14912
// Bug: We were instantiating A<B> in order to compare it to the matching
// argument for C<B,B>, which fails.
template <class T>
struct A
{
typedef typename T::F F;
};
struct B { };
template <class T, class U = typename A<T>::F >
struct C
{
typename T::F f; // { dg-error "no type" }
};
C<B, B>... |
google | android | arg1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arg1.C | 309 | utf_8 | 7a85bf47a7ccf37365dc9d0ed5813e3e | // { dg-do compile }
// PR 9978. We rejected a constant expression.
enum { val = 1 };
template <class T>
struct Bar
{
static const int A = val;
static const int B = A + 1;
}; |
google | android | friend4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend4.C | 548 | utf_8 | 56e71f86759e703664c2ed50998932fd | // { dg-do compile }
// PR 109, dependent member friends
struct B
{
static int foo ();
struct N
{
static int bar ();
};
};
template <class T>
class A
{
friend int T::foo ();
friend int T::N::bar ();
private:
static int m;
};
template <class T>
class C
{
friend struct T::N;
private:
static i... |
google | android | addr1 | .C | toolchain/gcc/gcc-4.9/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 | android | canon-type-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-3.C | 360 | utf_8 | 6dd8c537054ea8cf4d688cc3066c6c21 | // 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 ;
typedef X (FP) ();
A<FP&> a ;
} ;
template < class Y > struct E
{
typedef Y (FP) ();
B<FP&> b ;
} ;
E < int > e ; |
google | android | spec11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec11.C | 380 | utf_8 | 641e90d3e3434fc264671bb60336331b | // { dg-do compile }
// PR c++/13635: ICE explicit specialization of member function template
template <class foo>
class bar {
public:
template <class baz>
int func(baz *x);
};
template <>
template <class baz>
int bar<double>::func(baz *x) { return 5;}
template <>
template <>
int bar<double>::func(int *... |
google | android | error36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error36.C | 203 | utf_8 | a17a0188621ff6205e2133c232c6aa5f | // PR c++/37719.C
template <typename T>
class foo {
void bar() throw(int); // { dg-error "throw \\(int\\)" }
};
template <>
void foo<int>::bar() throw(float) {} // { dg-error "throw \\(float\\)" }
|
google | android | repo9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo9.C | 1,205 | utf_8 | 09c238973ea94f59ca87a7f64f81c0e8 | // PR c++/36364
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template <typename C> struct A
{
static void assign (C &c1, const C &c2) { c1 = c2; }
};
template <typename C, typename T> struct B
{
st... |
google | android | error32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error32.C | 90 | utf_8 | 95475caa3d2f02af77559820e82ebb1c | // PR c++/33843
struct A {};
void foo(A* p())
{
p->A::~A(); // { dg-error "A::~A" }
}
|
google | android | access22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access22.C | 172 | utf_8 | 0efb5f7bc1cba01bee2985b139c1277e | template <int I> struct B { };
template <class T>
B<T::I> f();
class A
{
static const int I = 42;
template <class T> friend B<T::I> f();
};
int main()
{
f<A>();
}
|
google | android | non-dependent1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent1.C | 247 | utf_8 | da1df58fc40e198de8f0c5d88494d89e | //PR c++/8222
// { dg-do run }
struct Foo
{
template <class>
void func() {}
};
template <class>
void Bar(Foo* p)
{
p->func<int>();
}
int main()
{
Foo c;
Bar<int>(&c);
} |
google | android | ptrmem1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem1.C | 599 | utf_8 | 30d2a35742944aa3c421d0b6d2b41781 | // { dg-do compile }
// PR 3716 tsubsting a pointer to member function did not create a
// pointer to member function.
template <class C, class T, T C::*M>
struct Closure
{
T operator() (C & c) const { return (c.*M); }
};
template <class C, class T, T (C::* M)()>
struct Closure<C, T (), M>
{
T operator()(C & c) con... |
google | android | inherit4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/inherit4.C | 224 | utf_8 | 2b089e52426f6150cf26e18b4ada5122 | // PR c++/21008, DR 515
struct A {
int foo_;
};
template <typename T> struct B: public A { };
template <typename T> struct C: B<T> {
int foo() {
return A::foo_; // #1
}
};
int f(C<int>* p) {
return p->foo();
}
|
google | android | typedef39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef39.C | 391 | utf_8 | e4f31473f3a6029bc780fa422a45de3a | // PR c++/50852
template<int d> class A;
template<class T> struct B {typedef int K;typedef int L;};
template<class U,class V> struct C
{
typedef typename U::L X;
typedef A<X::a-1> W; // { dg-error "not a member" }
};
template<class U,int d> struct D
{
typedef typename U::L X;
typedef A<X::a-1> W; // th... |
google | android | dtor1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dtor1.C | 85 | utf_8 | c10faccbba72797e793c4697fe233f9c | struct A {};
template <typename T> struct B
{
B() { A().A::~A(); }
};
B<void> b;
|
google | android | void1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void1.C | 98 | utf_8 | 23655735fa447bdfd2100e025e21ee03 | // PR c++/27430
// { dg-do compile }
template<void[]> struct A; // { dg-error "array of void" }
|
google | android | koenig8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/koenig8.C | 224 | utf_8 | 331e9bd8d23757608f4687c51ab1c460 | // PR c++/40740
template<class T>
T addsome(T v) {
return v+1;
}
int addsome(int v) {
return v+2;
}
int main() {
int i = 0;
if (addsome(i) != 2)
return 1;
if (addsome<>(i) != 1)
return 2;
return 0;
}
|
google | android | pr17410 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr17410.C | 333 | utf_8 | ada1f30ea7c959c2a12b240ba308c1bf | // PR c++/17410
template <class>
struct Outer {
template <class> struct Inner {};
};
template <class T>
struct A;
template <template <class> class Q, class P>
struct A <Q<P> > {};
template <class T> struct UNRELATED;
template <class T> struct UNRELATED<Outer<void>::Inner<T*> >;
template struct A<Outer<void>::In... |
google | android | incomplete4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/incomplete4.C | 301 | utf_8 | 41949f71dcca319627a067f84a4c33a2 | // PR c++/33501
// { dg-do compile }
class A; // { dg-error "forward declaration" }
template <typename T> struct X
{
static int f (T); // { dg-error "initializing" }
static const T &make ();
};
int
main ()
{
return X<A>::f (X<A>::make ()); // { dg-error "invalid use of incomplete type" }
}
|
google | android | recurse2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/recurse2.C | 289 | utf_8 | 60db27ac9c3110686f6dfa3820d57517 | // PR c++/9335
// We should not see an error about non-constant initialization.
template <int N> struct X {
static const int value = X<N-1>::value; // { dg-error "instantiation|incomplete" }
// { dg-message "recursively required" "" { target *-*-* } 5 }
};
template struct X<1000>;
|
google | android | access11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access11.C | 542 | utf_8 | 4258b0983bb1e6a711060fef0bfee6ae | // { dg-do compile }
// Access checking during explicit instantiation.
class A {
typedef int X; // { dg-error "private" }
};
class X {
private:
template <typename T> struct Y;
};
template <> struct X::Y<int> {
A::X x; // { dg-error "this context" }
};
template <typename T> struct X::Y {
typename T::X x; /... |
google | android | friend39 | .C | toolchain/gcc/gcc-4.9/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 | android | enum2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/enum2.C | 129 | utf_8 | 5fb321d2debea87feaa0815b488d0835 | // PR c++/15877
template <int n> struct T1 { enum { N = 3 }; };
template <int n> struct T2 { enum { N = n, N1 = T1<N>::N }; };
|
google | android | qualified-id3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualified-id3.C | 440 | utf_8 | 6d37864350adc940f0c6508c544aa7bf | // PR c++/44587
template <const int N> struct A { };
template <class T> struct B {
static const int c; // { dg-message "not initialized with a constant expression" }
typedef A<B<T>::c> C; // { dg-error "constant expression|template argument" }
};
template <class T> const int B<T>::c = sizeof (T);
template <const ... |
google | android | nontype5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype5.C | 293 | utf_8 | d37a5a77843c5b66c3d3566383b07dd6 | // { dg-do compile }
// PR c++/13797: ICE invalid nontype template parameter
template <int> struct A
{
typedef A<0> B;
template <B> struct C {}; // { dg-error "not a valid type" }
};
A<0> a; |
google | android | redecl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/redecl2.C | 284 | utf_8 | 8c26da9476ca0b8d2908af7ab2348832 | // { dg-do compile }
// PR c++/14428: Redeclaration of class template with wrong
// non-type template parameter.
template <int i> struct X; // { dg-error "template parameter" }
template <int* p> struct X; // { dg-error "redeclared here" } |
google | android | operator10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/operator10.C | 186 | utf_8 | 7d7d9ae6a20d4aa195178afcaf07e852 | // PR c++/30535
// { dg-prune-output "note" }
struct A {};
template<A, typename T> int operator-(A, T); // { dg-error "not a valid type" }
int i = A() - 0; // { dg-error "no match" }
|
google | android | nontype7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype7.C | 314 | utf_8 | cee023670861be047d45f0aa6daa937f | // { dg-do compile }
// Origin: C++ standard, [temp.arg.nontype]/2
template<class T, char* p> struct X {
X();
X(const char* q) { /* ... */ }
};
char p[] = "Vivisectionist";
X<int,"Studebaker"> x1; // { dg-error "string literal" }
X<int, p> x2;
// { dg-bogus "" "additional errors" { xfail *-*-* } 11 }
|
google | android | crash81 | .C | toolchain/gcc/gcc-4.9/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 | android | ntp2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ntp2.C | 358 | utf_8 | 506fde7f525665b80bb8ae93c21fa34f | // { dg-do compile }
// PR 3784: We were confusing non-type template parms.
template <unsigned N> class X { };
template <short N> void foo1(X<N>);
template <unsigned N> void foo2(X<N>);
int main() {
X<2> x;
foo2(x);
} |
google | android | crash83 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash83.C | 143 | utf_8 | 8feaa48f5e36ee2582e8cf59664d8c67 | // PR c++/37650
template<int> struct A {};
template<typename = class A<0>: > struct B {}; // { dg-error "explicit specialization|expected" }
|
google | android | friend56 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend56.C | 188 | utf_8 | 924b064dc05ff4fa7442b9741496c5e9 | // Make sure we don't mistakenly mark f as DECL_COMDAT.
// { dg-final { scan-assembler "_Z1fv" } }
void f();
template <class T> struct A
{
friend void f();
};
A<int> a;
void f() { }
|
google | android | friend42 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend42.C | 157 | utf_8 | 8f75af1c73180eecafb9d5d27f306dd5 | // { dg-do compile }
template <class T> void foo (int);
template <class T>
class Q {
friend void foo<T> (int = 3); // { dg-error "default argument" }
};
|
google | android | crash82 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash82.C | 106 | utf_8 | 48025659900eff63e716215d6ceef06e | // PR c++/37649
struct A
{
template<int> struct {}; // { dg-error "template class without a name" }
};
|
google | android | crash24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash24.C | 191 | utf_8 | 1cb212177b7a7b17863561096ca1b123 | // PR c++/17826
struct A
{
template<typename> static int foo();
};
template<int> struct B {};
template<typename T> void bar()
{
B<sizeof A::foo<T>()> b1;
B<sizeof A::foo<T>()> b2;
}
|
google | android | error28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error28.C | 94 | utf_8 | d977c0ff2fe276dbe8cf1ea701e05180 | // PR c++/27211
struct A {};
template<int> void A::foo(); // { dg-error "member function" }
|
google | android | crash41 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash41.C | 249 | utf_8 | d19af02c7a265a8211457432a191f4f5 | // PR c++/22464
template<typename T>
void do_something(const T* A) // { dg-message "declared" }
{
struct helper_t{
helper_t() {
A[0]; // { dg-error "use" }
}
} helper;
}
void sub1() {
double A[7];
do_something (A);
}
|
google | android | non-dependent4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-dependent4.C | 107 | utf_8 | c74bd06e4f01d82b6dffe8568a9f9286 | int temp(const char *temp);
template <int> int g() { return temp("Hi"); }
int g1() { return temp("Hi"); }
|
google | android | access5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access5.C | 417 | utf_8 | 043c53bbc7cad60a3c72bfa79987f011 | // { dg-do compile }
// PR c++/7348
// Access control for typename in function return type
class Outer {
template <int dim> struct Inner {
typedef int T;
T foo ();
};
public:
Outer();
};
template <int dim>
typename Outer::Inner<dim>::T Outer::Inner<dim>::foo () {
return 1;
}
template st... |
google | android | defarg9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/defarg9.C | 257 | utf_8 | bbc0cedc0c23e5084b73fd2bd7d12be0 | // PR c++/28048
template<typename T> struct Boom;
template<typename T, bool D = Boom<T>::Internal::Value> // <--ICE
struct Foo
{
};
template<typename T> struct Boom
{
struct Internal
{
static const bool Value = false;
};
};
|
google | android | typedef20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef20.C | 452 | utf_8 | 7faab9101c09d7c36b9d0b53eea8002f | // Origin PR c++/40007
// { dg-do compile }
class x
{
typedef int privtype; // { dg-error "is private" }
protected:
typedef int type;
};
template<typename T>
struct y : public x
{
typename x::type z;
};
template<typename T>
struct y<T*> : public x
{
typedef x::type good;
typedef x::privtype bad; // { dg-error... |
google | android | spec34 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/spec34.C | 164 | utf_8 | 1503455e6bff13911dd306082359dbdf | // PR c++/26988
struct B{};
struct Bar : virtual B {
template <typename T> Bar( T const& cast );
};
template <> Bar::Bar( int const & cast ) {}
|
google | android | lookup1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lookup1.C | 176 | utf_8 | 858241029bc9c5f2b0eb96ca1ff057a8 | template <class T0>
class A {
public:
class B;
};
template <class T0>
class A<T0>::B {
public:
class C;
};
template <class T0>
class A<T0>::B::C {
public:
A<T0> &a;
};
|
google | android | constant2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/constant2.C | 335 | utf_8 | 84ddc9149ab5cd6be47e98d5f28f6bfb | // PR c++/49896
template<class C>
class test {
protected:
static const int versionConst = 0x80000000;
enum { versionEnum = versionConst };
public:
int getVersion();
};
template<class C>
int test<C>::getVersion() {
return versionEnum;
}
class dummy_class {};
int main() {
test<dummy_class> t;
return t.g... |
google | android | complit2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/complit2.C | 204 | utf_8 | 77418f7f80d69270d799af7b1a478dee | // PR c++/31038
// { dg-options "" }
template<int> void foo()
{
int i = (int) { 0 };
}
template void foo<0>();
int f();
template<int> void bar()
{
int i = (int) { f() };
}
template void bar<0>();
|
google | android | class2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/class2.C | 100 | utf_8 | 4a9fdbf9e37ab379d97118860f6e5744 | // PR c++/13451
template <class T>
struct A {
struct B;
struct A::B { }; // { dg-error "" }
};
|
google | android | friend44 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend44.C | 210 | utf_8 | 8898b9d763350fbb61e51a2b20b5615c | // { dg-options "-fshow-column" }
//PR c++/28260
template<int> struct A
{
friend int foo(); // { dg-error "14:ambiguating new declaration" }
};
void foo() { A<0> a; } // { dg-message "6:old declaration" }
|
google | android | ref4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ref4.C | 176 | utf_8 | c3bbc6f642a26de6b3238750b8f9c01f | // PR c++/41972
struct X {
static const double x;
};
template <const double& _test_>
class Foo { };
template <typename _ignore_>
struct Y {
typedef Foo<X::x> type;
};
|
google | android | friend32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend32.C | 372 | utf_8 | 4b2faf990ece399ef653adf003ad8e5c | // { dg-do compile }
// PR c++/18825: ICE member as friend
template<class T> class A
{
void f (); // { dg-error "private" }
};
template<class T> class B
{
friend void A<T>::f (); // { dg-error "this context" }
};
int f ()
{
B<int> b; // { dg-message "required" }
} |
google | android | init9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/init9.C | 124 | utf_8 | 076870e80a684a5a6a6b5bf148ed5356 | // PR c++/20140
template<typename T> void foo()
{
unsigned char s[] = "";
}
int main()
{
foo<char>();
foo<int>();
}
|
google | android | access14 | .C | toolchain/gcc/gcc-4.9/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 | android | fn-ptr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/fn-ptr1.C | 78 | utf_8 | fe166f987dc66815758e22b930f6d98b | // PR c++/48162
struct A { };
A (*f)();
template <class T> void g() { f(); }
|
google | android | dependent-expr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dependent-expr1.C | 552 | utf_8 | 4e28ad3da9cf0f80841dd7ac6a9a0233 | // { dg-do compile }
// PR c++ 9779. ICE
struct I
{
};
void Foo (int);
namespace std
{
template <typename X>
void Baz (I *x)
{
Foo (sizeof (I));
Foo (sizeof (x));
Foo (__alignof__ (I));
Foo (__alignof__ (x));
Foo (x->~I ()); // { dg-error "" }
// Foo (typeid (I));
Foo (delete x); /... |
google | android | anon4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/anon4.C | 153 | utf_8 | 66a2a8fd730ed0d9822656e2f45bc924 | // PR c++/28407
// A declaration in the anonymous namespace still has external linkage.
template <int *P> class A { };
namespace
{
int i;
}
A<&i> a;
|
google | android | lookup9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lookup9.C | 208 | utf_8 | bb52434ae68df7b63381367196a2b162 | // PR c++/50848
// { dg-options "-fpermissive" }
template<class T> class A {T& foo;};
template<class T> class B: public A<T> {
void f(){
foo(1); // { dg-message "foo" }
}
};
template class B<int>;
|
google | android | static12 | .C | toolchain/gcc/gcc-4.9/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 | android | arrow3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/arrow3.C | 450 | utf_8 | e30efe0e5c7e8e02c14d6e5369fe8a0d | // PR c++/56895
// { dg-do compile }
extern struct A { bool foo (); A bar (); } *a;
template <int>
int
baz1 ()
{
return 2 << (a->bar().foo() ? 1 : 0);
}
template <int>
int
baz2 ()
{
return 2 >> (a->bar().foo() ? 1 : 0);
}
template <int>
int
baz3 ()
{
return 10 / (a->bar().foo() ? 1 : 2);
}
template <int>
int... |
google | android | typedef10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef10.C | 200 | utf_8 | da5e10dcd0d113f42f94806f2313be36 | // PR c++/34573
template < class Gtr_>
void compute_gr()
{
typedef int Less_chain;
struct utils {
utils(const Less_chain& lc) {};
};
utils U(1);
}
int main(void){
compute_gr<int>();
}
|
google | android | crash39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash39.C | 216 | utf_8 | 8f6845bffb93b02eaa82345494464454 | // PR c++/22405
template <typename T> void foo(T &arg) { // { dg-message "declared" }
arg+=1;
}
template <typename T> void foo(T &arg) { // { dg-error "redefinition" }
arg+=2;
}
template void foo(float &arg);
|
google | android | repo10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo10.C | 278 | utf_8 | 78a6f5ce3eb51c78d7602a071bd63d23 | // PR c++/51910
// { dg-options -frepo }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
// { dg-final cleanup-repo-files }
template<typename T>
struct Foo
{
virtual ~Foo() { }
};
int main( int, char*[] )
{
Foo<int> test;
}
|
google | android | instantiate1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate1.C | 395 | utf_8 | f8b1065b008b6e16079f73a10fc394ef | // { dg-do compile }
// Origin:
// PR c++/6716
// ICE in complex class structure when components are incomplete
template <class T> struct X {
T t; // { dg-error "incomplete" }
};
template <class T> struct Y {
X<T> x; // { dg-message "required" }
};
template <class T> struct Z { // { dg-error "declaration" ... |
google | android | instantiate11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate11.C | 386 | utf_8 | 8095fd8717b385911f23d51f2a4cad60 | // PR c++/42608
// { dg-do compile }
template <class U, class V>
struct A;
template <class V>
struct A<int, V>
{
void f ();
};
template struct A<int, int>;
int
main ()
{
A<int, int> a;
a.f ();
return 0;
}
// Make sure we get undefined reference error if
// A<int, int>::f () isn't instantiated elsewhere.
//... |
google | android | local6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/local6.C | 641 | utf_8 | 4419b1a0c4d0571cfe9b43906ee4cff8 | template <class T> struct PCVector2 // { dg-message "note" }
{
template <class T2> PCVector2(const PCVector2<T> &cv) ; // { dg-message "note" }
PCVector2<T> operator- (const PCVector2<T> &ov) const
{
return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "matching" }
// { dg-message "(candidate|expe... |
google | android | warn1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/warn1.C | 584 | utf_8 | 8187509809176ee0fe06c4fa7bedf855 | // { dg-do compile }
// { dg-options "-Wall" }
// PR 11512. erroneous warnings
template <class T> void Foo(T i)
{
i++, i++;
i, i++; // { dg-warning "left operand" "" }
i++, i; // { dg-warning "right operand" "" }
for (;; --i, ++i)
;
}
void Bar ()
{
Foo (1); // { dg-message "required" }
}
struct M ... |
google | android | func1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/func1.C | 254 | utf_8 | d5d24fc94d133229a10c5b13f44c253b | template <typename T1,typename T2>
inline void f(const T1&,const T2&) { }
template <typename T1,typename T2,void F(const T1&,const T2&)>
struct A {
template <typename T> void g(T& i) { }
};
int main() {
int i;
A<int,int,f> a;
a.g(i);
}
|
google | android | partial4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial4.C | 306 | utf_8 | dbd288590e967c40dee79909821124df | // PR c++/25342
template < typename eval >
struct tpl_seq_search {
typedef typename eval::enum_type Enum;
template < Enum first, Enum last >
struct range {
};
template < Enum val >
struct range<val,val> {
};
};
struct xxx {
typedef int enum_type;
tpl_seq_search<xxx>::range<0, 1> a;
};
|
google | android | ptrmem9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem9.C | 131 | utf_8 | 6cdf7b7a7a495367d144ca4b7238a771 | // PR c++/15329
struct S {};
template <typename> struct X {
S s;
void foo (void (S::*p)())
{ (s.*p)(); }
};
|
google | android | crash48 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash48.C | 231 | utf_8 | f0bd0eae9334110a2b233af760fab84d | // PR c++/11471
// { dg-do compile }
template<typename T> struct A
{
typedef typename T::X X;
};
template<typename T> A<T>::X::X() {} // { dg-error "no type|invalid use|not a type|dependent" } |
google | android | using8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using8.C | 283 | utf_8 | 4b82993be36fd76cdb24298731b1c1e6 | // { dg-do compile }
// PR c++/9810: Access checking for member function template
// appeared in using declaration.
struct A
{
template<class R> void F(R) {}
};
struct B: private A
{
using A::F;
};
int main()
{
B b;
b.F(3);
} |
google | android | crash46 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash46.C | 80 | utf_8 | 933d195d117ede217f70567360e6e511 | // PR c++/27102
template <class T>
void T::foo() {} // { dg-error "invalid" }
|
google | android | nontype25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype25.C | 575 | utf_8 | 012401e83b5de7b151f29b349c874b7b | // { dg-do compile }
class A {};
class B : public A {};
template<const A* a> class C {};
template<const B* b> class D {};
template<B* b> class E {};
template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" }
template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error... |
google | android | new12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/new12.C | 294 | utf_8 | 22fdea7e0d8c7b43828d7f57e62f8723 | // PR c++/48500
struct linked_ptr {
};
template <typename T> linked_ptr make_linked_ptr(T* ptr);
struct Concrete;
struct NewedClass {
NewedClass(const Concrete& req){}
};
template<typename ArgT> void AddObjToChange(const ArgT& req) {
linked_ptr p = make_linked_ptr(new NewedClass(req));
}
|
google | android | canon-type-9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-9.C | 251 | utf_8 | 883c715e739a48e6b3cdf914b95fb5e0 | // { dg-do compile { target c++11 } }
struct F { F(int) {}};
template<class T, T* u>
struct S
{
decltype(u) foo(T);
};
template<class T, T *u>
decltype(u) S<T, u>::foo(T)
{
T t;
return t;
} |
google | android | repo2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/repo2.C | 438 | utf_8 | 5126d45ee77f7897ba034d0dea05e3dc | // PR c++/17163
// { dg-options "-frepo" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template <int __inst>
struct __Atomicity_lock
{
static unsigned char _S_atomicity_lock;
};
template <int __inst>
unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
te... |
google | android | partial9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial9.C | 93 | utf_8 | 38d6a93d39574f0fe432f5e41591e968 | // PR c++/36435
template <class T> T f();
template <class T> T* f() { }
template int* f();
|
google | android | local3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/local3.C | 157 | utf_8 | e254df20b082728d0e04a8e1b3b18557 | template<class T>
void f(const T&)
{
struct B {
void g (T);
};
B b;
}
void g()
{
f(42);
}
|
google | android | error-recovery2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error-recovery2.C | 131 | utf_8 | b3e2bbd8608c9f9206f9850201803c3c | // PR c++/43621
template <typename T>
class A {
template <typename>
A<T> A<T>::f(); // { dg-error "extra qualification" }
};
|
google | android | call5 | .C | toolchain/gcc/gcc-4.9/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 | android | access20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access20.C | 295 | utf_8 | 97435ae64eee527d6ffaaa5dcc63f78e | // PR c++/29470
template <typename T> struct B
{
protected:
T v; // { dg-error "protected" }
};
template <typename T> struct D : B<T>
{
protected:
using B<T>::v;
};
int main()
{
D<int> d;
d.v = 0; // { dg-error "context" }
return 0;
}
|
google | android | bitfield1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/bitfield1.C | 146 | utf_8 | 2f3399aac63bff69580e94f66f716e0b | // PR c++/50280
struct S { int bf : 3; };
template<class _T1>
void make_pair(_T1& __x) {}
void foo() {
const S s = S();
make_pair(s.bf);
}
|
google | android | using22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using22.C | 661 | utf_8 | 15875b358b7888d3afb1bb2d41b1be7f | // PR c++/52126
// { dg-do compile }
template <class T> struct Z {};
template<typename T>
struct A
{
struct B;
struct C;
struct D;
struct E;
struct F;
};
template <class T>
struct A<T>::B : A<T>
{
using A::nonexist; // { dg-error "no members matching" }
};
template <class T>
struct A<T>::C : A
{
using... |
google | android | partial1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial1.C | 636 | utf_8 | bb04475dfd1abb6699b6daee337bc7ef | // { dg-do run }
// PR c++/6620
// Partial specialization involving expression of non-type template
// parameter causes ICE.
extern "C" void abort();
template <int N> struct HoldInt
{
};
template <class A, class B> struct Add
{
};
template <int N> struct Add<HoldInt<N>, HoldInt<-N> >
{
typedef int type;
int f() { r... |
google | android | ptrmem25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem25.C | 118 | utf_8 | 486102b52761663d2915ac7d52f96b42 | // PR c++/49298
template <class T, int T::*> struct B { };
template <class T> struct A
{
int i;
B<A,&A::i> b;
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.