[Bug c++/12591] gcc accepts invalid code

hg211 at ural2 dot hszk dot bme dot hu gcc-bugzilla@gcc.gnu.org
Mon Oct 13 13:53:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12591



------- Additional Comments From hg211 at ural2 dot hszk dot bme dot hu  2003-10-13 13:53 -------
Not really. The code is still invalid (it doesn't matter whether the function
call eliminated or not). Consider this:

class foo {
	public:
		foo(foo &);
		foo();
};

const foo &bar = foo();

Here, the compiler had to eliminate a function call to a function which doesn't
exist. So Compaq's compiler is wrong too: it's not a warning, but an error.
Although it's not a serious error :)



More information about the Gcc-bugs mailing list