Created on 1999-05-05.00:00:00 last changed 161 months ago
[Moved to DR at 10/01 meeting.]
Christophe de Dinechin: In 126.96.36.199 [expr.call] , paragraph 2 reads:
If no declaration of the called function is visible from the scope of the call the program is ill-formed.I think nothing there or in the previous paragraph indicates that this does not apply to calls through pointer or virtual calls.
Mike Miller: "The called function" is unfortunate phraseology; it makes it sound as if it's referring to the function actually called, as opposed to the identifier in the postfix expression. It's wrong with respect to Koenig lookup, too (the declaration need not be visible if it can be found in a class or namespace associated with one or more of the arguments).
In fact, this paragraph should be a note. There's a general rule that says you have to find an unambiguous declaration of any name that is used (6.5 [basic.lookup] paragraph 1); the only reason this paragraph is here is to contrast with C's implicit declaration of called functions.
Proposed resolution:Change section 188.8.131.52 [expr.call] paragraph 2 from:
If no declaration of the called function is visible from the scope of the call the program is ill-formed.to:
[Note: if a function or member function name is used, and name lookup (6.5 [basic.lookup]) does not find a declaration of that name, the program is ill-formed. No function is implicitly declared by such a call. ]
(See also issue 218.)
|2008-10-05 00:00:00||admin||set||status: wp -> cd1|
|2003-04-25 00:00:00||admin||set||status: dr -> wp|
|2002-05-10 00:00:00||admin||set||messages: + msg666|
|2001-11-09 00:00:00||admin||set||status: ready -> dr|
|2001-05-20 00:00:00||admin||set||status: review -> ready|
|2000-05-21 00:00:00||admin||set||status: drafting -> review|
|2000-02-23 00:00:00||admin||set||status: open -> drafting|