Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Nikolay Yatsenko
Fri, 29 Jan 1993 03:14
g++ bug
Author: Nikolay Yatsenko
Date: Fri, 29 Jan 1993 03:14
Date: Fri, 29 Jan 1993 03:14
40 lines
2017 bytes
2017 bytes
Compile error (gcc 2.3.3, sparc), inline function in nested class.
Below is an example:
input source file, gcc 2.3.3 compiler messages.
/////////////////// Input file /////////////////////////////////////////
// ARM 9.7 Nested Class Declaration.
//
// From AT&T Annotated C++ Reference Manual, 9.7:
// "Except by using explicit pointers, references, and object names,
// declarations in a nested class can use only type names, static members,
// and enumerations from the enclosing class."
//
// This is an example from ARM $9.7.
int x;
class enclose {
public:
int x;
static int s;
class inner {
void f(int i)
{
::x = i; // Error: g++ gives error, should be OK: assign to global x.
}
};
};
///////////////// end of input file ////////////////////////////////
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
gcc version 2.3.3
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix nested2.C /usr/tmp/cca26697.i
GNU CPP version 2.3.3 (sparc)
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cc1plus /usr/tmp/cca26697.i -quiet -dumpbase nested2.cc -version -o /usr/tmp/cca26697.s
GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
nested2.C:20: warning: all member functions in class `inner' are private
nested2.C: In method `void inner::f (int)':
nested2.C:18: assignment to non-static member `x' of enclosing class `enclose'/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads