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]

Dependent names in template


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.

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?

Similarly for the call to sputc(c), int_type is dependent, so aren't c
and therefore sputc also dependent ?

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?

Thanks for your help understanding this,

jon


Attachment: depname.cc
Description: Text document


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