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: C++ parser issue [templ.res]


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



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