------- Comment #3 from widman at gimpel dot com 2006-03-30 23:31 ------- Subject: Re: Error diagnostic not issued for unacceptable result of lookup for a name used in a nested-name-specifier
On Mar 30, 2006, at 4:06 PM, widman at gimpel dot com wrote: > <snip> > So when I read that excerpt of 3.4.3/1, I thought to myself: > > "During the lookup for a name preceding the :: scope resolution > operator, ordinary names are ignored, except that typedef names and > namespace names are considered." > > ... with the implication being that tag names (including the names of > classes, unions, and enumerations) are considered without exception. What was the intention in 3.4.3p1? Presumably it's to prevent lookup from finding names that don't refer to namespaces or classes. If that's the case then we probably want a change in wording here -- maybe something like: During the lookup for a name preceding the :: scope resolution operator, only the following kinds of names are considered: - class-names, - class template names (when used to form a template-id), - namespace names, and - typedef names All other names are ignored. If the name found does not designate: - a class, - a dependent type that could possibly refer to a class during instantiation, or - a namespace, then the program is ill-formed. If the name designates a dependent type, no diagnostic is required. (See also http://www.open-std.org/jtc1/sc22/wg21/docs/ cwg_active.html, item 215) James Widman -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26950