This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12427] Compiler misses error, gets lost. big time


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]