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 | sfinae20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sfinae20.C | 1,065 | utf_8 | 6fa7fa4fb4de4886b98de2ee612e609b | // PR c++/44907
// { dg-options "-std=c++0x" }
#include <utility>
struct A { };
struct B
: public A { };
struct C
: public A { };
struct D
: public B, public C { };
template<typename From, typename To>
class mini_is_convertible
{
typedef char one;
typedef struct { char arr[2]; } two;
template<typ... |
google | chromium | init7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/init7.C | 214 | utf_8 | 8b7e2ee31c044917df6c66a5933648fd | /* PR c++/31517. This used to ICE. */
/* { dg-do compile } */
template<typename> struct A
{
static const int i=0;
};
template<typename T> const int A<T>::i = 0=0; /* { dg-error "duplicate initialization" } */
|
google | chromium | call3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/call3.C | 172 | utf_8 | 938ec709598c5f0853b88b4eb0ccdebb | // PR c++/18436
void foo(int);
struct A
{
static void foo(A);
};
template <typename T> struct B : T
{
B() { foo(T()); } // { dg-error "cannot convert" }
};
B<A> b;
|
google | chromium | complit2 | .C | native_client/pnacl-gcc/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 | chromium | crash23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash23.C | 205 | utf_8 | 0ebb4bf976e610e29316a5634702a44e | // PR c++/17642
template<int dim>
int f(const int* const lsh, const int* const bbox, const int* const nghostzones, int d)
{
for (int d=0; d<dim; ++d)
lsh[d] - (bbox[2*d+1] ? 0 : nghostzones[d]);
}
|
google | chromium | spec14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec14.C | 374 | utf_8 | 8c1a1dce043f50d8d866a9779357c645 | // { dg-do compile }
// Origin: <weissr at informatik dot uni-tuebingen dot de>
// PR c++/3671: Non-type enum parameters must not be converted
enum T1 {a};
enum T2 {b};
struct Y {
template <T1 i> void foo() {}
template <T2 i> void foo() {}
};
struct Z {
template <T1 i> void foo() {}
};
template void Y::foo<b>... |
google | chromium | memtmpl2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memtmpl2.C | 341 | utf_8 | 742c5d9c3baa52309d717d8a67cb74e7 | // { dg-do compile }
// PR c++/12332. ICE
template <unsigned D> class TPL;
template <typename T> struct X {
template <template <typename> class V>
V<TPL<V<int>::d> > operator () ();
};
void Foo (X<int> x) {} |
google | chromium | nontype1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype1.C | 177 | utf_8 | 0841e0681f53f5792b711984e991f3a8 | // PR c++/4934
// dump_expr didn't know how to deal with a CONVERT_EXPR with no type.
template<unsigned> struct A {};
template<typename T> struct B { A<sizeof(+int())> a; };
|
google | chromium | error30 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error30.C | 138 | utf_8 | 1c44a4e548dcd05ce209cc978411cde0 | // PR c++/33210
template<int> struct A;
template<template<typename> class B> A<B<int>::x> operator() (); // { dg-error "A<B<int>::x>" }
|
google | chromium | memfriend17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memfriend17.C | 736 | utf_8 | e332cbd440f56b59e50c307b5f9d0e84 | // { dg-do compile }
// PR c++/13495: Nested class as template friend.
template<typename T>
class A{
public:
class B
{
void func1(void);
void func2(void);
};
};
template<typename Q>
class F1
{
friend class A<Q>::B;
enum { foo = 0 }; // { dg-error "private" }
};
template<typename Q>
c... |
google | chromium | qualttp5 | .C | native_client/pnacl-gcc/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 | chromium | nontype16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype16.C | 167 | utf_8 | efe778ec780ff5ae0b39781a917ca677 | //PR c++/27962
template<int> struct A
{
template<typename> void foo();
};
template<> template<struct T> void A<0>::foo() {} // { dg-error "not a valid type" }
|
google | chromium | error9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error9.C | 85 | utf_8 | 6c82c4d5cc4e1f6f70e1b41aa6299b35 | // PR c++/10926
struct Foo
{
template <int i>
~Foo(); // { dg-error "" }
};
|
google | chromium | sizeof7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sizeof7.C | 337 | utf_8 | 0c4917a1350de8892aea4bca2d593036 | // { dg-do compile }
// PR c++/10858: failure with calling a method inside sizeof in a template
template <int> struct P {};
void bar ();
template <class T> struct X {
static int foo(void (*)());
P<sizeof(foo(&bar))> p;
};
template class X<int>; |
google | chromium | static29 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static29.C | 115 | utf_8 | e9b1989c04a7b26eeb97573f87c42c52 | // PR c++/29570
template<int> struct A { static const int i; };
template<int N> const int A<N>::i = { A<N>::i };
|
google | chromium | crash73 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash73.C | 184 | utf_8 | b6d335f5ace93b3d4a0fd5d2614a2df2 | // PR c++/34100
// { dg-do compile }
template<typename T> struct A
{
typedef typename T::X Y __attribute__((vector_size(8))); // { dg-error "is not a class, struct" }
};
A<int> a;
|
google | chromium | typedef32 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef32.C | 812 | utf_8 | eb9536bda0639eade20a999acdb363d0 | // Origin: PR c++/43704
// { dg-do compile }
template<typename T2, typename T3>
struct if_
{
typedef T2 type;
};
template<class I1>
struct iterator_restrict_traits
{
struct iterator_category {};
};
template<class T>
struct matrix
{
struct ci {struct ic {};};
class i {};
};
template<class M, class TRI>
struct... |
google | chromium | friend16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend16.C | 320 | utf_8 | 594b1d8549baa1139753596a807dbd91 | // { dg-do compile }
// PR c++/9602: Inline friend/pure virtual tree data sharing in
// class template.
template <typename T> struct X {
void foo (X);
friend void bar () {}
};
template <typename T>
void X<T>::foo (X x) {}
template struct X<int>; |
google | chromium | instantiate3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/instantiate3.C | 455 | utf_8 | 4e1ed3ad23d254ecb6d55d14a7797518 | // { dg-do compile }
// PR c++/7639
// ICE when accessing member with incomplete type.
class ACE_Null_Mutex; // { dg-error "forward declaration" }
template <class TYPE>
struct ACE_Cleanup_Adapter
{
TYPE &object ()
{ return object_; } // { dg-error "invalid" }
TYPE object_; // { dg-error "incomplete type" }
};
te... |
google | chromium | crash93 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash93.C | 136 | utf_8 | 6ce63664012487deb9533d83bc1200a8 | // PR c++/40371
struct A
{
typedef void (&F)();
template<int> operator F();
};
void foo()
{
A()(); // { dg-error "no match" }
}
|
google | chromium | func2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/func2.C | 406 | utf_8 | d68216ca94895657c1d7e1a9deffaa6e | // { dg-do compile }
typedef void (*fptr)();
fptr zeroptr = 0;
template<typename T, fptr F> struct foo { };
template<typename T> struct foo<T,zeroptr> { };
// { dg-error "not a valid template argument" "not valid" { target *-*-* } 6 }
// { dg-error "must be the address" "must be the address " { target *-*-* } 6 }
//... |
google | chromium | nontype23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype23.C | 181 | utf_8 | d17e17b15018e6bc4a807c47ac6956b7 | // PR c++/48936
template <bool C> int foo (void);
template <class T> struct S
{
static const unsigned int a = sizeof (T);
enum { c = sizeof (foo <(a == 0)> ()) };
};
S<int> x;
|
google | chromium | typename6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typename6.C | 132 | utf_8 | ed39e1b4f163d77da95d420ba783410c | struct O {
template <typename T>
struct I {
I (int);
};
};
template <typename T>
void f() {
typename ::O::I<int>(3);
}
|
google | chromium | typedef33 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef33.C | 307 | utf_8 | 1d7cb3a11b396d2a715284cd37246728 | // Origin PR c++/43800
// { dg-do compile }
template<class T, class U=T>
struct V
{
typedef T t_type;
};
template<class T>
class J
{
typedef typename V<T>::t_type t_type;
const t_type& f(); // #0:
private:
t_type b;
};
template<class T>
const typename V<T>::t_type& J<T>::f() {return b;} // #1
|
google | chromium | init8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/init8.C | 888 | utf_8 | 64a05fc8eebed95ff925e08b8a3bf935 | // PR c++/36089
// { dg-do run }
extern "C" void abort ();
int f ()
{
const int c(2);
int d[c] = { 0, 0 };
return d[0] + sizeof d;
}
struct A
{
static int f ()
{
const int c(2);
int d[c] = { 0, 0 };
return d[0] + sizeof d;
}
};
template <int> struct B
{
static int f ()
{
const int c ... |
google | chromium | nested5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nested5.C | 223 | utf_8 | 73ab67ac2716db374ac0d80e7ae5b200 | // PR c++/33959
template <typename T> struct A
{
struct C
{
template <typename U> struct D {};
};
template <typename S> static C::D<S> bar (S const &);
};
struct E {};
int
main ()
{
E e;
A<E>::bar (e);
}
|
google | chromium | sizeof-template-argument | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sizeof-template-argument.C | 481 | utf_8 | 8494f0b11ea1cc6232d54fd15bb151ef | /* This used to ICE (PR c++/29573) */
/* { dg-do compile } */
template<int> struct A {};
template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "parse error in template argument list" } */
int a;
templ... |
google | chromium | const1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/const1.C | 442 | utf_8 | 2096b2764f21d9bd35c06fef449c8404 | // PR c++/28385
// instantiating op() with void()() was making the compiler think that 'fcn'
// was const, so it could eliminate the call.
// { dg-do run }
extern "C" void abort (void);
int barcnt = 0;
class Foo {
public:
template<typename T>
void operator()(const T& fcn) {
fcn();
}
};
void bar... |
google | chromium | crash106 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash106.C | 235 | utf_8 | 4fe0cc99c36f5dcc274c6cfab9e47405 | // PR c++/47974
typedef double T;
struct A
{
template<T> void foo(); // { dg-error "type" }
};
template<T N = 0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared" }
B<> b; // { dg-error "type|declaration" }
|
google | chromium | nontype13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype13.C | 363 | utf_8 | eac53139bfea77a80257ec2991cf6886 | // 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<bool B>
struct bar
{
void operator()()
{ }
};
};
int main()
{
Dummy<int> d;
d.tester... |
google | chromium | spec20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec20.C | 387 | utf_8 | ed4d5e577ced48d91b3a5054ba58d4c5 | // Bug 19203: Failure to implement DR 214
template <class A>
void foo(const A& a);
template <class RET, class ARG1>
int foo(RET (&)(ARG1)); // this one
float decl(int);
int bar(void)
{
return foo(decl);
} |
google | chromium | deduce3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/deduce3.C | 353 | utf_8 | f1e84103e0e62d5ec66b9f18139b049a | template <typename T>
void f(int, T (*)() = 0); // { dg-message "note" }
void g() {
typedef int A[2];
f<A>(0); // { dg-error "" }
// { dg-error "returning an array" "candidate explanation" { target *-*-* } 2 }
typedef void F();
f<F>(0); // { dg-error "" }
// { dg-error "returning a function" "candidate exp... |
google | chromium | error18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error18.C | 195 | utf_8 | e0e0adf8e99a8d206f7e74340f4b67e5 | // PR c++/20157
template<typename AT>
struct A{
template<typename T>
void function(T);
};
template<>
template<typename ABC,typename DEF>
void A<int>::function(ABC); // { dg-error "match" }
|
google | chromium | overload9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/overload9.C | 342 | utf_8 | ef296b5932e0fe10416d5e48eb64ccb1 | // PR c++/32232
template <typename T> struct A;
template <typename T> struct B {};
template <typename T> A<T>& operator<<(A<T>&, const B<T>&);
template <typename T>
struct A
{
A<T>& operator<<(A<T>& (*)(A<T>&));
};
template <typename T> A<T>& foo(A<T>&);
extern A<char> c;
int main () {
c << (1, foo); // { dg-e... |
google | chromium | defarg5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/defarg5.C | 512 | utf_8 | 84d085b3ed907df1747cc523efd8d714 | // { dg-do compile }
// PR c++/17344: Substitution failure is not an error
// for default template argument
template <class> struct intTraits;
template<> struct intTraits<int> {
static const int i = 0;
};
template<typename E, E i = intTraits<E>::i> struct A {};
struct S {
template <template <typenam... |
google | chromium | ref4 | .C | native_client/pnacl-gcc/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 | chromium | crash105 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash105.C | 237 | utf_8 | 4a4574ad61865d04b20b42d53911d094 | // PR c++/44118
template < typename > struct S;
template < typename > struct S < int >; // { dg-error "template" }
template < typename > struct S < int >
{
void f ();
};
void
f ()
{
S < int >::f (); // { dg-error "cannot call" }
}
|
google | chromium | explicit6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/explicit6.C | 297 | utf_8 | 0f1992cf38a7f4a3d4febc06bbe2dc39 | // Bug 19895: ICE on invalid
struct A;
template A<>::A(); // { dg-error "(not a template)|(explicit qualification)" "" } |
google | chromium | spec24 | .C | native_client/pnacl-gcc/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 | chromium | dtor7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/dtor7.C | 277 | utf_8 | 4a814bc6794f74cc5cd4043a45a39370 | // PR c++/40373
// { dg-do compile }
struct A;
namespace
{
struct A;
}
struct B {};
template <typename T> void
foo (T t)
{
t.~A (); // { dg-error "does not match destructor name" }
}
void
bar ()
{
foo (B ()); // { dg-bogus "required from here" "" { xfail *-*-* } }
}
|
google | chromium | typedef22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef22.C | 334 | utf_8 | 5fcbf88741a702858c518963fa2bd54e | // Origin: PR c++/14777
// { dg-do compile }
template <typename T>
struct B
{
protected:
typedef int M; // { dg-error "protected" }
};
template <typename T>
struct A : B<T> {
typedef typename B<char>::M N; // { dg-error "context" }
A (int = N ());
};
A<int> a = A<int> (); |
google | chromium | arg2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/arg2.C | 340 | utf_8 | 7bea6580b2b65de331f30831724d355f | // { 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" "" }
} |
google | chromium | nested2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nested2.C | 115 | utf_8 | 1cf2f3c9d70e586c16763a10c08d9972 | template <class T> class CO {
class CI1 {
class CI2;
};
};
template <class T>
class CO<T>::CI1::CI2 {};
|
google | chromium | qualttp13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp13.C | 433 | utf_8 | bbc53060e714151a182a421e8691abd5 | template <class U> struct A
{
template <class V> struct AA {
template <class T> struct B {
int i;
B() : i(1) {}
};
};
};
template <template <class> class TT> struct X
{
TT<int> y;
};
template <class T, class U> struct C
{
X<T::template AA<U>::template B> x;
};
int main()
{
C<A<char>, int> c;
} |
google | chromium | ref2 | .C | native_client/pnacl-gcc/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 | chromium | error19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error19.C | 269 | utf_8 | c141fe6a264c757500f6ee4ed30842f6 | // PR c++/23293
template < typename > struct P;
struct S;
void *unrelated_function()
{
typedef S K;
P < K > * p;
return p;
}
template < typename U >
void generate_warning()
{
U::x(); // { dg-error "P<S>" }
}
int main()
{
generate_warning< P < S > >();
}
|
google | chromium | ttp9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp9.C | 588 | utf_8 | 32ec8290dcb76d620e429687f0236c40 | // { dg-do compile }
// PR c++/12170: Deducing template template parameter from nested
// class template.
template <typename> struct W {};
template< template<typename> class F, typename T>
int foo(W< F<T> >);
template<typename T>
struct L {
static int const value = sizeof(foo(W<T>()));
typedef T type;
};
templ... |
google | chromium | defarg13 | .C | native_client/pnacl-gcc/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 | chromium | nontype15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nontype15.C | 289 | utf_8 | e4e6038ded9c7ed667109894758cea89 | struct foo {
typedef int (*fun)(int);
static int f(int); // overload between static & non-static
int f();
static int g(int); // non-overloaded static
};
template<foo::fun>
struct f_obj {
// something ..
};
int foo::f() {
f_obj<f> f1;
f_obj<g> f2;
return 0;
}
|
google | chromium | friend28 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend28.C | 449 | utf_8 | 5242e61bb45530434007931e7e9949d2 | // PR c++/15629
// { dg-do link }
template<int a, int b> class T;
template<int a, int b> void func(T<a, b> * t);
template<int a> void func(T<a, 3> * t) {}
template void func<2>(T<2, 3>*);
template<int a, int b> struct T {
friend void func<a, b>(T<a, b> * t);
friend void func<a> (T<a, 3> * t);
... |
google | chromium | sfinae11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sfinae11.C | 1,508 | utf_8 | 52303ab3e71ec37ab5f5099984d9715b | // DR 339
//
// Test of the use of the comma operator with SFINAE
// Boilerplate helpers
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<typename T> struct type { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struc... |
google | chromium | crash69 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash69.C | 228 | utf_8 | 2fe8caf6bfc48e5dbc0d295b6d6b0cf0 | // PR c++/31132
template<typename T> class A
{
static int i; // { dg-error "is private" }
friend int T::foo(); // { dg-error "does not match" }
};
struct B
{
void foo() { A<B>::i; } // { dg-error "within|candidate" }
};
|
google | chromium | crash76 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash76.C | 167 | utf_8 | f1a8c42b37d318db77076e2f45ccbce5 | // PR c++/34486
template<typename> struct A
{
typedef A* X;
};
template<typename T> struct B
{
using A<T>::X::Y; // { dg-error "not a base type" }
};
B<int> b;
|
google | chromium | error14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error14.C | 104 | utf_8 | 059b8fc25423ba0f718bb1feff4898e7 | // PR c++/16904
template<typename T> struct X
{
X() { this->T::i; } // { dg-error "" }
};
X<int> x;
|
google | chromium | friend36 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend36.C | 413 | utf_8 | 4a3d535a6673c42778883751bb5d71cd | // PR c++/22139
// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
template <int rank, int dim> class Tensor;
template <int rank, int dim> struct SymmetricTensor {
SymmetricTensor (const Tensor<2,dim> &t);
friend void foo();
};
template <> SymmetricTensor<2,2>::SymmetricTensor (const Te... |
google | chromium | ttp19 | .C | native_client/pnacl-gcc/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 | chromium | koenig2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/koenig2.C | 233 | utf_8 | 5e527c865bacdb52386cdb2f216a99d4 | namespace nsp_foo {
struct A {};
struct foo {};
}
namespace nsp_bar {
void foo(nsp_foo::A) {}
template <class T>
void bar(T t)
{
nsp_bar::foo(t); // line 16
}
}
int main()
{
nsp_bar::bar(nsp_foo::A());
}
|
google | chromium | error28 | .C | native_client/pnacl-gcc/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 | chromium | typedef3 | .C | native_client/pnacl-gcc/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 | chromium | repo5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/repo5.C | 402 | utf_8 | 4a25565c9833beec64e5bf027190e23a | // PR c++/25625
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
template< typename T, T N > struct integral_c {
static const T value = N;
typedef integral_c< T, value + 1 > next;
};
template< typename... |
google | chromium | crash107 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash107.C | 683 | utf_8 | 5dc94a58ad5762909af7c17381d31d7f | // PR c++/44625
// { dg-do compile }
// { dg-options "" }
template<typename FP_> struct Vec { // { dg-message "note" }
Vec& operator^=(Vec& rhs) {
union {
struct {FP_ x,y,z;};
}; // { dg-error "anonymous struct" }
X = y*rhs.z() - z*rhs.y(); // { dg-error "not declared|no mem... |
google | chromium | friend44 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend44.C | 207 | utf_8 | ca014134ba946687331d24b91db8c563 | // { dg-options "-fshow-column" }
//PR c++/28260
template<int> struct A
{
friend int foo(); // { dg-error "14:new declaration" }
};
void foo() { A<0> a; } // { dg-error "6:ambiguates old declaration" }
|
google | chromium | ctor2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ctor2.C | 140 | utf_8 | 5a69c7531482ab0af57cca8c90779073 | // { dg-do run }
int i;
template <class T>
struct S
{
S () { i = 1; }
};
static S<int> s[1];
int main ()
{
if (!i)
return 1;
}
|
google | chromium | pr28301 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/pr28301.C | 239 | utf_8 | d3ba333f92088ba255ebad2bc17cd0cf | // PR c++/28301
// { dg-do compile }
template<typename> struct A
{
template<int> void foo()
}; // { dg-error "initializer" }
template<> struct A<void>
{
template<int> void foo();
};
void bar()
{
A<void> a;
a.foo<0>();
}
|
google | chromium | qualttp19 | .C | native_client/pnacl-gcc/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 | chromium | memfriend8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memfriend8.C | 340 | utf_8 | 975bbbbf89c7ed7467afe0db4642b444 | // { dg-do compile }
// PR c++/5369: Member function of class template as friend
template <class T>
struct S
{
int foo () {
return S<int>::bar ();
}
private:
template <class U>
friend int S<U>::foo ();
static int bar () { return 0; }
};
int main ()
{
S<char>().foo ();
} |
google | chromium | redecl2 | .C | native_client/pnacl-gcc/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 | chromium | qualttp2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp2.C | 322 | utf_8 | e1b6f19153852a341aae2955eb8ea280 | // { dg-do compile }
struct A
{
template <class T> class B {};
};
template <int i> struct X
{
};
template <class T> struct C
{
X<T::template B> x; // { dg-error "type" }
};
int main()
{
C<A> c;
} |
google | chromium | error24 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error24.C | 113 | utf_8 | 6c54776e760954055280860b689859b0 | // PR c++/30863
template <typename T>
struct s {};
void f() {
unsigned s<int> x; // { dg-error "invalid" }
}
|
google | chromium | using13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/using13.C | 166 | utf_8 | acded0229c96d99f990ffa1d7bc1d123 | //PR c++/28051
template<int> struct A {};
template<int N> struct B : A<N>
{
using A<N>::operator typename A<N>::X; // { dg-error "no type named" }
};
B<0> b;
|
google | chromium | static22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static22.C | 157 | utf_8 | bae55093a55e080f11929eea52536a38 | // PR c++/26266
template<typename> struct A
{
static const int i = 1;
static const int j = i;
static const int k = int(j);
int x[k];
};
A<char> a;
|
google | chromium | qual1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qual1.C | 335 | utf_8 | 5512deff68cfd95af05439dc39d36f5c | // { dg-do compile }
template<class T>
class Link_array
{
public:
void sort (int (*compare) (T *const&,T *const&));
};
int shift_compare (int *const &, int *const &) {}
template<class T> void
Link_array<T>::sort (int (*compare) (T *const&,T *const&))
{
}
void f ()
{
Link_array<int> clashes;
clashes.sort (shi... |
google | chromium | crash68 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash68.C | 328 | utf_8 | c1f00d9dd86a49d2de34225f9a691ce2 | // PR c++/33035
template<class A>
struct a {
template<class B>
struct b {
template<class C>
void f()
{
struct g
{
~g() {}
};
}
... |
google | chromium | defarg7 | .C | native_client/pnacl-gcc/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 | chromium | wrap1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/wrap1.C | 553 | utf_8 | 577a7a4f76f06bf7384ad303d275f983 | // { dg-do compile }
// instance of an actual pattern in 252.eon from SPEC2000
// The last Wrapper<char> once wasn't completed when applying '='.
template <class T>
class Wrapper {
public:
Wrapper (T& a);
Wrapper (const Wrapper<char>& ref);
};
template <class T>
class Element {
public:
T * operator[](int x)... |
google | chromium | error10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error10.C | 1,375 | utf_8 | a5aedd671af7a8cdd7d4e6c0bc538ee6 | // { dg-do compile }
// { dg-options "-std=gnu++98" }
// Origin: <tilps at hotmail dot com>
// c++/9154: poor error message for ">>" vs "> >" in template argument list
/*
* Test that the error message is issued properly
*/
template <class T>
class A {};
A<A<int>> blah; // { dg-error "should be '> >' within" }
A<i... |
google | chromium | defarg9 | .C | native_client/pnacl-gcc/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 | chromium | ptrmem18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem18.C | 606 | utf_8 | c29b186e715b166abc3703fea2205647 | // PR c++/33616
// { dg-do run }
// { dg-options "-O2" }
extern "C" void abort ();
struct S {
int c;
S () : c (0) {}
virtual void f1 () { c += 1; }
virtual void f2 () { c += 16; }
};
struct T {
S s;
};
typedef void (S::*Q) ();
template <Q P>
void test1 (T *t)
{
(t->s.*P)();
}
template <Q P>
void test2... |
google | chromium | spec4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec4.C | 291 | utf_8 | 2a1077a58e27e49e8f92e9122c330685 | // { dg-do compile }
// PR c++/2863
// Default function argument and template specialization.
struct X {
template <int dim> void f(int=0);
};
template <> void X::f<1> () {} // { dg-error "(not match|declaration)" } |
google | chromium | overload7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/overload7.C | 535 | utf_8 | d98c22f6d2dfeb8d0131c9e0467d2655 | // { dg-do run }
struct A
{
virtual int Foo () { return 1; }
};
struct B : public A
{
virtual int Foo () { return 2; }
};
template <class T>
int Bar (T *a)
{
if (static_cast<A*>(a)->A::Foo () != 1)
return 1;
if (static_cast<A*>(a)->Foo () != 2)
return 2;
return 0;
}
int main ()
{
return Bar (new B);... |
google | chromium | ptrmem21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem21.C | 627 | utf_8 | d789c4b198aaf983e81643a1d995a8da | // PR c++/43868
// { dg-options "-g" }
struct Foo
{
virtual void do_something() = 0;
};
template <typename T>
struct Foo_impl;
template <typename R, typename O>
struct Foo_impl<R (O::*)() const> : public Foo
{
struct Helper
{
typedef int Some_type;
operator Some_type () const { return 0; ... |
google | chromium | conv5 | .C | native_client/pnacl-gcc/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 | chromium | crash79 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash79.C | 148 | utf_8 | fbd484dabcedafb4f6a55188390fd076 | // PR c++/36404
struct A
{
A(int);
template<int> enum { e }; // { dg-error "template|expected" }
};
A a(A::e); // { dg-error "not a member" }
|
google | chromium | recurse2 | .C | native_client/pnacl-gcc/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 | chromium | anon3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/anon3.C | 217 | utf_8 | fb2e00c0df67ca0bdb82db579b06a881 | // PR c++/28370
// { dg-do run }
namespace
{
template<typename T> struct A { static int *a; };
template<typename T> int *A<T>::a = 0;
}
int *
foo ()
{
return A<int>::a;
}
int
main ()
{
return foo() != 0;
}
|
google | chromium | crash33 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash33.C | 113 | utf_8 | 204eff887d15d36069d7065b01240cf5 | // PR c++/19253
namespace N {}
template<typename> struct A
{
A<typename N::X<int> > a; // { dg-error "" }
};
|
google | chromium | ptrmem19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem19.C | 295 | utf_8 | 0560572d5223bb42d46f697f052023bb | // PR c++/40780
// { dg-do compile }
template <class T1, typename T2, typename T3>
struct A
{
typedef T2 (T1::*m) (T3);
A (m) {}
};
struct B;
struct C
{
void foo (B *);
};
typedef A <C, void, B *> D;
typedef void (C::*E) (B *);
struct F;
typedef void (C::*G) (F);
D d ((E) (G) & C::foo);
|
google | chromium | typename3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typename3.C | 119 | utf_8 | baaa577db3fc32c6dd18e8cfa76705eb | // { dg-do compile }
// crash test - PR 7266
template <class A>
struct B {
typedef A::C::D E; // { dg-error "" }
};
|
google | chromium | crash28 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash28.C | 132 | utf_8 | 902d626992584b53e5dc2b44257c55a4 | // PR c++/18445
struct a
{
int what();
};
void g(void*);
template<class T>
void f()
{
a ex;
g(ex.what); // { dg-error "" }
}
|
google | chromium | sizeof10 | .C | native_client/pnacl-gcc/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 | chromium | access8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/access8.C | 341 | utf_8 | 51a27bac3d6d8fa430db3b405c07c5af | // { dg-do compile }
// Template instantiate during deferred access check
template <class T> struct C {
typedef typename T::X Y;
};
class A {
typedef int X;
template <class T> friend struct C;
};
C<A>::Y f(int); |
google | chromium | crash22 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash22.C | 512 | utf_8 | 1a93146cc62f110f6b65fd8e3eb06d85 | // { dg-do compile }
// PR c++/16706: Dependent type calculation during access checking
template<typename> struct A
{
A();
template<typename> struct X {};
};
template<typename T> struct B
{
typename A<T>::template X<int> x;
template<typename> struct C;
};
template<typename T> template<typename U> struc... |
google | chromium | typedef23 | .C | native_client/pnacl-gcc/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 | chromium | crash82 | .C | native_client/pnacl-gcc/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 | chromium | typedef16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef16.C | 372 | utf_8 | 7af5e83153c54bd7a3a8638675111507 | // Origin PR c++/26693
// { dg-do compile }
struct C0
{
};
template<class T, class U>
struct C1
{
typedef C0 TypedefedC0;
template<class W>
void foo (TypedefedC0 *, W)
{
}
template<class W> C1 (W w)
{
TypedefedC0 c;
foo (&c, w);
}
};
C0 c0;
C1<int, char> c1 (&c0); |
google | chromium | anon2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/anon2.C | 327 | utf_8 | 989ad07a7ee0d8ab918018598ad338ab | // PR c++/28279
// finish_static_data_member_decl was confused by the anonymous
// namespace causing TREE_PUBLIC to be unset
template<typename T>
struct is_pointer_impl {
static const bool value = true;
};
namespace {
class prefix_name_mapper {};
}
static const bool val = is_pointer_impl<prefix_name_mapper>::v... |
google | chromium | error23 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error23.C | 235 | utf_8 | fa7f4116ebf37e2b57813ba48500f497 | // PR c++/29632
struct nullptr_type {
nullptr_type ( void ) {}
template < typename T >
operator T* ( void ) const {
return ( 0 );
}
} const nullptr_ob;
int main ( void ) {
0 == nullptr_ob; // { dg-error "match" }
}
|
google | chromium | unify4 | .C | native_client/pnacl-gcc/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 | chromium | typedef35 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef35.C | 724 | utf_8 | d447ec4608ca63e798d20ef66c21b002 | // Origin c++/45558
// { dg-do compile }
template <typename S, typename T>
struct C
{
template <typename U>
struct B
{
template <typename W>
struct E
{
explicit E(const W &x) : w(x) {}
const W &w;
};
};
};
struct F;
template <typename X>
struct D
{
D() {}
};
const D<F> g;
templa... |
google | chromium | type2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/type2.C | 346 | utf_8 | 7bd261d29e895f70198d2995a62cbd35 | // { dg-do compile }
// PR c++/8442
// Type template parameter incorrectly treated as template template
// parameter.
template <typename T> struct A {};
template <typename T> struct B
{
template <typename U> struct C {};
template <typename U> A<C<U> > foo(U);
};
B<void> b; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.