This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12427] Compiler misses error, gets lost. big time
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2003 10:21:43 -0000
- Subject: [Bug c++/12427] Compiler misses error, gets lost. big time
- References: <20030926221928.12427.igodard@pacbell.net>
- 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=12427
------- Additional Comments From gdr at integrable-solutions dot net 2003-09-27 10:21 -------
Subject: Re: Compiler misses error, gets lost. big time
"igodard at pacbell dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| Not the way I read it.
but you reading is wrong :-)
| Inc() and Dec() are the implicit null
| constructors of *class* Inc and Dec respectively, not function
| pointers. The function would be called Inc(*)() as you point out.
|
| Hence Inc() and Dec() are temporary objects, not types. The syntax
| "type id(object1, object2)" can't be a function declaration, because
| that would require "type1 id(type2, type3)". Consequently it has to
| be a declaration of id as a type1 object with a constructor taking
| object1 and object2. But there is no such constructor, so there
| should have been an error.
This is an FAQ. Have a look at
http://www.gotw.ca/gotw/075.htm
-- Gaby