This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ parser issue [templ.res]
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: jan at etpmod dot phys dot tue dot nl
- Cc: gcc at gnu dot org
- Date: Tue, 28 Jan 2003 10:01:02 +0000
- Subject: Re: C++ parser issue [templ.res]
- Organization: Codesourcery LLC
- References: <200301281703.00210.janvandijkinjapan@yahoo.co.jp>
Jan Van Dijk wrote:
refer to 14.6/8 in your example both i and f are non-dependent names
so the usual lookup rules apply. 3.4.1, 3.4.2. 3.4.1 deals with
non-function call unqualified name lookup (i), and 3.4.2 deals with
unqualified names used for function calls. That uncludes koenig
lookup. In this case there are no template-dependent arguments, so
the koenig lookup should be resolved at parse time. (see example
in 14.6/9)
template <class T>
struct B
{
int i;
int f();
};
template <class T>
struct D : public B<T>
{
void good(){ f(); } // no B<T>:: required
If you said &f;, you'd get the same error. I think this is a bug,
please file a bug report.
void bad(){ i=0; } // does not compile with `head',
void ugly(){ B<T>::i=0; } // ... this does.
};
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org