Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Křištof Želechovski <giecrilj@stegny.2a.pl> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Re: overload resolution failed |
| Date | 2014-01-06 12:36 -0800 |
| Organization | GTS Energis |
| Message-ID | <lablbf$15pv$1@news2.ipartners.pl> (permalink) |
| References | <ktj02j$26pu$1@news2.ipartners.pl> <ktnulj$t9f$2@dont-email.me> |
Bart van Ingen Schenau wrote: > > On Mon, 05 Aug 2013 00:20:32 -0600, Krzysztof Żelechowski wrote: > >> Given the following declarations: >> >> int f (int *), f (int); >> >> what does the expression (f (01)) evaluate to? >> >> 1. It is an unqualified function call. >> >> 2. The name is looked up and the result is ::f. >> >> 3. The set of function declarations returned by the lookup depends on >> your interpretation. >> >> 3a. Under a strict interpretation, since the lookup finds a set of fully >> qualified function *names*, the set of function *declarations* returned >> is empty and the expression (f (01)) is ill-formed. > > This interpretation is incorrect. > The expression `f (01)` is parsed as a `/postfix-expression/ ( /optional- > expression-list/ )`, with the additional constraint that the postfix- > expression must be an lvalue referring to a function or have pointer to > function type. > The name lookup finds the name ::f, which perfect qualifies as an lvalue > referring to a function, because ::f was declared as being the name of a > function. > > In the following overload resolution, the set of overload declarations > for the found name(s) is built. But the Standard does not mention this step; it just says that the lookup returns the set of declarations, which is inconsistent with the description of the lookup. -- [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Previous in thread | Find similar
overload resolution failed Krzysztof Żelechowski <giecrilj@stegny.2a.pl> - 2013-08-05 00:20 -0600
Re: overload resolution failed Bart van Ingen Schenau <bart@ingen.ddns.info.invalid> - 2013-08-06 01:51 -0600
Re: overload resolution failed Křištof Želechovski <giecrilj@stegny.2a.pl> - 2014-01-06 12:36 -0800
csiph-web