Technical data
Cray Standard C/C++ Reference Manual
in normal mode. In practice, this is not much of a problem, since classes that
allow bitwise copying usually do not have destructors.
• A union member may be declared to have the type of a class for which
the user has defined an assignment operator (as long as the class has no
constructor or destructor). A warning is issued.
• When an unnamed class appears in a typedef declaration, the typedef
name may appear as the class name in an elaborated type specifier. For
example:
typedef struct { int i, j; } S;
struct S x; // No error in cfront mode
• Two member functions may be declared with the same parameter types when
one is static and the other is nonstatic with a function qualifier. For example:
class A {
void f(int) const;
static void f(int); // No error in cfront mode
};
• The scope of a variable declared in the for-init-statement is the scope to
which the for statement belongs. For example:
int f(int i) {
for (int j = 0; j < i; ++j) { /* ... */ }
return j; // No error in cfront mode
}
• Function types differing only in that one is declared extern "C" and the
other extern "C++" can be treated as identical:
typedef void (*PF)();
extern "C" typedef void (*PCF)();
void f(PF);
void f(PCF);
By contrast, in standard C++, PF and PCF are different and incompatible
types; PF is a pointer to an extern "C++" function whereas PCF is a
pointer to an extern "C" function; and the two declarations of f create an
overload set.
• Functions declared inline have internal linkage.
• enum types are regarded as integral types.
170 S–2179–36










