Technical data

Cray Standard C/C++ Dialects [B]
struct A {
void f(int);
static void sf(int);
typedef void A::T3(int); // nonstd typedef decl
typedef void T2(int); // std typedef
};
typedef void A::T(int); // nonstd typedef decl
T* pmf = &A::f; // nonstd ptr-to-member decl
A::T2* pf = A::sf; // std ptr to static mem decl
A::T3* pmf2 = &A::f; // nonstd ptr-to-member decl
In this example, T is construed to name a function type for a nonstatic
member function of class A that takes an int argument and returns void; the
use of such types is restricted to nonstandard pointer-to-member declarations.
The declarations of T and pmf in combination are equivalent to the following
single standard pointer-to-member declaration:
void (A::* pmf)(int) = &A::f;
A nonstandard pointer-to-member declaration that appears outside of a class
declaration, such as the declaration of T, is normally not valid and would
cause an error to be issued. However, for declarations that appear within a
class declaration, such as A::T3, this feature changes the meaning of a valid
declaration. cfront version 2.1 accepts declarations, such as T, even when A is
an incomplete type; so this case is also accepted.
Protected member access checking is not done when the address of a
protected member is taken. For example:
class B { protected: int i; };
class D : public B { void mf()};
void D::mf() {
int B::* pmi1 = &B::i; // error, OK in cfront mode
int D::* pmi2 = &D::i; // OK
}
Note: Protected member access checking for other operations (such as
everything except taking a pointer-to-member address) is done normally.
The destructor of a derived class can implicitly call the private destructor of a
base class. In default mode, this is an error but in cfront mode it is reduced to
a warning. For example:
S217936 167