This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12591] gcc accepts invalid code
- From: "hg211 at ural2 dot hszk dot bme dot hu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2003 13:53:52 -0000
- Subject: [Bug c++/12591] gcc accepts invalid code
- References: <20031012204520.12591.hg211@ural2.hszk.bme.hu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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 :)