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 | const2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/const2.C | 319 | utf_8 | 98b1720316bc749eaed8150f3ddb776c | // PR c++/39608
// We were improperly considering dependent members of the current
// instantiation to be non-constant (and therefore invalid template
// non-type arguments).
template <int I>
struct C {};
template <class T>
struct A
{
static const T x = 1;
C<A<T>::x> c; // { dg-bogus "invalid" }
};
A<int> a;
|
google | chromium | anon5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/anon5.C | 166 | utf_8 | c49d0d53d89b9f43c9efd96309b57cfa | // PR c++/45651
namespace { template <int T> struct A {}; }
template <int T> struct B { void f(A<T>); };
template struct B<1>;
template<int T> void B<T>::f(A<T>) {}
|
google | chromium | using10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/using10.C | 167 | utf_8 | 943abc979a64f6701f0ff51d172a78bb | // PR c++/22136
struct B {
void foo();
};
template <typename T> class I : public B {};
template <typename T> class D : private I<T> {
I<T>::B::foo;
};
|
google | chromium | crash47 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash47.C | 95 | utf_8 | ecaf2d9019ae9b82fd94645b37dbc4c9 | // PR c++/27102
template<typename T> void T::X::foo() {} // { dg-error "invalid|not a type" }
|
google | chromium | instantiate4 | .C | native_client/pnacl-gcc/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 | chromium | arrow1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/arrow1.C | 336 | utf_8 | 70d28a064929f59e11b32dff9e4de1c5 | // PR c++/49118
// { dg-do compile }
template< int n >
struct a {
a< n+1 >
operator->()
{ return a< n+1 >(); }
};
int main() {
a<0>()->x; // { dg-error "instantiation depth exceeds maximum" }
}
// { dg-prune-output "incomplete type" }
// { dg-prune-output "declaration of" }
// { dg-prune-output "used but n... |
google | chromium | crash7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash7.C | 434 | utf_8 | 02c633425e2b805230994cdd35d274f1 | // { dg-do compile }
// PR c++/10108: ICE in tsubst_decl for error due to non-existence
// nested type.
template <typename> struct A
{
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
// We currently don't give the "no match" error because we don't add the
// invalid constructor template to TYPE... |
google | chromium | non-dependent4 | .C | native_client/pnacl-gcc/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 | chromium | inherit3 | .C | native_client/pnacl-gcc/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 | chromium | error13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error13.C | 113 | utf_8 | 23d1d88880eac44a4f6c4209f4d1c9c0 | // PR c++/15227
template<typename> struct A {};
template<typename T> void A<T>::B::foo() {} // { dg-error "" }
|
google | chromium | static16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static16.C | 533 | utf_8 | ad55298cbb7ecb4c0c032a17f174564f | // PR c++/23691
namespace std {
class type_info {
bool operator==(const type_info& __arg) const;
};
}
template <class T, T val> struct integral_constant {
static const T value = val;
};
template< typename T > struct is_integral : integral_constant<bool,false> {};
template <bool B> struct enable_if_c {};
te... |
google | chromium | enum6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/enum6.C | 136 | utf_8 | 294cb584d05edd3313c80b73e8cd5f4d | // PR c++/34774
template<int shifts>
struct shift {
enum {
n0 = (unsigned)shifts,
n = n0 ? 0 : n0,
n_comp = -n
} x;
};
|
google | chromium | typeid-template-argument | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typeid-template-argument.C | 202 | utf_8 | c8309bdff0cfda521b4e7ea53eaf9126 | // This used to ICE (PR28420)
// { dg-do compile }
template<int> struct A;
int i = sizeof(A<typeid>); // { dg-error "operator cannot appear in a constant-expression|template argument 1 is invalid" }
|
google | chromium | string1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/string1.C | 70 | utf_8 | e7593ecf5b119a379bc82dc107ccab12 | // PR c++/28337
template <int> void foo()
{
(0 ? "" : "X") + 1;
}
|
google | chromium | ntp2 | .C | native_client/pnacl-gcc/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 | chromium | qualttp16 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp16.C | 599 | utf_8 | d5117f3f1bc5abfa2a210383b5c90542 | // { dg-do run }
extern "C" void abort();
struct A
{
template <class T> class B {};
};
template <template <class> class TT, class T> struct X
{
TT<int> y;
T z;
int f() { return 0; }
};
template <class T> struct X<T::template B, T>
{
typename T::template B<int> y;
T z;
int f() { return 1; }
};
template <class T> ... |
google | chromium | spec2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec2.C | 371 | utf_8 | 1133f61b139dcbae6d0d62799d821c00 | // { dg-do compile }
// Bug: Overloading of ordinary and template member function
// which enclosing class is specialized is not handled correctly.
template <class T>
struct A
{
void f(T) {}
};
template<>
struct A<int>
{
void f(int) {}
template <class T> void f(T) {}
};
template
void A<int>::f(int); |
google | chromium | conv9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/conv9.C | 163 | utf_8 | 8de20cec2491fd7ca8d7d9e44e45478a | // PR c++/28557
struct A
{
template<typename T> operator T() { return T(); }
};
template<int> void foo()
{
A().operator int();
}
void bar()
{
foo<0>();
}
|
google | chromium | access7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/access7.C | 306 | utf_8 | dbb453c143e3d8dd37fca41715b6a4f5 | // { dg-do compile }
// PR c++/3663
// Enforce access of nested type.
template <typename A>
class S {
class T {}; // { dg-error "private" }
};
template <typename A>
typename A::T* f (A) { // { dg-error "this context" }
return 0;
}
void g () {
f (S<int> ()); // { dg-message "required" }
}
|
google | chromium | ttp7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp7.C | 602 | utf_8 | 8ef73a0d2fb7b35129f101b657888692 | // { dg-do compile }
// Contributed by Andrew Pinski <pinskia at gcc dot gnu dot org>
// PR c++/13810: ICE while parsing invalid default argument for a
// template template parameter.
struct X;
template<int> struct A {};
template<template<int> class = X > struct B1 {}; // { dg-error "as a default value" }
t... |
google | chromium | redecl3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/redecl3.C | 221 | utf_8 | 49436cd5609a16d69d797b84c7f00598 | // PR c++/19980
// { dg-do compile }
int foo; // { dg-error "previous declaration" }
template<int> void foo() {} // { dg-error "redeclared" } |
google | chromium | typedef13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/typedef13.C | 333 | utf_8 | 4cc56d549324ccc8454d729e8ff28a06 | // Origin: PR c++/26693
// { dg-do compile }
class A
{
typedef int mytype; // { dg-error "typedef int A::mytype' is private" }
};
template <class T> class B : public A
{
mytype mem; // { dg-error "within this context" }
};
B<int> b; // { dg-message "required from here" } |
google | chromium | overload11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/overload11.C | 450 | utf_8 | 36f046a8855c4966a1c3643a3557e887 | // PR c++/39413
// We don't need to instantiate Wrapper<int> to check the
// foo(const Thingy&) overload.
template <class T> struct Incomplete;
template <typename T> class Wrapper
{
Incomplete<T> i;
};
template <typename T> struct Thingy
{
Thingy();
Thingy(const Wrapper<T>& v);
template <typename X> void fo... |
google | chromium | static18 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static18.C | 255 | utf_8 | edf490d7a540447062e06ed56692070f | // PR c++/23914
template <class T>
struct foo_template {
static const unsigned complexity = 0;
};
template <int x> struct STATIC_ASSERTION {};
void gcc_402_problem_minimal()
{
sizeof(STATIC_ASSERTION< foo_template<int>::complexity >);
}
|
google | chromium | error2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error2.C | 655 | utf_8 | f556ed7a64b4803b65cf453e32939515 | // { dg-do compile }
// required from did not indicate the nested class
template<class T> struct X
{
T m; // { dg-error "as type 'void'" "void" }
// { dg-error "incomplete type" "incomplate" { target *-*-* } 10 }
// { dg-error "invalid" "invalid" { target *-*-* } 10 }
};
template<class T >
struct Derived
{
class ... |
google | chromium | sfinae7 | .C | native_client/pnacl-gcc/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 | chromium | friend34 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend34.C | 290 | utf_8 | 861190a2944f470305adf84080e394bd | // { dg-do compile }
// PR c++/9783: Forward declaration of class in template.
template <typename T>
struct C {
void foo (struct X *);
};
struct X {};
template <typename T>
void C<T>::foo(struct X *) {} |
google | chromium | access17 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/access17.C | 274 | utf_8 | 092b63314ea4c83dfe2ff66c762901cd | // PR c++/27339
class A
{
private:
enum private_enum {a};
template<A::private_enum v> // OK
struct B
{
void bm();
};
public:
void am()
{
B<a> instance; //OK
instance.bm();
}
};
template<A::private_enum v> // FAIL
void
A::B<v>::bm(){}
|
google | chromium | ttp21 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp21.C | 130 | utf_8 | 54aa5e13e0b421f81c0decbd0545680e | // PR c++/28853
// { dg-do compile }
template<template<int> class A>
int A<0>::i; // { dg-error "template template parameter" }
|
google | chromium | crash20 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash20.C | 322 | utf_8 | 7d60f1e42e3a0cb9fb843525c06fc428 | // { dg-do compile }
// ICE with incompletable type.
class INC;
template <typename T> class B {};
template<typename T> void Foo (B<T> &);
void Foo (INC &);
void Baz (INC *p)
{
Foo (*p);
} |
google | chromium | memfriend14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memfriend14.C | 1,005 | utf_8 | cd21edd34d2428c1c7c7904f894a44f7 | // { dg-do compile }
// Nested class template of class template as friend
template<class T> struct A
{
template <T t> struct B
{
void f();
};
};
template <class U> class C {
int i;
template<class T> template <T t> friend struct A<T>::B;
};
template<class T> struct A<T*>
{
template <T* t> struct B
{
... |
google | chromium | nontype19 | .C | native_client/pnacl-gcc/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 | chromium | crash6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash6.C | 199 | utf_8 | 503d2ceca1151ace69073bc94b2e3181 | template <class> struct A { static const int n = 1; } ;
template <int> struct B;
template <class S>
struct restype_order {
static const int s = A<S>::n;
typedef typename B<(s > 0)>::t t;
};
|
google | chromium | explicit-args1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/explicit-args1.C | 483 | utf_8 | e55630cc11be91571d5b580292e51090 | // PR c++/34950
template <class T = int> struct policy {
typedef int unnecessary;
};
template <class Policy> struct A {
typedef int type;
typedef typename Policy::unnecessary unused;
};
template <class T> struct S {
typedef int type;
typedef typename A<T>::type unused;
};
template <class, class ... |
google | chromium | class1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/class1.C | 127 | utf_8 | 706f2857327f695c7b984df9d14be0b0 | extern const int a;
template <const int&> class X {};
template <typename> struct Y {
X<a> x;
};
template struct Y<int>;
|
google | chromium | sfinae25 | .C | native_client/pnacl-gcc/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 | chromium | partial-specialization | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/partial-specialization.C | 295 | utf_8 | e187a317d102d915368fe357726202ba | // { dg-do compile }
struct B
{
int i;
};
template <class _T, class _M, _M _T::* _V>
struct A;
template <class _T, int _T::* _V>
struct A<_T, int, _V>
{
};
int main()
{
A<B, int, & B::i> a;
} |
google | chromium | explicit8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/explicit8.C | 233 | utf_8 | ad629aa6efcf1374753dbd987791a144 | namespace N {
template <typename T>
struct S {
void f() {}
};
namespace I {
template void S<double>::f(); // { dg-error "namespace" }
}
}
namespace K {
template void N::S<int>::f(); // { dg-error "namespace" }
}
|
google | chromium | unify9 | .C | native_client/pnacl-gcc/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 | chromium | friend12 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend12.C | 470 | utf_8 | b0a401cf45ed38cceaf9b0b254083c87 | // { dg-do compile }
// PR 9030. Perform access checking to parameter and return type of
// function template correctly when the template is friend.
template <class T> class Outer {
private:
struct Inner {};
template <class T_>
friend typename Outer<T_>::Inner foo ();
};
template <class T>
typename Oute... |
google | chromium | lvalue1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/lvalue1.C | 621 | utf_8 | c0214387b51fcbd1778447a0a4a88720 | // PR c++/38877
template<class _T1, class _T2>
struct pair
{
typedef _T1 first_type;
typedef _T2 second_type;
_T1 first;
_T2 second;
pair () : first(), second() { }
pair(const _T1& __a, const _T2& __b)
: first(__a), second(__b) { }
};
template<class _T1, class _T2>
inline pair<_T1, _T2>
make_pair(_T1 ... |
google | chromium | error4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error4.C | 245 | utf_8 | 767c10eb63bc3c8f259a1f247aad4fe4 | template<class T> struct C1
{
template<class U> struct C2
{ class Type { }; };
};
template<class T, class U>
void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" "error " }
// { dg-message "note" "note" { target *-*-* } 8 }
|
google | chromium | inherit | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/inherit.C | 187 | utf_8 | c20e3e284b8812faf677fcf9f596d821 | // { dg-do compile }
template<typename T>
struct X { void f() { } };
struct Z : X<int> { };
int main()
{
Z z;
z.X::f();
} |
google | chromium | canon-type-5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/canon-type-5.C | 338 | utf_8 | 85fdca2492646ea03edf6e35b0a582d0 | // 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<X Foo::*> a ;
} ;
template<class Y>
struct E
{
B<Y Foo::*> b ;
} ;
E < int > e ; |
google | chromium | spec25 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec25.C | 168 | utf_8 | 5858bf93d5d479c31bf4e3cc414cd2ff | namespace N {
template <typename T>
struct S {
void f() {}
};
}
namespace K {
template <> void N::S<char>::f() {} // { dg-error "namespace|definition" }
}
|
google | chromium | friend51 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend51.C | 178 | utf_8 | 95883d7d1e93cebf1fbefb7361ffe660 | // PR c++/38392
// { dg-do link }
void Function();
int main()
{
Function();
}
template <typename T>
struct Test
{
friend void Function() { }
};
template class Test<int>;
|
google | chromium | crash8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash8.C | 286 | utf_8 | 899e82cfa1eab0c5e96b47962c693262 | // { dg-do compile }
// PR c++/11513: ICE due to incorrect decision whether the tag is template.
template <typename T>
struct bar
{
struct foo
{
int a;
};
template <typename U>
int wom(U c)
{
struct foo b;
}
}; |
google | chromium | ttp13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ttp13.C | 376 | utf_8 | dcb32e2136f330749a2276bb4d351b2b | // { dg-do compile }
// PR c++/15664: Template substitution of template template parameter
template <int N> struct S {
template<template<typename> class A>
friend void foo();
};
template<template<typename> class A>
void foo();
template <typename> struct X {};
int main () {
S<1> s;
foo<X>();
... |
google | chromium | qualttp15 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp15.C | 500 | utf_8 | 9a2e0c2053d3ed911390c7839f875856 | // { dg-do compile }
struct A
{
template <class T> class B {};
};
template <template <class> class TT> struct X
{
TT<int> y;
};
template <class T> struct X<T::template B> // { dg-error "previous" }
{
T z;
};
template <class T> struct X<T::template B> // { dg-error "redefinition" }
{
T z;
};
template <class T> stru... |
google | chromium | repo1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/repo1.C | 299 | utf_8 | 0a632cddef1c669686cf95071e3afa4f | // { dg-options "-frepo" }
// { dg-require-host-local "" }
// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
struct A {
A();
};
A::A() {}
template <typename T>
struct B : public A {
B() {} // { dg-bogus "" }
};
B<int> b;
int main () {}
// { dg-final { cleanup-repo-files } }
|
google | chromium | class2 | .C | native_client/pnacl-gcc/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 | chromium | sfinae28 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sfinae28.C | 364 | utf_8 | 071c3f65cf279133e0877210d8149c4e | // Origin: PR c++/44267
struct B {};
struct D : B {};
struct VD : virtual B {};
template <class T> T create();
typedef char one[1];
typedef char two[2];
template <class D, class B>
one& f(char (*)[sizeof(static_cast<D>(create<B>()))]);
template <class D, class B>
two& f(...);
int main()
{
f<D*, int>(0);
f<D... |
google | chromium | crash94 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash94.C | 390 | utf_8 | ea031f0eed2506b6add80fa9a5f38b85 | // Origin: PR c++/42697
// { dg-do compile }
template<class Value_t>
class fparser
{
template<bool Option>
void eval2(Value_t r[2]);
public:
void evaltest();
};
template<>
template<bool Option>
void fparser<int>::eval2(int r[2])
{
struct ObjType {};
}
template<class Value_t>
void fparser<Value_t>::e... |
google | chromium | void14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/void14.C | 208 | utf_8 | 25f480eeead08db92a5bce8ac9a6c4ed | // PR c++/36411
// { dg-do compile }
template<template<void> class> struct A // { dg-error "not a valid type" }
{
template<template<int> class T> A<T> foo(); // { dg-error "mismatch|expected|invalid" }
};
|
google | chromium | duplicate1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/duplicate1.C | 126 | utf_8 | 8f66b4b808e15a65e9eb6c04d2d02e4e | //PR c++/19439
template<int> struct A
{
~A() {} // { dg-error "with" }
~A() {} // { dg-error "cannot be overloaded" }
};
|
google | chromium | error34 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/error34.C | 725 | utf_8 | 411a4732230a0fbd8972e03886c8d341 | // PR c++/33842
// { dg-do compile }
template<typename T> struct A
{
A<__builtin_offsetof(T, x)>(); // { dg-error "type/value mismatch|offsetof\\(T, x\\)" }
};
template<typename T> struct B
{
B<__builtin_offsetof(T, x.y)>(); // { dg-error "type/value mismatch|offsetof\\(T, x.y\\)" }
};
template<typename T> struc... |
google | chromium | spec16 | .C | native_client/pnacl-gcc/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 | chromium | canon-type-9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/canon-type-9.C | 265 | utf_8 | 8a82241501cba3382078c86a5e86e880 | // { dg-options "-std=c++0x" }
// { dg-do compile }
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 | chromium | spec7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec7.C | 367 | utf_8 | c815e2045db2912ff4ac5e6626f81264 | // { dg-do compile }
// PR c++/6440: Specialization of member class template.
template<class T> struct A
{
template<class U> struct B {};
};
template<> template<class U>
struct A<int>::B
{
void f();
template <class V> void g(V);
};
template<> template<> template <class V> void A<int>::B<char>::g(V)
{
}
A<in... |
google | chromium | void2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/void2.C | 143 | utf_8 | 28483e5e5ebefbb2745d92348d976139 | // PR c++/27496
// { dg-do compile }
template<int> struct A
{
template<void> friend class X; // { dg-error "void|valid type" }
};
A<0> a;
|
google | chromium | warn1 | .C | native_client/pnacl-gcc/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 | chromium | access11 | .C | native_client/pnacl-gcc/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 | chromium | friend14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend14.C | 414 | utf_8 | 2c569073aac74ea8a9886428ec873202 | // { dg-do compile }
// Perform access checking to parameter and return type of
// function template correctly when the template is friend.
template <class T> class O {
struct I { I (int); };
template <class T_>
friend typename O<T_>::I f ();
};
template <class T_>
typename O<T_>::I f () { return 1; }
struct X {... |
google | chromium | array14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/array14.C | 133 | utf_8 | 00d9cd9feffed8cd62a0330e5742bbb9 | // PR c++/23993
const int data[2][4] = {
{ 0, 1, 2, 3 }
};
template <typename T>
void t(int k) {
int candidate = data[1][k];
}
|
google | chromium | sizeof6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sizeof6.C | 324 | utf_8 | 8d7b68da161169ea74382da5f4a8c8fb | // { dg-do compile }
// Contributed by Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// PR c++/13683: bogus warning about passing non-PODs through ellipsis
struct B {};
struct NonPOD : B {};
struct A
{
static int check(...);
static NonPOD GetNonPOD(void);
enum { value = sizeof(A::check(A::GetNonPOD())) };... |
google | chromium | inline1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/inline1.C | 484 | utf_8 | e11043be34a3a4669d6240f263aa30d2 | // { dg-do compile }
// { dg-options "-fno-default-inline -O0" }
// { dg-final { scan-assembler-not "\n_?_ZN1X3FooIiEEvT_\[: \t\n\]" } }
// PR 10047. bogus warning.
struct X
{
template <typename T> static void Foo (T) {}
};
extern template void X::Foo<int> (int); // extern, so don't emit it
int main () {
X::Foo (... |
google | chromium | crash101 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash101.C | 173 | utf_8 | 565c1bfc2d04d65f64253e16e35798d9 | // PR c++/44039
struct locale { };
template<class charT>
void
foo()
{ locale::locale(); } // { dg-error "cannot call|function-style" }
void
bar()
{ foo<char>(); }
|
google | chromium | crash31 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash31.C | 68 | utf_8 | e3731e3425655eda73d8d1ac61cdadb3 | // PR c++/19063
template<operator< struct A {}; // { dg-error "" }
|
google | chromium | inherit6 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/inherit6.C | 253 | utf_8 | f324fc75e2ce740742e957e7c3d64819 | // Origin PR c++/47172
// { dg-options "-std=c++0x" }
// { dg-do compile }
struct A
{
int f() const;
};
template <class T>
struct B : A { };
template <class T>
struct C : B<T>
{
void g();
};
template <class T>
void C<T>::g()
{
A::f();
}
|
google | chromium | lookup7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/lookup7.C | 115 | utf_8 | 863f99213222c2c03bf6c2f03bfc91c6 | class S;
template<class T>
int f(T, S);
class S {
template<class T>
friend int f(T t, S) { t; return 0; }
};
|
google | chromium | stdarg1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/stdarg1.C | 880 | utf_8 | 5534aa0a36a8f30052a72e8b1e4c5748 | // PR c++/47022
// { dg-do compile }
// Suppress a warning that is irrelevant to the purpose of this test.
// { dg-options "-Wno-abi" { target arm_eabi } }
#include <cstdarg>
template <typename T>
void
f1 (T *p, va_list ap)
{
*p = va_arg (ap, long double);
*p += va_arg (ap, double);
}
template <typename T>
void
... |
google | chromium | offsetof2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/offsetof2.C | 174 | utf_8 | 4c88b26d0d4ab5c6ea7cbb37f1f8bbf4 | // PR c++/49085
template <class T>
struct A // { dg-error "declaration" }
{
int i, j;
int ar[__builtin_offsetof(A,j)]; // { dg-error "incomplete type" }
};
A<int> a;
|
google | chromium | array19 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/array19.C | 364 | utf_8 | d6ed514093a999f1e4b15b3133a67692 | // PR c++/33553
// { dg-do compile }
template <class T> struct S { static const int sz = 2; };
template <class T> struct U { enum { sz = 2 }; };
template <class R>
struct P
{
template <class T> void bar (int (&x)[S<T>::sz]);
template <class T> void baz (int (&x)[U<T>::sz]);
};
P<int> p;
void
foo (void)
{
int ... |
google | chromium | memclass3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/memclass3.C | 740 | utf_8 | 0d33a29a97363269ef67e175452d1251 | // PR c++/17132
template <typename T>
struct has_deref
{
struct impl
{
template <
typename Type,
typename Type::reference (Type::*Func)(void) const>
struct func_tag;
template <typename Type>
static char (& test(
Type *,
func_tag<T... |
google | chromium | lookup8 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/lookup8.C | 267 | utf_8 | 97437823fade3b3d3a9381c8da0c575b | // PR c++/38030
// The call to f should be resolved at template definition time.
// { dg-do link }
struct B { };
struct D : public B { };
D d;
void f (B &) { }
template < class T >
void g ()
{
return f (d);
}
void f (D &);
int main ()
{
g<int> ();
return 0;
}
|
google | chromium | conv1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/conv1.C | 618 | utf_8 | 32f254d8ff7fc2dadfbb4100169c8710 | // { dg-do compile }
// PR 4361. Template conversion operators were not overloaded.
template <class T> struct Second;
template<class T> struct First
{
int Foo ();
template <class U> operator Second<U>();
template <class U> operator First<U>();
};
template <class T> int First<T>::Foo ()
{} // This is here to ma... |
google | chromium | crash83 | .C | native_client/pnacl-gcc/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 | chromium | nested4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/nested4.C | 196 | utf_8 | b12c9a151e46871b430564ee47c57714 | template <typename T> struct A {
template<typename S> struct B { typedef A<S> X; };
};
template<typename> void f() {
typedef A<int>::B<double>::X X;
}
template void f<int> ();
|
google | chromium | void5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/void5.C | 102 | utf_8 | 29bdbfbe89710bff6d9ae0b64b0d06f5 | //PR c++/28640
template<void> struct A; // { dg-error "not a valid type" }
template<int> struct A;
|
google | chromium | static14 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static14.C | 176 | utf_8 | ff5a3d46b4c279a829a0b1e0eb4acdac | struct Base {
int x;
};
template <typename T>
struct A {
static const int N = sizeof(static_cast<Base*>(T()));
int a[N];
};
struct Derived : Base {
A<Derived*> a;
};
|
google | chromium | scope4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/scope4.C | 282 | utf_8 | b3e926a09671bb6d64fb4f63dde975e0 | // PR c++/46058
class StringLiterals {
public:
static const char dec[];
};
template<class St, class Base, const char* name>
class NoValueCommand : public Base {
public:
};
template<class St, class Base>
class DecBasic : public NoValueCommand<St,Base,StringLiterals::dec> {
};
|
google | chromium | spec30 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec30.C | 176 | utf_8 | bcc1e7cd1681ae2c1d9e35cde8abbbc4 | // { dg-do compile }
template<int N>
inline int
foo (int a)
{
return a;
}
template<>
inline int
foo<0> (int a = 123) // { dg-error "default argument" }
{
return a + 1;
}
|
google | chromium | explicit5 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/explicit5.C | 475 | utf_8 | bfbe469c91f678acc5c06f6a7a92f9c6 | // { dg-do compile }
// Failed to spot specialization using a template-id expr
template <typename n> class A {};
template <int m> class R {};
template <typename n, typename x> struct Trait { enum {m = sizeof (n)}; };
template <typename n, typename x> R<Trait<n,x>::m> f(A<x>);
template <> R<Trait<char,char>::m> f<char>(... |
google | chromium | sfinae27 | .C | native_client/pnacl-gcc/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 | chromium | crash98 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/crash98.C | 264 | utf_8 | 5ad1ce99ce4c69cb466cfec347f04480 | // PR c++/43630
template < typename > struct A; // { dg-error "declaration" }
template < typename > struct A < int > // { dg-error "not used|template\\-parameter" }
{
int i;
int f ();
};
int A < int >::f () // { dg-error "incomplete type" }
{
return i;
}
|
google | chromium | friend30 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/friend30.C | 239 | utf_8 | 1d0be2d7ae4ecc088986fba42e7ee292 | // PR c++/14930
template<typename T> class Point;
template<> class Point<double> {
friend class Plane;
double v;
};
struct Plane {
double get(const Point<double>& p);
};
double Plane::get(const Point<double> &p) { return p.v; }
|
google | chromium | sizeof9 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sizeof9.C | 171 | utf_8 | 12df473d69cf94653ec8c2821cfe853f | // PR c++/21025
template<int N> struct X { char x[N]; };
template<typename T> X<1 + sizeof(T) - sizeof(T)> F(T const &);
template<int N> struct S { int d() { F(1); } };
|
google | chromium | crash52 | .C | native_client/pnacl-gcc/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 | chromium | static10 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/static10.C | 580 | utf_8 | 76f7269587f9a5cc5dc6a0a3aa3b2d61 | // PR c++/19555
namespace __gnu_debug_def { }
namespace std
{
using namespace __gnu_debug_def;
template<typename _Tp> class allocator {}; // { dg-message "std::allocator" }
}
namespace __gnu_debug_def
{
template<typename _Tp,
typename _Allocator = std::allocator<_Tp> >
class vector
{
void
... |
google | chromium | koenig7 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/koenig7.C | 344 | utf_8 | 2e7cb1dcf45bb8b5519d06247d085cc7 | // PR c++/13549
// We need to do arg-dep lookup for g<T>(j) at instantiation time because
// g<T> is dependent, even though (j) is not; at that point we can find
// g(h).
template <typename T> int g(int);
class h{};
template <typename T> int l(){h j; return g<T>(j);}
template <typename T> int g(const h&);
class j{};
i... |
google | chromium | spec1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/spec1.C | 338 | utf_8 | 2c4280f67b1e22c2fbb0f60584f52297 | // { dg-do compile }
// Bug: ICE during invalid instantiation of member function
// which enclosing class is specialized.
template <class T>
struct A
{
void f(T) {}
};
template<>
struct A<int>
{
void f(int) {}
};
template
void A<int>::f(int); // { dg-error "not match" } |
google | chromium | new2 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/new2.C | 198 | utf_8 | b8243d46589815a568bb0992cb04adec | // PR c++/21336
typedef __SIZE_TYPE__ size_t;
template<class _T> void* operator new( size_t Size, _T&);
struct B {
int a;
int* m() {
return new(a) int;
}
};
B* n() {
return new B();
}
|
google | chromium | conv11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/conv11.C | 252 | utf_8 | 142422aea9a677fb32502402e895a96d | int i;
struct A
{
template <class T> operator T&() { return i; } // { dg-message "note" }
};
int main()
{
A().operator int(); // { dg-error "operator int" }
// { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 9 }
}
|
google | chromium | sfinae13 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/sfinae13.C | 3,343 | utf_8 | fd186f6ad5502f92e5c2137c6fc41c9a | // DR 339
//
// Test of the use of casts 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> struct enable_if<f... |
google | chromium | deduce1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/deduce1.C | 413 | utf_8 | a1ee69de58a5087bc0a5772d3b7f8309 | // { dg-do run }
template <typename T> int Foo (T const *)
{
return 1;
}
template <typename T> int Foo (T const &)
{
return 2;
}
template <typename T, __SIZE_TYPE__ I> int Foo (T const (&ref)[I])
{
return 0;
}
int main ()
{
static int array[4] = {};
return Foo (array);
} |
google | chromium | non-dependent11 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/non-dependent11.C | 453 | utf_8 | 6f26c028ea69c4705c77b4a0544f848d | // { dg-do compile }
template<int> struct I {
int o ();
int o () const;
};
template <int> void bar (void) {
foo <int, I<1> > (&I<1>::o);
} |
google | chromium | new4 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/new4.C | 164 | utf_8 | ee60767832489389f13d0474ac598f82 | // PR c++/27559
// { dg-do compile }
struct A
{
template<typename T>
static void* operator new(T) {} // { dg-error "first parameter|invalid template" }
};
|
google | chromium | qualttp1 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/qualttp1.C | 324 | utf_8 | b21ab1ce79ce2d2e11762d15de7d8e95 | // { dg-do compile }
struct A
{
template <class T> class B {};
};
template <class T> struct X
{
};
template <class T> struct C
{
X<T::template B> x; // { dg-error "type" }
};
int main()
{
C<A> c;
} |
google | chromium | ptrmem3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/ptrmem3.C | 340 | utf_8 | 171d82f45a76129388539c01e3212ec9 | template <typename T,double (T::*fun)() const>
struct I {
};
struct R {
R() { }
};
class H: public R {
public:
H(): R() { }
double& f() { return a; }
double f() const { return 1.0; }
double a;
};
struct A {
typedef I<H,&H::f> F;
A() { }
}; |
google | chromium | dependent-name3 | .C | native_client/pnacl-gcc/gcc/testsuite/g++.dg/template/dependent-name3.C | 333 | utf_8 | 0c3e325271a377838c5d47bb6fb94dd1 | // { dg-do compile }
// Dependent arrays of invalid size generate appropriate error messages
template<int I> struct A
{
static const int zero = 0;
static const int minus_one = -1;
};
template<int N> struct B
{
int x[A<N>::zero]; // { dg-error "zero" }
int y[A<N>::minus_one]; // { dg-error "negative" }... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.