This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dependent names in template
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 05 Aug 2004 16:53:25 -0700
- Subject: Re: Dependent names in template
- Organization: CodeSourcery, LLC
- References: <20040805142023.GA28254@compsoc.man.ac.uk>
Jonathan Wakely wrote:
Hi,
I've been testing some template code I've written and have found that
although it compiles fine with G++ 3.4 it fails with Comeau's online
compiler. I get an error due to a dependent name not being found during
the first phase of template lookup. In this case my understanding is that
the name lookup should have been delayed until the second-phase since it
is a function call with an argument that is (I believe) a dependent name.
Yes.
I've simplified the code to that below. The lines in question are marked
ERROR.
The Stream ctor only compiles when std::basic_ios::init() is accessed
through the "this" pointer. Since buf_ is a dependent name, shouldn't
init(&buf_) be treated as dependent also?
Yes.
Similarly for the call to sputc(c), int_type is dependent, so aren't c
and therefore sputc also dependent ?
Yes.
Is G++ wrong here? If so is there a bugzilla report already? (I couldn't
find one) Is correcting these tiny corner-cases in G++'s now excellent
parsing on the radar yet?
I do not think these are bugs in G++ -- although I've been wrong before.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com