This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Compiler error 40 in v.2.91.66, structs in structs
- To: bug-gcc at gnu dot org
- Subject: Compiler error 40 in v.2.91.66, structs in structs
- From: "Daniel Weber" <djweber at alum dot mit dot edu>
- Date: Thu, 17 Aug 2000 01:10:03 -0400
- cc: djweber at alum dot mit dot edu
- Reply-To: djweber at alum dot mit dot edu
When compiling the file bug.cpp, the compiler generates an "Internal
compiler error 40 message."
My bug is clear--I use "ip.item" where I should use "ip.i".
If I try using "int" instead of "item" I do not get this error.
> uname -mrspv
Linux 2.2.16 #1 Thu Jun 8 21:32:04 EDT 2000 i686 unknown
> more bug.cpp
struct item {};
typedef struct {int i;double price;} itemprice;
class bug {
public:
bool has(item i);
private:
itemprice ip;
};
bool bug::has(item i) {
item c;
c = ip.item;
return false;
}
> g++ bug.cpp
bug.cpp: In method `bool bug::has(struct item)':
bug.cpp:17: warning: invalid use of type decl `struct item' as expression
bug.cpp:17: Internal compiler error 40.
bug.cpp:17: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
bug.cpp:17: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
> g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)