Your change breaks something.

Klaus-Georg Adams Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Mon Jun 8 10:50:00 GMT 1998


The latest egcs (cvs from about 10.00 GMT+2 on 8 Jun)
complains about the attached testcase:
/egcs/egcs/bin/g++ -ansi -pedantic-errors -c resolve.C 
resolve.C: In method `int B::foo()':
resolve.C:14: calling type `B::mode' like a method

while 
/egcs/egcs/bin/g++ -V egcs-2.91.33 -ansi -pedantic-errors -c resolve.C
compiles cleanly.

The error message comes from the change:

1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>

	* semantics.c (finish_object_call_expr): Complain about calling a
	TYPE_DECL.

I am pretty sure the code is ok.

kga
-- 
-------------------------------------------------------------------------
Klaus-Georg Adams        Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II            Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------

--------snip resolve.C-------------
// Build don't link.
struct B {
	enum mode { first, second };
	int foo();
};

struct A {
	B::mode mode();
};

extern A* theA;

int B::foo()
{
	if ( theA->mode() == first )
		return 0;
	else
		return 1;
}
--------snip resolve.C-------------



More information about the Gcc-bugs mailing list