new
From-SVN: r31956
This commit is contained in:
parent
d2e7ab702f
commit
564e43cdf1
1 changed files with 27 additions and 0 deletions
27
gcc/testsuite/g++.old-deja/g++.other/access8.C
Normal file
27
gcc/testsuite/g++.old-deja/g++.other/access8.C
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Build don't link:
|
||||
// Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
// Contributed by Nathan Sidwell 10 Feb 2000 <nathan@acm.org>
|
||||
|
||||
// Test that access to static members from a nested class of the derived
|
||||
// type works.
|
||||
|
||||
class Base
|
||||
{
|
||||
protected:
|
||||
static int Some_var;
|
||||
typedef int Some_t;
|
||||
};
|
||||
|
||||
class Derived : Base
|
||||
{
|
||||
protected:
|
||||
struct Nested
|
||||
{
|
||||
void Foo (Some_t);
|
||||
void Bar (Base::Some_t) { Base::Some_var = 1; }
|
||||
};
|
||||
};
|
||||
|
||||
void Derived::Nested::Foo (Some_t) {
|
||||
Some_var = 2;
|
||||
}
|
Loading…
Add table
Reference in a new issue