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 | crash64 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash64.C | 81 | utf_8 | 7045ba233c32f06a7ff182a156a50844 | // PR c++/29730
struct A
{
template<int> void foo()(0); // { dg-error "" }
};
|
google | android | crash100 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash100.C | 348 | utf_8 | 71cd4d9bd2cbdcf3dca414dbf7f1b2af | // PR c++/44628
template <typename T>
class Temp
{
int Val;
public:
operator T&(void) { return Val; }
virtual T& operator=(T a ) // { dg-error "overriding" }
{
Val = a;
return Val;
}
};
class Int : public Temp<int>
{
public:
Int& operator=(int a) // { dg-error "conflicting return type" }
{... |
google | android | qualttp21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp21.C | 290 | utf_8 | d7668570c380f7a54655435e409395c9 | // { dg-do compile }
template <class A>
class foo {
int _foo;
public:
foo() {}
protected:
~foo() {} // { dg-error "~foo" }
};
int main()
{
foo<int> a; // { dg-error "context" }
} |
google | android | sfinae20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae20.C | 1,072 | utf_8 | 1856ba318a64ebfdfa82b638176837e3 | // PR c++/44907
// { dg-do compile { target c++11 } }
#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;
templ... |
google | android | error5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error5.C | 161 | utf_8 | 668f5fe72c385e6518a4a328986f3ff5 | template <typename T>
struct X<T*> { // { dg-error "not a class template" }
typedef int Y;
};
extern struct Z<int> s; // { dg-error "not a class template" }
|
google | android | qualttp16 | .C | toolchain/gcc/gcc-4.9/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 | android | friend54 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend54.C | 189 | utf_8 | ff62b02fcc089bbd3638aefea48a4e40 | // PR c++/56642
template <class T> struct A;
template <class T>
A<T> f(T*) { return A<T>(); }
template <class T>
struct A
{
friend A f<T>(T*);
};
int main()
{
int *p = 0;
f(p);
}
|
google | android | crash28 | .C | toolchain/gcc/gcc-4.9/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 | android | error14 | .C | toolchain/gcc/gcc-4.9/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 | android | crash1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash1.C | 335 | utf_8 | ff8577ac97f88f47b1257f3d5c6a4c9a | // { dg-do compile }
// PR 5125. ICE
class S
{
public:
template <class I> void Foo(int (*f)(S& o) );
};
template <class I>
void S::Foo(int (*f)(TYPO&o) ) // { dg-error "Foo|f|TYPO|o" }
{
} |
google | android | explicit8 | .C | toolchain/gcc/gcc-4.9/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 | android | ttp2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp2.C | 354 | utf_8 | 55545b6f734664ea7227a639a1393d4f | // { dg-do compile }
template <class U> struct Alloc {};
template <class T, class U = Alloc<T> > struct Vector {};
template <template <class T, class U = Alloc<T> > class TT>
struct C {
TT<int> tt;
};
int main()
{
C<Vector> c;
} |
google | android | pr4926-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pr4926-1.C | 350 | utf_8 | 698fef868c92929bbef3fe847bfc6295 | // PR c++/4926
// { dg-do compile }
template <unsigned> struct X { typedef int Type; };
template <typename T> struct Y { char array[1]; };
template<typename T> Y<T> P(T); // acts as "Y<typeof(T)>"
struct F { int operator()() const; };
template <typename T>
typename X<sizeof(P( T()() ).array)>::Type foo();
... |
google | android | function1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/function1.C | 865 | utf_8 | a5ecff5cba84cd71c83879e1437f0497 | // PR c++/38647
// { dg-do compile }
// { dg-prune-output "note" }
template<const char *, int> struct A {};
const char func[] = "abc";
template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" }
char a1[1];
A<a1, 0> a;
template<const char *, int> struct B {};
temp... |
google | android | canon-type-5 | .C | toolchain/gcc/gcc-4.9/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 | android | access24 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access24.C | 187 | utf_8 | e369c82013a70a752273af1adface28c | // PR c++/54437
template <void (*P)()> void f();
class A {
template <class T> static void g();
template <class T> static void h () { f<g<T> >(); }
static void i() { h<int>(); }
};
|
google | android | redecl4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/redecl4.C | 144 | utf_8 | cd21403ce71916cfa4b5c75f6da549d9 | // PR c++/28710
// { dg-do compile }
template<int> union A; // { dg-error "previous" }
struct A; // { dg-error "non-template" }
|
google | android | pseudodtor5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/pseudodtor5.C | 240 | utf_8 | bb39ba4948ed54bad8f9e9fc8e3fbb26 | // PR c++/37563
struct A {};
template<int> struct Traits
{
typedef void X;
};
template<> struct Traits<0>
{
typedef A X;
};
template<int N> struct B
{
typedef typename Traits<N>::X Y;
void foo(Y y)
{
y.Y::A::~A();
}
};
|
google | android | cast3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/cast3.C | 293 | utf_8 | f715bb7e6f7666f67d1ebfc95f66935e | // PR c++/56438
struct A { };
A& operator<<(A&, const char*);
struct B {
int size();
};
struct C { };
template <class S, class T>
S bar(const S& s, const T& t) {
return s;
}
template<class S, class T>
void foo() {
A a;
B b;
a << bar(b.size(), C()); // { dg-error "no match" }
}
|
google | android | friend16 | .C | toolchain/gcc/gcc-4.9/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 | android | member9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/member9.C | 327 | utf_8 | 807c0634d8537b12659c5c1e5946086a | // Origin PR c++/48838
// { dg-do compile }
class DUChainItemSystem
{
public:
template<class T>
void registerTypeClass();
static DUChainItemSystem& self();
};
template<class T>
struct DUChainItemRegistrator
{
DUChainItemRegistrator()
{
DUChainItemSystem::self().registerTypeClass<T>();
... |
google | android | nontype18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype18.C | 179 | utf_8 | 2e2e9f4aee22cc3045d21afc23fb88ce | // PR c++/28743
template<int I> struct A
{
template<typename T> void foo();
};
template<int I> template<typename T> void A<0>::foo() {} // { dg-error "template parameter" }
|
google | android | access12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access12.C | 265 | utf_8 | 20c6114a3d4d0119b052ef6635d54a2c | // { dg-do compile }
// PR c++/10849: Incorrect access checking on class template partial
// specialization.
class X {
private:
template <typename T> struct Y;
};
template <typename T> struct X::Y<T*> {}; |
google | android | using21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using21.C | 385 | utf_8 | 8f24a6602645350feb421484b6b3ea57 | // PR c++/52126
// { dg-do compile }
template<typename T>
struct A
{
int foo;
struct B;
struct C;
struct D;
struct E;
};
template <class T>
struct A<T>::B : A<T>
{
using A::foo;
};
template <class T>
struct A<T>::C : A
{
using A::foo;
};
template <class T>
struct A<T>::D : A<T>
{
using A<T>::foo;
}... |
google | android | shadow1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/shadow1.C | 123 | utf_8 | 29035539c4fa91a4347b7a40e31e2701 | // PR c++/58632
template<template<int I> class A> // { dg-message "shadows" }
class A {}; // { dg-error "declaration" }
|
google | android | crash84 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash84.C | 372 | utf_8 | 549c3852175cb8583d8001c2823bd41c | // Origin PR c++/35405
// { dg-do compile }
template<typename T> struct a
{
template <template <typename> class C, typename X, C<X>* =0>
struct b
{
};
};
void
foo ()
{
a<int> a1; // OK
a<int>::b<a,int> b1; // { dg-error "template argument" }
}
// { dg-prune-output "invalid type in declaration" } |
google | android | crash70 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash70.C | 193 | utf_8 | e7c65b521cffd29e1a3625614a4329be | // PR c++/32113
template<int> struct A;
template<typename T> void foo (A<&T::template i>); // { dg-error "not a template" }
template void foo<A<0> > (A<0>); // { dg-error "does not match" }
|
google | android | nontype1 | .C | toolchain/gcc/gcc-4.9/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 | android | instantiate6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate6.C | 311 | utf_8 | 1b065aa49cdac44198ed227ed0da9cb5 | // { dg-do compile }
// PR c++/13289: ICE recursively instantiate static member data.
template <int N> struct S {
static const int C;
};
template <int N>
const int S<N>::C = S<(N+1)%2>::C;
template struct S<1>; |
google | android | shift1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/shift1.C | 223 | utf_8 | 429c749d4a969d6e6782e2108d66cc72 | // PR c++/18140
// { dg-options "-std=gnu++98" }
template <int N> struct IntHolder {
static const int value = N;
};
template <int N, int S> struct ShrIntHolder {
static const int value = IntHolder< N>>S >::value;
};
|
google | android | func2 | .C | toolchain/gcc/gcc-4.9/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 | android | crash74 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash74.C | 197 | utf_8 | 1363ef4acbdebfd7f9100d267a7e11ab | // PR c++/34089
// { dg-do compile }
// { dg-options "" }
template<typename F> void foo () { } // { dg-prune-output "previous" }
template<typename F> struct foo<F> { }; // { dg-error "template" }
|
google | android | instantiate7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate7.C | 254 | utf_8 | 45a941d2c18f981ce0d37d4ebeae6190 | // PR c++/19498
// { dg-do compile }
template<typename T> struct A
{
template<T&> struct B; // { dg-error "reference to void" }
};
A<void> a; // { dg-message "required" } |
google | android | for1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/for1.C | 250 | utf_8 | 27ffc9918dee82089419624de1850354 | // PR c++/47388
// { dg-do compile }
// { dg-options "-fno-for-scope" }
template <int>
void
foo ()
{
int i;
for (i = 0; i < 16; i++)
;
for (int j = 0; j < 16; j++)
;
if (j != 16)
for (;;)
;
}
void
bar ()
{
foo <0> ();
}
|
google | android | partial6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/partial6.C | 594 | utf_8 | af2b317af1f920fbca6b70a32297df09 | // PR c++/41703
// The second GetAllSize template is more specialized because even though
// deduction on each parameter type succeeds, we never get a template
// argument for its X to make it match the first template.
template <typename T, int (T::*)() const>
struct TSizeEnabler
{
typedef T TClass;
};
template <... |
google | android | friend28 | .C | toolchain/gcc/gcc-4.9/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 | android | typename18 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename18.C | 223 | utf_8 | 281d5672faf3e37ce44792d24c1cc723 | // { dg-do compile }
// These typename should work as they are types.
struct A
{
typedef int a;
template <int>
struct f {};
template<int> void foo(int i)
{
typename A::a(i1);
typename A::f<0>(i2);
}
};
|
google | android | crash106 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash106.C | 279 | utf_8 | ef85880b4b1dc7af7256099bc4e93ce4 | // 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" }
// { dg-prune-output "could not convert" }
|
google | android | instantiate5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate5.C | 524 | utf_8 | 6888f3f922d084199e0af93c5fbadceb | // { dg-do compile }
// PR c++/11616: Incorrect line number in diagnostics
template <int> struct A
{
static const int i=0;
};
int baz() { return A<0>::i; }
struct B
{
static void foo (int); // { dg-message "B::foo|candidate expects" }
};
template <typename T> struct C
{
virtual void bar() const { T::foo(); } // {... |
google | android | conv12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/conv12.C | 545 | utf_8 | 6652f3b06cb1bfcdf341802d7b0a8a9a | // PR c++/51079
#if __cplusplus > 199711L
struct C1
{
template <class T>
operator T() = delete; // { dg-message "declared here" "" { target c++11 } }
operator bool() { return false; }
} c1;
int ic1 = c1; // { dg-error "deleted" "" { target c++11 } }
int ac1 = c1 + c1; // { dg-error "deleted" "" { target c++1... |
google | android | memclass4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memclass4.C | 1,076 | utf_8 | 459bb772f22194a2eec4a3d69444edf3 | // Origin: PR c++/42824
// { dg-do compile }
template<int T>
class int_ {
};
template<int T, int T2>
class Unit {
public:
Unit(const Unit<T, T2>& other) {}
};
template<int T>
class Quan {
public:
Quan(void) {}
template<int T2>
Quan(double value, Unit<T, T2> unit) {}
};
typedef Quan<0> Scalar;
templ... |
google | android | non-const1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/non-const1.C | 122 | utf_8 | 479aa3b6f01e49fc13fadea360bfa003 | // PR c++/48015
template <typename T> T f(T);
template <typename T> void g()
{
int const c = f (1);
int i = c - 0;
}
|
google | android | sfinae5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae5.C | 964 | utf_8 | d489a85672b2d956beff65b15b095039 | // DR 339
//
// Test of the use of member functions with SFINAE
typedef char yes_type;
struct no_type { char data[2]; };
template<typename T> T create_a();
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<false, T> { };
template<typename T>
typename ena... |
google | android | memfriend15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/memfriend15.C | 526 | utf_8 | 2f6bfd79513e89f2607e42561cd9acaa | // { dg-do compile }
// Nested class of class template as friend
template<class T> struct A
{
struct B1
{
};
struct B2
{
void f();
};
};
class C {
int i; // { dg-error "private" }
template<class T> friend struct A<T>::B1;
};
template<class T> void A<T>::B2::f()
{
C c;
c.i = 0; // { dg-error "con... |
google | android | nontype10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype10.C | 246 | utf_8 | e9af055ac6a0774b7565e0722c861adb | // { dg-do compile }
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
#include <cstddef>
template <int T> struct A {};
template <void* T> struct B {};
A<NULL> a; // { dg-warning "NULL" }
B<NULL> b; // { dg-error "" }
|
google | android | crash101 | .C | toolchain/gcc/gcc-4.9/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 | android | canon-type-8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/canon-type-8.C | 1,604 | utf_8 | 14a090fd842facce354c55bdb935647d | // PR c++/45984
// We were getting different canonical types for matching types because
// TYPE_ALIGN wasn't propagated to all the variants fast enough.
// { dg-options "" }
typedef __SIZE_TYPE__ size_t;
enum { chunk_size = 16 };
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
typedef float... |
google | android | virtual4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/virtual4.C | 248 | utf_8 | e8e64daa7b3951eb853a386477a44c63 | // PR c++/56243
struct A
{
virtual int String ();
};
struct F: A { };
struct G
{
F value;
};
struct D
{
template <int>
void Verify()
{
G x;
F& name = x.value;
name.String();
}
};
int main()
{
D d;
d.Verify<42>();
}
|
google | android | using29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using29.C | 356 | utf_8 | 97d5663b600fcdde53f2a0e991d27e6e | // PR c++/58047
template <int N>
struct print_arg { };
struct const_holder {
static const int CONSTANT = 42;
};
template <typename T>
struct identity {
typedef T type;
};
template <class T>
struct test_case : public identity<T> {
using typename identity<T>::type;
print_arg<type::CONSTANT> printer;
};
templ... |
google | android | cond | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/cond.C | 424 | utf_8 | 3f33c9a7b6007a62a4f60e27a3126fc3 | // PR c++/8080
// Bug: the transformation in finish_while_stmt_cond produced something
// that tsubst_expr handled badly. Fixed by not doing the transformation
// while parsing a template.
class TObject {};
struct TIter {
TObject *operator()();
};
template<class T>
void get_root_object(TIter& iobj) {
... |
google | android | inherit5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/inherit5.C | 106 | utf_8 | c617d0614fa2c65ab23502fc466e2592 | struct A
{
template<int> void foo();
};
template<int N> struct B : A
{
B() { foo<N>(); }
};
B<0> b;
|
google | android | qualttp10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualttp10.C | 292 | utf_8 | cf85da2c6ae4bcc2396f5f90e574f5cd | // { dg-do compile }
template <template <class> class TT> class C {
};
template <class T> struct D {
template <class U> class B {};
C<D<T>::template B> c;
};
D<int> d; |
google | android | typename8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename8.C | 125 | utf_8 | a991f3b843fb36ef428fd3261f7cd8d6 | // PR c++/18738
namespace foo {
typedef int my_type;
}
template<typename T>
struct A {
typename foo::my_type bar();
};
|
google | android | using19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/using19.C | 119 | utf_8 | 536e84362ae1859fc60fb98478875a43 | // PR c++/23211
// { dg-do compile }
struct A { int x; };
template <class T>
struct B: A
{
using T::x;
};
B<A> b;
|
google | android | lookup4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/lookup4.C | 154 | utf_8 | 9932d99ab28768093ab672853377af03 | // PR c++/13950
template <class T> struct Base {};
template <class T> struct Derived: public Base<T> {
typename Derived::template Base<double>* p1;
};
|
google | android | nontype21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/nontype21.C | 178 | utf_8 | 523cd29e1a9c6006086eba2e934e53d4 | // PR c++/47705
template<char const * const x> class Something { };
extern char const xyz;
class SomethingElse:public Something<xyz> { }; // { dg-error "xyz. is a variable" }
|
google | android | error-recovery3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error-recovery3.C | 126 | utf_8 | 27356488b9c5da7cda4057e6aac17f5a | // PR c++/48212
template < bool > void
foo ()
{
const bool b =; // { dg-error "" }
foo < b > (); // { dg-error "" }
}
|
google | android | typedef36 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef36.C | 352 | utf_8 | e59bfbf54a4970ef59795380e9748f1c | // Origin: PR c++/45606
// { dg-do compile }
template<class T, class U = int>
struct S0
{
typedef int const_iterator;
};
template<class T>
struct Test
{
typedef S0<T> SAlias;
typedef typename SAlias::const_iterator const_iterator;
const_iterator begin ();
};
template<class T>
typename S0<T>::const_iterator
T... |
google | android | cond8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/cond8.C | 133 | utf_8 | adb866a1e01955c650d2072de4ab9016 | // PR c++/51318
enum { e0, e1 };
template<bool B, int = B ? e0 : e1> struct A {};
template<typename T> struct B
{
A<T::X> a;
};
|
google | android | sfinae19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae19.C | 1,047 | utf_8 | defcae158cfa0bf28425c808da6cab35 | // PR c++/44907
struct A { };
struct B
: public A { };
struct C
: public A { };
struct D
: public B, public C { };
template<bool, typename T = void> struct enable_if { typedef T type; };
template<typename T> struct enable_if<false, T> { };
template<typename From, typename To>
class mini_is_convertible
{
t... |
google | android | crash87 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash87.C | 314 | utf_8 | 3bc6fcf9c80c2cc5aa0d5c1c4ec47445 | // Origin: PR c++/38357
// { dg-do compile }
class BUG
{
public:
bool name() { return true; }
};
template <bool T>
struct BUG1_5
{
};
template <bool name>
class BUG2 : BUG
{
public:
typedef BUG1_5<name> ptr; // { dg-error "could not convert template argument" }
};
int main()
{
BUG2<false> b;
return 0;
}
|
google | android | mem-partial1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/mem-partial1.C | 289 | utf_8 | 20021d29d7752d6eac42fc721092a468 | // PR c++/14032
template <typename T> struct outer {
template <typename T2, typename U>
struct inner {
static int f() { return inner<T,int>::N; };
};
template <typename U>
struct inner<T,U> {
static const int N = 1;
};
};
int i = outer<int>::inner<double,int>::f();
|
google | android | error3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error3.C | 113 | utf_8 | 0e96862a75ffea6e3b8357e5251534dd | // PR 12762
template <typename> struct A { A() {}};
typedef A<int> Ac;
Ac<double> a; // { dg-error "template" }
|
google | android | const4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/const4.C | 135 | utf_8 | 54628fbcc903705b1f2ac3e7f67e0ea7 | // PR c++/48657
template<unsigned> struct A { typedef int T; };
template<unsigned> void f()
{
const unsigned D = 4;
A<D>::T t;
}
|
google | android | scope3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/scope3.C | 170 | utf_8 | a7bf058a51ee7236a37311a73bf15c69 | // PR c++/41038
struct S
{
int size() const;
};
template<typename T>
struct Packer
{
int foo() {
return Packer::var.size();
}
const S& var;
};
|
google | android | instantiate3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/instantiate3.C | 429 | utf_8 | 203b8a2b0ab24713740a2b827d63ee6e | // { 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_; }
TYPE object_; // { dg-error "incomplete type" }
};
template class ACE_Cleanup_A... |
google | android | friend5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/friend5.C | 183 | utf_8 | c9137614e9385e52c606c2d6e976e585 | // { dg-do compile }
namespace NS { template <typename number> class C; }
template <typename T> class X {
template <typename N> friend class NS::C;
};
template class X<int>;
|
google | android | qualified-id4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/qualified-id4.C | 218 | utf_8 | 28aaef5d5b00c58669547efbbb5d1f13 | // PR c++/48593
template <typename T> struct foo
{
T data;
};
template<typename T> struct bar: public foo<T>
{
void some_func()
{
T* ptr = &(foo<T>::data);
}
};
int main()
{
bar<int>().some_func();
}
|
google | android | void5 | .C | toolchain/gcc/gcc-4.9/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 | android | error25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error25.C | 426 | utf_8 | 88e5836eca5b1d6a4995747486ad482a | // PR c++/31923
template<class T>
static void f1 ();
template<>
static void f1<void> (); // { dg-error "explicit template specialization cannot have a storage class" }
template<class T>
extern void f2 ();
template<>
extern void f2<void> (); // { dg-error "explicit template specialization cannot have a storage cla... |
google | android | access1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/access1.C | 400 | utf_8 | 1c360b630dc5835068452f918bda8fb6 | // { dg-do compile }
// It is legal to specialize a template with a different class-key.
template<typename T> class X;
template<typename T> struct X<T *>
{
int i;
};
template<> struct X<int>
{
int i;
};
void foo ()
{
X<int *> xip;
X<int> xi;
xip.i;
xi.i;
} |
google | android | static9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static9.C | 156 | utf_8 | 015388506c66b2ace5fdc5fdfb038d4a | // PR c++/17524
template<typename T> struct A
{
static const T i = 0; // { dg-error "declared void" "void" }
};
A<void> a; // { dg-message "required" }
|
google | android | error19 | .C | toolchain/gcc/gcc-4.9/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 | android | memfriend17 | .C | toolchain/gcc/gcc-4.9/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 | android | typedef31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typedef31.C | 345 | utf_8 | 7d9df5543e66a309fcf55d85d3d98ca3 | // Origin: PR c++/43558
// { dg-do compile }
class Compressible;
template <class T, class EngineTag> class Engine;
template <class T>
class Engine<T, Compressible>
{
public:
typedef T Element_t;
//Element_t read(int);
T read(int);
};
template <class T>
T Engine<T, Compressible>::read(int)
{
}
Engin... |
google | android | using13 | .C | toolchain/gcc/gcc-4.9/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 | android | crash30 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash30.C | 268 | utf_8 | 4a6fae58852a7d58b5b482d48d97d11f | // PR c++/19034
template< bool C > struct B
{
};
template<typename S> int foo();
template<typename S> int foo1();
template<typename T> struct bar : public B <(sizeof(foo<T>()) == 1)>
{
};
template<typename T> struct bar1 : public B <(sizeof(foo1<T>()) == 1)>
{
};
|
google | android | conv1 | .C | toolchain/gcc/gcc-4.9/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 | android | static2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static2.C | 153 | utf_8 | aa3092ca5ce677694305032fa51a9486 | class A;
template<int A::* P>
class B
{
public:
static int A::* const p = P; // { dg-error "" }
};
class A
{
public:
int dummy;
B<&A::dummy> d;
};
|
google | android | ttp14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ttp14.C | 292 | utf_8 | a99b4acb0aa2cbfbcb364a40252b33e0 | // { dg-do compile }
// PR c++/18276: Template substitution of template template parameter
template<template<int> class> struct A;
template<int> struct B
{
template<template<int> class> friend class A;
};
B<0> b; |
google | android | static31 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static31.C | 393 | utf_8 | 0a00544e785dd73fd42954ca54bb51e0 | // PR c++/32674
class C
{
static const int j = 3;
};
template<int> class A
{
static const int i1;
static const int i2;
static const int i3;
static const int i4;
};
template<int N> const int A<N>::i1(C::j);
template<int N> const int A<N>::i2 = C::j;
template<int N> const int A<N>::i3(C::j, 5); // { dg-error... |
google | android | vla2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/vla2.C | 190 | utf_8 | 90a46ed40bed54c5195c9fe7b289492d | // PR c++/28879
// { dg-do compile }
// { dg-options "" }
struct A
{
static int i;
int j;
};
template<int> void foo ()
{
int x[A::i];
//int y[A().j];
}
void bar ()
{
foo<6> ();
}
|
google | android | void12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/void12.C | 121 | utf_8 | 2a5a8ea7e9d97750e220094aef1a6168 | // PR c++/28639
template<void> struct A // { dg-error "not a valid type" }
{
static const int i = 1;
char a[i];
};
|
google | android | typename4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/typename4.C | 190 | utf_8 | e539dae13a2fcf8c5c897799294fa8f0 | struct B { template <typename U> struct C; };
template <typename T> struct A { typedef typename T::C V; }; // { dg-error "not a type" }
void f () { A<B>::V p; } // { dg-message "required" }
|
google | android | crash29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/crash29.C | 115 | utf_8 | ceec3c489e5f321a136749ba214020ac | // PR c++/18512
template <int> struct A {};
struct B : A<0>
{
void foo() { this->A<0>; } // { dg-error "" }
};
|
google | android | inherit6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/inherit6.C | 239 | utf_8 | e05437ae4847c9ca9cbd1a6c311ce7ca | // Origin PR c++/47172
// { dg-do compile { target c++11 } }
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 | android | error30 | .C | toolchain/gcc/gcc-4.9/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 | android | static5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/static5.C | 318 | utf_8 | e5538275a590133055e80d957d76fab1 | // { dg-do compile }
// PR c++/12932: ICE address of static function as template argument
struct Test {
static void fun();
};
template <void (*fun)()>
void foo () { (*fun)(); }
template
void foo<Test::fun> (); |
google | android | error54 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/error54.C | 224 | utf_8 | 88b870e41229c363cbb5085bd02d7557 | // PR c++/56380
template <typename T>
struct X {
X();
mutable T x; // { dg-error "cannot be declared" }
};
X<const int> a; // { dg-message "required from here" }
X<int&> b; // { dg-message "required from here" }
|
google | android | dtor4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/dtor4.C | 178 | utf_8 | 6e56714a3e1899ea002e689d9f32a53f | // PR c++/19440
// { dg-do compile }
template<int> struct A
{
~A<0>(); // { dg-error "parse error|declaration" }
}; |
google | android | call6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/call6.C | 230 | utf_8 | e3d27e71e5cdf1b6216b87f64c98c15c | // PR c++/38577
// { dg-do compile }
struct A
{
static A *bar ();
};
struct B : public A
{
static void baz ();
};
template <class T>
void foo ()
{
(static_cast<B *> (A::bar ()))->baz ();
}
void
bar ()
{
foo<int> ();
}
|
google | android | cond4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/cond4.C | 244 | utf_8 | 8e0316960b82711ee5f56b8b469d01b1 | // PR c++/14369
struct A { };
template<class T>
struct X : A {
const A* bar() const
{ return this; }
const A& foo() const;
};
template<class T>
const A& X<T>::foo() const
{
const A* t = bar();
return *(t ? t : throw 0);
}
|
google | android | injected2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/injected2.C | 172 | utf_8 | 32e85a6cdf780ae9bb7fc2da0ff02cee | // DR 1004
template <class T, template<class>class U = T::template B> struct A { };
template <class T> struct B {
template <class U> friend struct B;
};
A<B<int> > a;
|
google | android | sizeof3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/sizeof3.C | 201 | utf_8 | f6e095b160ad28af4c90a4545b086bc6 | // The call to f is not potentially evaluated (3.2), so f<int> is not used,
// so it should not be required.
template <class T>
T f (T)
{
typename T::X x;
}
int main()
{
int i = sizeof (f(0));
}
|
google | android | deduce1 | .C | toolchain/gcc/gcc-4.9/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 | android | array26 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/array26.C | 761 | utf_8 | 8894a9a8ca6a93ffc4fb75f5882e3826 | // PR c++/57325
class valarray { int _M_data; };
template < typename > struct SimpleJet { valarray partials; };
template < class C > struct scoped_ptr_impl
{
scoped_ptr_impl (C *):data_ () { }
struct Data
{
C ptr;
};
Data data_;
};
template < class, class = int >struct scoped_ptr;
templat... |
google | android | ctor8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ctor8.C | 177 | utf_8 | 4ed33c1007f1b16ad7f6fa2811b165ba | // PR c++/28711
// { dg-do compile }
// { dg-options "" }
template<int> struct A
{
int x[1][1];
A() : x((int[1][]){{0}}) {} // { dg-error "except the first" }
};
A<0> a;
|
google | android | explicit-instantiation2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/explicit-instantiation2.C | 214 | utf_8 | 6335a6cb9fd88717c1c31d2bc8b80c3e | // Bug 10968: implicit instantiation overrides explicit instantiation
// { dg-final { scan-assembler "_Z1fIiET_S0_" } }
template <class T> T f (T t) { return t; }
inline void g () { f (4); }
template int f (int);
|
google | android | invalid1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/invalid1.C | 276 | utf_8 | 1b62efdc0a239bb15d76fcf36d229cc0 | // PR c++/14883
// { dg-options "-std=gnu++98" }
template < class T > struct DomainTraits {};
template < int Dim > class Interval;
template < class DT > class Domain {};
template <> class Interval < 1 >:public Domain < DomainTraits < Interval < 1 >
>> {}; // { dg-error "" }
|
google | android | ref1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/template/ref1.C | 148 | utf_8 | c6c126721707d148ce66066de06c754b | // { dg-prune-output "mangled name" }
class a {} a1;
template <a & p> class b { public: b() { static_cast <a &> (p); } };
int main() { b <a1> b1; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.