This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dependent names in template
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Michael Veksler <VEKSLER at il dot ibm dot com>
- Cc: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>, gcc at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: 08 Aug 2004 10:44:51 +0200
- Subject: Re: Dependent names in template
- Organization: Integrable Solutions
- References: <OF167C7958.51B0DD33-ONC2256EEA.0020C445-C2256EEA.002262D7@il.ibm.com>
Sorry for the late jump-in.
Executive summary: como is right and GCC is wrong.
Michael Veksler <VEKSLER@il.ibm.com> writes:
| Mark, I think that you are wrong (based on a previous thread),
| and it's a bug in gcc.
|
| Take a look at
| http://gcc.gnu.org/ml/gcc/2004-04/msg00691.html
|
| According to Gaby (Gabriel Dos Reis), if my interpretation is correct,
| builtin types behave differently. I don't quite understand everything
| that Gaby said, so I'll just paste it:
| > However, because double is
| > a builtin type, the set its associated namespaces and classes is
| > empty. Therefore, the call fails for "no matching" function.
|
| It seems to apply to this case as well (int_type happens to be builtin).
The case of the April discussion is slightly different, but the basic
rules apply here too. In the April discussion, the functions F() were
non-member so only non-member lookup could be considered and eventual
ADL fails for the reason you recall above.
In Jonathan's case we have a little complication (but no much), as the
functions are members and there is a question of whether, at
instantiation time, the second phase lookup should consider the base
class scopes. The answer is NO.
14.6.2/3:
In the definition of a class template or a member of a class
template, if a base class of the class template depends on a
template-parameter, the base class scope is not examined during
unqualified name lookup either at the point of definition of the
class template or member or during an instantiation of the class
template or member.
Since unqualified name lookup cannot look into the base classes (at
intanstiation time), the only remaining option is argument dependent
lookup, which should fail for the same reason as in the April
discussion.
In short, we have yet another lookup bug in GCC -- GCC is looking into
dependent base classes at instantiation time.
-- Gaby