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 | friend14 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend14.C | 277 | utf_8 | 12ea946975f9ac153ba628a157f55a5a | // PR c++/35109
struct C;
void f() {
struct A {
friend struct B;
friend struct C;
void g()
{
B *b; // { dg-error "not declared" }
C* c; // OK, finds ::C
}
};
C *c; // OK, finds ::C
struct B {};
B *b; // OK, now it isn't hidden
}
|
google | android | suggestions1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/suggestions1.C | 388 | utf_8 | af851aa99e053824fac72b6ad0793b03 | // { dg-do compile }
namespace N { namespace M { int foo; } } // { dg-message "N::M::foo" }
int f (void) { return N::foo; } // { dg-error "not a member" }
// { dg-message "suggested alternative" "missing namespace" { target *-*-* } 4 }
int g (void) { return ::foo; } // { dg-error "not been declared" }
// { dg-messa... |
google | android | nested2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/nested2.C | 81 | utf_8 | fd517010ca215fc30ad0d3a32a3ed3f3 | // PR c++/51586
union U
{
union U { int i; }; // { dg-error "same name" }
};
|
google | android | name-clash1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/name-clash1.C | 204 | utf_8 | 6c99bf6f0c2260471ad74e39e36cdf71 | // { dg-do compile }
// PR c++/5402
struct A
{
struct B {};
};
struct C
{
typedef int B;
};
struct D : A
{
struct E : C {};
struct B {};
}; |
google | android | hidden-class4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class4.C | 191 | utf_8 | 4015bc4983ffa5738cd73a7e693ab292 | // { dg-do compile }
class A {
friend class B;
};
class B *b;
B *c; |
google | android | koenig9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/koenig9.C | 316 | utf_8 | 69e76e666a1dd7169928c50d3683e7f4 | // Test for sensible handling of template-ids with arg-dep lookup.
// This is still an open issue.
namespace N
{
struct A { };
void f(void (*)(int, N::A));
}
namespace M
{
struct B { };
void f(void (*)(B, N::A));
}
template <class T>
void g(T, N::A);
void g();
int main()
{
f(g<int>);
f(g<M::B>);
}
|
google | android | using11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using11.C | 90 | utf_8 | 3b1be5c1d7f024899683d6b51a3db2aa | namespace N1 {
enum e { a };
void e(char);
}
void f() {
using N1::e;
enum e x;
}
|
google | android | builtin2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/builtin2.C | 472 | utf_8 | d4887e959260b7f96317369d69134b6c | /* { dg-do compile } */
/* PR c++/21087 */
/* We used to overload the template function with the built-in
declaration, instead of replacing it as we should, and then barf at
the using decl because of a test that none of the overload set
members were anticipated built-ins. */
extern "C" signed int toupper(s... |
google | android | using50 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using50.C | 173 | utf_8 | 389a92cf6aacf98eb4b24781b6ec7ebc | // PR c++/51319
// { dg-do compile }
template<int> struct X {};
struct Base
{
enum { a = 1 };
};
struct Der : Base
{
using Base::a;
typedef X<(int)a> Y;
};
|
google | android | crash1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/crash1.C | 456 | utf_8 | eca250664b688ff2d60db784a03646f6 | // { dg-do compile }
// PR c++/11871 Regression
namespace std
{
class A
{
public:
enum result
{
ok
};
};
template<typename T> class B : public A
{
public:
typedef A::result result;
};
}
int main()
{
for(float result = 1.0;;);
} |
google | android | using21 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using21.C | 193 | utf_8 | de5435c6fdaa42a8c943f90be9019ea7 | // PR c++/40799
namespace Bar {
typedef int A;
}
class CollectionDeleteGuard {
public:
CollectionDeleteGuard(int);
};
CollectionDeleteGuard::CollectionDeleteGuard(int)
{
using Bar::A;
}
|
google | android | hidden-class10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class10.C | 284 | utf_8 | c288e61deca8ad2660914a4297a7c80b | // { dg-do compile }
// Verify that a friend class is hidden even if it overrides a builtin
// function name.
class A {
friend class abort;
abort *b; // { dg-error "type|expected" }
}; |
google | android | using29 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using29.C | 1,149 | utf_8 | 41083ecc0cd067bef02bf05dcac8caa3 | // { dg-do compile }
struct A
{
int i;
};
struct B
{
int i;
};
struct C : A, B
{
using A::i; // { dg-message "previous" }
using B::i; // { dg-error "redeclaration" }
};
struct E
{
typedef int type;
};
struct F
{
typedef int type;
};
struct G : E, F
{
using E::type; // { dg-message "previous" }
usi... |
google | android | hidden-class11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class11.C | 378 | utf_8 | d363d9de44498afed8d14153c451f6f9 | // { dg-do compile }
// Verify that a friend class is hidden even if it is hidden by a non-builtin
// function name.
namespace M {
void F (void);
class F;
}
namespace N {
void F(void);
class A {
friend class F;
};
}
using namespace M;
using namespace N;
class F *b; |
google | android | using19 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using19.C | 412 | utf_8 | 2f7856e44d88c2a8a051c1b70aff3f85 | // { dg-do compile }
// C++ Standard, 7.3.3, clause 10:
// "Since a using-declaration is a declaration, the restrictions on
// declarations of the same name in the same declarative region (3.3) also
// apply to using-declarations."
namespace M
{
union A;
void B();
}
void A();
union B;
using M::A;
using M::B; |
google | android | hidden-temp-class11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class11.C | 253 | utf_8 | 4ccdb617ff78279d83f998edb37cd393 | // { dg-do compile }
namespace N {
class A {
template <class T> friend class B;
};
}
using N::B; // { dg-error "declared" } |
google | android | friend5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend5.C | 339 | utf_8 | 187ba092057b229619d98cf5e000c6e1 | // { dg-do compile }
// PR c++/3332: Friend function lookup in class defined outside its
// namespace
namespace N
{
class A;
}
class N::A
{
void x();
friend void func(void);
};
namespace N
{
void func(void);
}
void N::func(void)
{
N::A a;
a.x();
}
int main()
{
return 0;
} |
google | android | scoped6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/scoped6.C | 214 | utf_8 | d0e63df38adea95bde4f29a4a8adbd7a | template <typename X>
class Foo {
int i;
public:
Foo() {
X::explode(); // { dg-error "" }
}
};
class Bar {
Foo<int> foo_;
public:
Bar() {} // { dg-message "required" }
};
template class Foo<int>;
|
google | android | struct1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/struct1.C | 414 | utf_8 | 5c1c26a3d7600538118a4941d09bc349 | // Various struct lookup tests. We didn't used to complain about
// the definition of C.
struct A;
typedef struct A B; // { dg-message "previous declaration" }
struct B; // { dg-error "using typedef-name" }
typedef struct { int i; } C; // { dg-message "previous declaration" }
struct C; // { dg-error "using type... |
google | android | class-member-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/class-member-2.C | 102 | utf_8 | 150d0e731cb43b0a2d8a3416484aa2a0 | template <typename T> struct A
{
void foo () const {}
char A;
};
void bar() { A<void>().foo(); }
|
google | android | ns3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/ns3.C | 95 | utf_8 | 326caa0ef916da51fec348c662a91f18 | // PR c++/32898
namespace N { }
int N::i; // { dg-error "should have been declared inside" }
|
google | android | friend2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend2.C | 385 | utf_8 | 1d1b78e141263b9b6035a3fccc6af928 | // { dg-do compile }
// PR c++/14513, unqualified lookup of friend class.
struct S {
void test (void);
};
namespace NS {
class X {
friend class S;
static int *i; // { dg-error "private" }
};
}
void S::test () {
NS::X::i; // { dg-error "this context" }
} |
google | android | strong-using-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/strong-using-1.C | 293 | utf_8 | 2b1b09d91910d20eece0379cd7533859 | // PR c++/13594 (secondary)
// { dg-options "" }
// { dg-do compile }
namespace fool {
inline namespace foo {
template <class T> void swap(T, T);
}
template <class T> void swap(T);
}
int main() {
// we used to fail to look up the associated namespace here
fool::swap(1, 1);
}
|
google | android | pr6936 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/pr6936.C | 304 | utf_8 | 08082049df0cf8bf9a41e050253cf8f6 | // { dg-do compile }
// PR c++/6936
struct Baser
{
enum { j, i }; // { dg-error "inaccessible" }
};
struct Base : Baser
{
static void j();
static void i();
};
struct Derv : Base
{
using Baser::j;
private:
using Baser::i;
};
int k = Derv::j;
int l = Derv::i; // { dg-error "context" }
|
google | android | hidden-class6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class6.C | 188 | utf_8 | 75d6130ec7488ae9b8d9c00b3d8439f1 | // { dg-do compile }
// PR c++/1016: Name lookup for injected friend class
class B;
namespace N {
class A {
friend class B;
B* b;
};
} |
google | android | using40 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using40.C | 717 | utf_8 | c7eba10fde1c022b01e7cea82dca77f0 | // { dg-do compile }
struct Base
{
void f();
typedef int type;
struct Type {};
int i;
static int j;
};
struct A : Base
{
using Base::f; // { dg-message "previous declaration" }
using Base::f; // { dg-error "redeclaration" }
using Base::type; // { dg-message "previous declaration" }
... |
google | android | new2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/new2.C | 432 | utf_8 | 9acfc8706a0bca23685ea80c9dd6b524 | // { dg-do compile }
// Reject [de-]allocation functions declared in a namespace, or
// declared as static.
namespace A {
void* operator new(__SIZE_TYPE__ s, int* p); // { dg-error "namespace" }
void operator delete(void*); // { dg-error "namespace" }
}
static void* operator new(__SIZE_TYPE__ s,... |
google | android | using15 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using15.C | 153 | utf_8 | dc21e16250c98c89c5aa0d520799c564 | // PR c++/27933
// { dg-do compile }
template<int> struct A
{
int i;
A() { using i; } // { dg-error "nested-name-specifier|declared" }
};
A<0> a;
|
google | android | crash8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/crash8.C | 138 | utf_8 | 8702e9a4573ea9d19da851427038afe8 | // PR c++/58843
struct A {};
template<typename T> void foo(T t)
{
t.T::~X(); // { dg-error "no type" }
}
void bar()
{
foo(A());
}
|
google | android | friend13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend13.C | 88 | utf_8 | d5d8f8802b06ec8909b759d46c8931c7 | // PR c++/37558
class Foo {
friend class Bar;
friend void func(const class Bar*);
};
|
google | android | two-stage5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/two-stage5.C | 330 | utf_8 | 55b606de81dcee47c1021a188831f526 | // { dg-do run }
extern "C" void abort ();
namespace N {
template <class T> T foo (T) { return T (); }
template <class T> T bar (T t) { return foo (t); }
}
struct S { S (int i = 0): i_ (i) { } int i_; };
namespace N {
/* template <> */ S foo (S) { return S (1); }
}
int main ()
{
if (1 == N::bar (S()).i_)
abo... |
google | android | hidden-class9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class9.C | 234 | utf_8 | d13c196ccdbbc4683a8238093061dcba | // { dg-do compile }
namespace N {
class A {
friend class B;
};
}
using N::B; // { dg-error "declared" } |
google | android | hidden-temp-class7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class7.C | 286 | utf_8 | c9817628c80c566a7294b70afca6d827 | // { dg-do compile }
class A {
template <class T> friend class B;
};
class C {
template <class T> friend class B;
};
B<int> *b; // { dg-error "type|expected" } |
google | android | strong-using-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/strong-using-3.C | 276 | utf_8 | 7da1d317c0e74ab901f17a10189784da | // PR c++/13659
// { dg-options "" }
// { dg-do compile }
namespace bar {
inline namespace foo {
template <class T> void f(T, T);
}
template <class T> void f(T);
}
int main() {
// Make sure both declarations are brought in.
using bar::f;
f(1);
f(1, 1);
}
|
google | android | friend12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend12.C | 162 | utf_8 | 633091cdd3ac488ec10917d42e7f1b0c | // PR c++/34912
void foo()
{
struct A
{
friend void bar(); // { dg-error "without prior declaration" }
};
bar(); // { dg-error "not declared" }
}
|
google | android | friend6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend6.C | 278 | utf_8 | f00af47e1b16d7d6e6577ae76572b806 | // { dg-do compile }
// PR c++/19258: Wrong lookup scope for friend defined in class.
class X {
template<class T> friend int ff(T*, int y=anX.x) { return y; }
int f() { return ff(&anX); }
static X anX;
int x;
};
X dummy; |
google | android | disamb1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/disamb1.C | 223 | utf_8 | 86271224c38de31ea55c228d8c440211 | // PR c++/525
// Bug: With -pedantic, we weren't converting this to B1* for the call.
struct A
{
void f();
};
struct B1: public A {};
struct B2: public A {};
struct C: public B1, public B2
{
void g() { B1::f(); }
};
|
google | android | using39 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using39.C | 846 | utf_8 | 5f4e9941a5eb0ad3e74459e375672825 | // { dg-do run }
template <class T>
struct A
{
int f() { return 1; }
};
template <class T>
struct B : A<T>
{
int f() { return 2; }
using A<T>::f;
void g()
{
if (A<T>::f() != 1 )
__builtin_abort();
if( B<T>::f() != 2 )
__builtin_abort();
if( this->f() != 2 )
__builtin_abort();
... |
google | android | two-stage4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/two-stage4.C | 418 | utf_8 | 1b8c33d621d2aea028aa0ce6b0b904fe | template<class T> struct wrap {};
template<typename T> bool& operator==(wrap<T>, wrap<T>);
template<typename T>
void g(T, wrap<wrap<int> > x)
{
bool& b = x == x; // { dg-bogus "invalid initialization of reference" "" { xfail *-*-*} }
}
template<typename T> int& operator==(wrap<wrap<T> >, wrap<wrap<T> >);
void h()
{
... |
google | android | hidden-temp-class1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class1.C | 236 | utf_8 | 30e82b8c154368eba73727110f43e382 | // { dg-do compile }
class A {
template <class T> friend class B;
B<int> *b; // { dg-error "type|expected" }
}; |
google | android | koenig6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/koenig6.C | 297 | utf_8 | 2b57e70eb4d75a58c6bd335db965b478 | // PR c++/17365
// ADL should not find B::N.
namespace A
{
namespace B
{
template <typename T> struct N {int n_;};
}
template <typename T> int N( T p ) { return p->n_; }
template <typename T> void f( T p ) { N(p); } // #1
}
int main()
{
A::B::N<int> n;
A::f(&n);
return 0;
}
|
google | android | using5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using5.C | 355 | utf_8 | e6b9eddad8d672688c883ca8af446a66 | // { dg-do compile }
// PR c++/10554: ICE for member using declaration with failed
// scope name lookup.
template <typename> struct A
{
typedef A X;
void foo();
};
template <typename T> struct B : A<T>
{
using X::foo; // { dg-error "declared|nested-name-specifier|non-member" }
}; |
google | android | ns4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/ns4.C | 188 | utf_8 | b16d2b44bfa0aeed86e99a04f412703d | // PR c++/43145
// { dg-do link }
namespace N {
void f();
}
void N::f()
{
extern int i;
extern void g();
i = 1;
g();
}
namespace N {
int i;
void g() { }
}
int main() { }
|
google | android | using17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using17.C | 384 | utf_8 | 9781511ea4243986b37a588c52e63a38 | // { dg-do compile }
namespace M {
struct S {}; // { dg-message "struct M::S" "candidate 2" }
}
int S;
struct S {}; // { dg-message "candidates are: struct S" "candidate 1" }
using namespace M;
struct S s; // { dg-error "reference to 'S' is ambiguous|invalid type in declaration" "" } |
google | android | scoped4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/scoped4.C | 244 | utf_8 | aa72bf12de95e37fe79a3293544473d4 | /* PR c++/754 */
/* { dg-do compile } */
namespace foo
{
namespace bar
{
enum x {foo
};
enum {ubit0 = 0x0001};
// Used to get a parse error before "::" token.
int i=foo::bar::ubit0;
}
}
|
google | android | using45 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using45.C | 471 | utf_8 | d2560a1ec99e0f63df2296d6904c1854 | // PR c++/30195
// { dg-do run }
template <class T>
struct A
{
int f(int) { return 0; }
int f(double) { return 1; }
int f(char) { return 2; }
};
template <class T>
struct B : A<T>
{
using A<T>::f;
int f(int) { return 3; }
};
int main()
{
B<int> b;
if( b.f( 42 ) != 3 )
__builtin_abort();
... |
google | android | using7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using7.C | 298 | utf_8 | 9b2f75de04724a15459525668a32458a | template <typename T, bool=T::X> struct A
{
int i;
};
template <typename T> struct B : A<T> // { dg-error "incomplete" }
{
using A<T>::i; // { dg-error "incomplete" "incomplete" }
// { dg-error "using" "using" { target *-*-* } 8 }
};
B<void> b; // { dg-message "required" }
|
google | android | name-clash4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/name-clash4.C | 242 | utf_8 | 4e9fb69366257ce11558488f9cdac95d | // { dg-do compile }
// PR c++/18100: Invalid nested type.
struct A
{
template<int> struct A {}; // { dg-error "same name" }
};
A::A<0> a; // { dg-error "not a template|constructor" } |
google | android | using32 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using32.C | 134 | utf_8 | a37f284dd65a3609bf1db28414d17c25 | // { dg-do compile }
struct T { struct type {}; };
struct T2 : T { using T::type; };
struct T3 : T2
{
struct type {};
type t;
};
|
google | android | hidden-class8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class8.C | 246 | utf_8 | 43ad4f369597420b26688a9f8ee0553a | // { dg-do compile }
namespace N {
class A {
friend class B;
};
}
class N::B { // { dg-error "not name a class" }
}; |
google | android | hidden-class17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class17.C | 347 | utf_8 | 8b15de265bff2fd9c8deac57996c96a9 | // Origin PR c++/51641
// { dg-do compile }
struct A {
struct B { typedef int X; };
};
template<class B> struct C : A {
B::X q; // Ok: A::B.
struct U { typedef int X; };
template<class U>
struct D;
};
template<class B>
template<class U>
struct C<B>::D {
typename U::X r; // { dg-error "" }... |
google | android | name-clash10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/name-clash10.C | 88 | utf_8 | 51f1b95d6c879739a8fae563ede188d0 | // PR c++/38313
struct foo { };
struct bar { };
struct baz {
static foo (bar)();
};
|
google | android | strong-using-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/strong-using-5.C | 230 | utf_8 | 81170031ad2a38d5f6c077134ed385f1 | // PR c++/33486
// { dg-options "" }
namespace A
{
inline namespace B
{
struct T
{
struct U { };
U f();
};
}
inline namespace C
{
void g (T::U);
}
}
int main()
{
A::T t;
g(t.f());
}
|
google | android | error1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/error1.C | 297 | utf_8 | e1065e3c32eb11e771ff730bee591915 | // PR c++/17609
// { dg-do compile }
namespace N { int i; } // { dg-message "N::i" }
void foo() { i; } // { dg-error "not declared" }
// { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 6 }
using namespace N;
void bar() { i; } |
google | android | hidden-class13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class13.C | 301 | utf_8 | a4858648c41c9b0f1ca44a59f37fd567 | // Origin PR c++/36019
// { dg-do compile }
struct F {
static const int x = 0;
};
struct B {
template <typename B>
struct C
{
static int f ()
{
return B::x;
}
};
};
int
main ()
{
int j = B::C<F>::f ();
return 0;
} |
google | android | scoped2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/scoped2.C | 295 | utf_8 | b7a658adf99cb82ba017f02f1f2411c6 | // { dg-do compile }
// Seg faulted.
struct Base
{
};
struct Derived : Base
{
void Foo ()
{
Base::Baz (); // { dg-error "is not a member" "" }
}
}; |
google | android | using25 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using25.C | 317 | utf_8 | aff7de7adc795eb143921ae465b9ec0f | // PR c++/26256
// { dg-do run }
struct A
{
int next;
};
struct B
{
int next;
};
struct C : public A, public B
{
using A::next;
};
void foo(C& c) { c.next = 42; }
int main()
{
C c;
c.B::next = 12;
if (c.next != 42 || c.A::next != 42 || c.B::next != 12)
__builtin_abort();
} |
google | android | template2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/template2.C | 443 | utf_8 | 7019845dfb6dbd2d5547a6f72b822068 | // { dg-do compile }
// PR 10199. Lookup problems
class X {
public:
template<int d>
int bar ();
};
template<int x>
int fooo ();
template<class T>
void bar (T& g)
{
int kk = fooo<17>(); // OK
X x;
int k = x.bar<17>(); // Not OK
}
int main ()
{
X x;
int k=x.bar<17>(); // OK
int n;
bar(n);
} |
google | android | anon2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/anon2.C | 245 | utf_8 | ce55341d8c9c67e8e366abf6328acf2f | // { dg-do compile }
// { dg-options "-std=c++98" }
// Make sure we issue a diagnostic if a type with no linkage is used
// to declare a a variable that has linkage.
struct { int i; } a; // { dg-warning "anonymous type" }
void foo() { a.i; }
|
google | android | name-clash2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/name-clash2.C | 208 | utf_8 | 924d0b82f921fb6c61ded452d74242a8 | // { dg-do compile }
// PR c++/9777
struct A
{
struct X {};
struct Y { void X(); };
};
struct B : A
{
struct Y : A::Y {};
struct X : A::X {};
}; |
google | android | koenig3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/koenig3.C | 150 | utf_8 | 0efd4ef624e1a631dad2972522c30301 | extern "C" void abort ();
struct S {
};
void f(S, int) { abort(); }
void f(S, double) {}
S s;
int main() {
extern void f(S, int);
f(s, 3.0);
}
|
google | android | hidden-class3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class3.C | 192 | utf_8 | 0f80d6d420969bf03406748b683c92d5 | // { dg-do compile }
class A {
friend class B;
class B;
B *b;
}; |
google | android | template1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/template1.C | 527 | utf_8 | a793e64bb6b34881797f23d0f6a812f7 | /* PR c++/3009 */
/* { dg-do run } */
// According to 14.6.2.4 of C++ Standard:
// "If a base class is a dependent type, a member of that
// class cannot hide a name declared within a template, or a
// name from the template's enclosing scopes."
class B {
public:
int foo() { return 1; }
};
int foo() { return 0; }... |
google | android | conv-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/conv-2.C | 356 | utf_8 | b59dc1be1de7788c3e2134a73db76fc4 | // { dg-do compile }
// { dg-final { scan-assembler "_ZNK2A1cviEv" } }
struct A1
{
operator int () const; // this one
};
struct A2 : A1
{
template<typename T> operator T () const;
};
int Foo (A2 const &b)
{
return b;
} |
google | android | extern-c-redecl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C | 269 | utf_8 | 42649607e256c4617aa495101b2c5d8c | // Origin PR c++/41020
// { dg-do compile }
extern "C"
{
int fork (void);
}
class frok
{
int this_errno;
friend int fork (void);
};
extern "C" int
fork (void)
{
frok grouped;
return grouped.this_errno;
} |
google | android | using51 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using51.C | 270 | utf_8 | f987ef07d14ec2f00187c4c84c596777 | // PR c++/51382
// { dg-do compile }
// { dg-options "-Wno-deprecated" }
template< int Value >
struct Base
{
enum { b_e = Value };
};
template< typename Type >
struct Derived : Type
{
Type::b_e;
enum { d_e = b_e };
};
int v = (int)Derived< Base< 3 > >::d_e;
|
google | android | hidden-temp-class9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class9.C | 256 | utf_8 | 553918de93ea2e1a018822b6746d8a0a | // { dg-do compile }
class A {
friend class B;
};
class C {
template <class T> friend class B; // { dg-error "not a template" }
}; |
google | android | hidden-class12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class12.C | 272 | utf_8 | 5d84f55cadb94cac360a5e9fb5bafea4 | // Origin PR c++/36019
// { dg-do compile }
struct F {
static const int x = 0;
};
struct A {
template <typename A>
static int f ()
{
return A::x;
}
};
int
main ()
{
int i = A::f<F> ();
return i;
} |
google | android | using28 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using28.C | 156 | utf_8 | c327a4c816ef51deda0133814e487924 | // PR c++/26256
// { dg-do compile }
struct A { int f; };
struct B { int f; };
struct C : A, B { using B::f; };
struct D : C
{
void g() { f = 1; }
};
|
google | android | friend11 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend11.C | 398 | utf_8 | 20170e184fe22689b9a43c017d45efad | /* PR c++/30917 */
/* This used to ICE */
/* { dg-do compile } */
class QGList;
unsigned count() {
class QGListIterator {
friend class QGList;
QGListIterator( const QGList & ); // OK, finds ::QGList.
};
return 0;
}
// This is valid.
unsigned count2() {
class QGList2;
class QGListIterator2 {
fri... |
google | android | pretty1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/pretty1.C | 49 | utf_8 | 9fc063d780e4510399927cfe832e8770 | void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; }
|
google | android | name-clash5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/name-clash5.C | 364 | utf_8 | d7ccecb96ce8f3d356f5fd2a69e89340 | // { dg-do compile }
// C++ Standard, 3.3, clause 4:
// "[Note: a namespace name or a class template name must be unique in its
// declarative region (7.3.2, clause 14). ]"
namespace N
{ // { dg-message "previous declaration" }
}
class N; // { dg-error "redeclared" } |
google | android | hidden-class7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class7.C | 244 | utf_8 | 5254cbd01cec16e4a319c480050dca29 | // { dg-do compile }
class A {
friend class B;
};
class C {
friend class B;
};
B *b; // { dg-error "type|expected" } |
google | android | conv-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/conv-5.C | 312 | utf_8 | 0e3bdcba06a0b268451ab07419fa8b6a | // { dg-do compile }
struct A {
template<typename T>
operator T() const;
operator float() const;
}; |
google | android | linkage1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/linkage1.C | 97 | utf_8 | 2e2a3c97b00100544902ae284deb2b80 | // DR 563
extern int i; // { dg-message "linkage" }
extern "C" int i; // { dg-error "linkage" }
|
google | android | friend3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend3.C | 323 | utf_8 | e51e64a92ddf4c4d012cb738bf62fde5 | // { dg-do compile }
// Friend name lookup in class defined outside its namespace
namespace A {
class B;
class C;
}
class A::B {
friend class C;
typedef int i;
};
class A::C {
A::B::i j;
}; |
google | android | friend8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/friend8.C | 250 | utf_8 | 55fad96206146b00439be99fa14cb114 | // Test that we look up a friend declared at top level ahead of an
// undeclared friend found by argument dependent lookup.
// { dg-do run }
int f(int) { return 0; }
struct S {
friend int f(char) { return 1; }
};
int main () { return f('a'); }
|
google | android | strong-using-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/strong-using-2.C | 418 | utf_8 | 9cf5f616cd7d12356a4b60ef67aaf1e1 | // PR c++/13594
// { dg-options "" }
// { dg-do compile }
namespace foo {
inline namespace foo_impl {
class T; // { dg-message "T" "" }
}
}
namespace bar {
inline namespace bar_impl {
class T; // { dg-message "T" "" }
}
using namespace foo;
}
namespace baz {
using namespace foo;
using namespace ... |
google | android | using49 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using49.C | 411 | utf_8 | ecd308a785adcddf1d5811923e8298e7 | // PR c++/51188
// { dg-do compile }
#include <utility>
class XBase {
public:
virtual ~XBase() = 0;
enum ImpMode { Imp1, Imp2, Imp3 };
};
class X : public XBase {
class XBlock {};
using XBase::ImpMode;
using XBase::Imp3;
using XBase::Imp1;
using XBase::Imp2;
int _XBlocked;
std::pair<int,int>... |
google | android | anon7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/anon7.C | 376 | utf_8 | 8efa7c4066efa37096c6aa5f256ab6dc | // PR c++/39560
// { dg-options -Wunused }
struct X { };
class Z {
public:
X* cc(int c);
};
class F {
public:
typedef X* (Z::*MethO)(int);
typedef X* (F::*MethF)(int);
template<MethO m>
X* xwrapper(int i) {
union {
Z *z;
F *f;
}; // { dg-bogus "unused" }
f = this;
return ((z-... |
google | android | crash4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/crash4.C | 184 | utf_8 | 7e5cb27f2cb8fd20d4617c4cfb845085 | // { dg-do compile }
//
// PR 3761
struct A {};
struct B {};
template <class T>
struct Foo : A, B
{
void func(void);
struct Nested
{
friend void Foo::func(void);
};
};
|
google | android | decl1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/decl1.C | 755 | utf_8 | 7f3fadfecc160e192db942c4e24b7c75 | // { dg-do compile }
// PR 8702. Failure to match templates.
template <typename X> struct C1{};
template <typename X>
struct C2 {
template<typename Y> operator C1<Y>();
template<typename Y> operator C2<Y>();
};
template<typename X> template<typename Y>
C2<X>::operator C1<Y>()
{
return C1<Y>();
}
struct A
{
oper... |
google | android | using | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using.C | 294 | utf_8 | e787b658f008402e539125d8744f57b8 | // { dg-do compile }
struct X { };
struct Y { };
struct Z { };
struct Base {
X f() { return X(); }
Y f() const { return Y(); }
};
struct Derived : Base {
using Base::f;
Z f(int) { return Z(); }
};
int main()
{
Derived d;
X x = d.f(); // { dg-bogus "Y" "" }
}
|
google | android | decl2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/decl2.C | 637 | utf_8 | d64551040d13bf36f94a380b6b298ea5 | // { dg-do compile }
// PR 9053. Failed to consider templates that are disambiguated by
// return type.
template <typename T> class bar;
template <> struct bar<const char*> { typedef void type; };
template <typename T> class qux;
template <> struct qux<int> { typedef void type; };
template <typename T>
typename bar<T>:... |
google | android | forscope1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/forscope1.C | 327 | utf_8 | c961035d55063ab35ff011e8098d8ea9 | // { dg-do compile }
// Bug 4206. We were nesting SCOPE_STMTs badly.
struct A
{
A ();
~A ();
};
void Go( )
{
while (1)
{
switch (1) {
default: {}
}
A d;
}
} |
google | android | using53 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using53.C | 823 | utf_8 | 0ea216615e5bbe93d1ee62a0d90ec5b5 | // PR c++/20420
class B
{
protected:
enum E { E1, E2, E3 };
struct S { int i; E e; };
};
class D : private B
{
public:
using B::E; // { dg-message "previous" }
using B::S; // { dg-message "previous" }
private:
enum E {}; // { dg-error "conflicts" }
struct S {}; // { dg-error "conf... |
google | android | anon1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/anon1.C | 512 | utf_8 | 2f777984f797382f3dba7eab93665be9 | // PR c++/2039
// Test that a scoped reference to a member of an anonymous union member of
// a base class works properly.
// { dg-do run }
struct A
{
long ia1;
union
{
long ia2;
};
};
struct B : public A
{
void f1();
void f2();
};
void B::f1()
{
ia1 = 11;
ia2 = 22;
}
void B::f2()
{
ia1 = ... |
google | android | using27 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using27.C | 563 | utf_8 | 37ed5e841d52c7a968b6808018f1412b | // PR c++/26256
// { dg-do run }
struct A
{
typedef int type;
};
struct B
{
typedef double type;
};
struct C : A, B
{
using A::type;
type d;
void f()
{
type e;
if (sizeof (type) != sizeof (A::type))
__builtin_abort();
}
void g();
};
void C::g()
{
type x;
if (sizeof (... |
google | android | nested1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/nested1.C | 353 | utf_8 | 2aad717d2580b37ccf512edb71fd54a2 | // Build don't link:
//
//
// PR c++/47 The parser failed to resolve 'B' in the return type of
// A::C::D::foo.
class A {
public:
class B;
class C;
};
class A::B {
};
class A::C {
class D;
};
class A::C::D {
public:
B* foo();
}; |
google | android | using9 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using9.C | 736 | utf_8 | 65cca97619987205926757809a9787fd | // { dg-do compile }
// Origin: C++ Standard Draft (7.3.3/12)
// PR c++/2294: using declarations should not conflict, but only cause
// an ambiguous overload set to be created.
namespace B {
void f(int); // { dg-message "note" }
void f(double); // { dg-message "note" }
}
namespace C {
void f(int); // ... |
google | android | using42 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using42.C | 292 | utf_8 | 1cf6b98d2fe6086859c5c7dd1613c8c2 | // PR c++/30195
// { dg-do run }
template <class T>
struct B
{
void foo(T) {}
};
template<class T>
struct Out
{
struct D : B<T>, B<double>
{
using B<T>::foo;
using B<double>::foo;
void bar() { foo(3); }
};
};
int main()
{
Out<int>::D x;
x.bar();
return 0;
}
|
google | android | hidden-class2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-class2.C | 185 | utf_8 | 1543acdebdb65876176b6415fff0ac88 | // { dg-do compile }
class A {
friend class B;
};
class B* b; |
google | android | using2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/using2.C | 1,392 | utf_8 | d90e987aac9e605de005cd0954d5b976 | // { dg-do compile }
namespace N
{
template<int> void f() {}
}
using N; // { dg-error "(using-declaration)|(nested-name)" "" }
using ::N; // { dg-error "using-declaration" "" }
using N::f< 0 >; // { dg-error "using-declaration" "" }
struct A {
template <class T> void f(T);
template <cla... |
google | android | crash7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/crash7.C | 112 | utf_8 | ab5c5a242a635b12bd7f567d048700f4 | // PR c++/35323
// { dg-options "" }
void foo(int);
void bar()
{
foo(1r); // { dg-error "not supported" }
}
|
google | android | hidden-temp-class10 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class10.C | 284 | utf_8 | 50ab8034359fc3eea96c1920bf38c853 | // { dg-do compile }
namespace N {
class A {
template <class T> friend class B;
};
}
template <class T> class N::B { // { dg-error "not name a class" }
}; |
google | android | enum1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/enum1.C | 87 | utf_8 | 3920de89ada5d72255d7202c8a1f6da8 | // PR c++/14476
struct tree_common {
enum tree_code code : 8; // { dg-error "" }
};
|
google | android | anon6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/anon6.C | 419 | utf_8 | 97bc2c4f321b81d2e5129e269f014b8b | extern int v1; // { dg-message "declared" }
static union { int v1; }; // { dg-error "redeclaration" }
static union { int v2; }; // { dg-message "declared" }
extern int v2; // { dg-error "redeclaration" }
int v3; // { dg-message "declared" }
static union { int v3; }; // { dg-error "redeclaration" }
static union { ... |
google | android | builtin4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/builtin4.C | 298 | utf_8 | 6296f0916fc8d5d3cd5a9b99cd2637aa | // { dg-do compile }
// PR 31749: ICE with redeclaration of builtin
namespace std
{
union abort;
}
union abort;
using std::abort; // { dg-error "" } |
google | android | hidden-temp-class4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/hidden-temp-class4.C | 235 | utf_8 | 7ca07a7aabef6641f43ec3e1fe52ee65 | // { dg-do compile }
class A {
template <class T> friend class B;
};
B<int> *b; // { dg-error "type|expected" } |
google | android | duperr1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/lookup/duperr1.C | 205 | utf_8 | 8f8bfa7911aa42a0568e9d558edea86f | // PR c++/29048
class A { int i; }; // { dg-bogus "is private.*is private" }
// { dg-error "is private" "" { target *-*-* } 3 }
class B:public A { B() { A::i=0; } }; // { dg-error "within this context" }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.