This is the mail archive of the gcc@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]

Re: Dependent names in template


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


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