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

Re: c++/795


Martin Sebor wrote:

> The distinction (which isn't made in 14.2 but which the note in CWG issue 30
> clarifies) is between what's on the left of ., ->, and :: and what's on the
> right. If the lhs of the operator depends on a template parameter, the keyword
> template is required. If the lhs doesn't depend on a template parameter, the
> keyword is optional.
Ah, I get it, I was having a thinko about `scope'.

> In the testcase, though, even if the error were appropriate (which I'm convinced
> it's not), there would be a problem with the compiler accepting the first
> construct. So no matter how you look at it, there's a problem.

>         A().foo<T>();    // okay
>         a[0].foo<T>();   // error? NOT!
ouch!

I'll retag the bug report - thanks!

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
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]