Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #12766

Re: bug in gcc?

From Rui Maciel <rui.maciel@gmail.com>
Newsgroups comp.lang.c++
Subject Re: bug in gcc?
Date 2011-12-23 14:14 +0000
Organization Aioe.org NNTP Server
Message-ID <jd22bp$t0s$1@speranza.aioe.org> (permalink)
References <d304891e-05dc-44f1-9df0-19ada4117dbb@g41g2000yqa.googlegroups.com> <jd1olu$1ge$1@dont-email.me> <87ipl7flda.fsf@gmail.com>

Show all headers | View raw


Marco Minutoli wrote:

> To me this looks like the problematic code :).
> 
> When we have the template function named bar the line:
> int y = x.foo<1>(0);
> 
> is interpreted as:
> int y = (x.foo<1)>(0);
> 
> What is not clear to me is why naming foo the template function change
> this behavior.

Probably it's an implicit template instantiation thing.  If the definition 
of class T is unavailable and the template function invokes x.foo<1>(0), 
then maybe it is assumed that class T has a template member function whose 
identifier is foo, instead of the code representing a convoluted set of 
comparissons between ints.


Rui Maciel

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

bug in gcc? Timon Gehr <timon.gehr@gmail.com> - 2011-12-23 03:04 -0800
  Re: bug in gcc? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-12-23 12:28 +0100
    Re: bug in gcc? Timon Gehr <timon.gehr@gmail.com> - 2011-12-23 04:33 -0800
    Re: bug in gcc? Rui Maciel <rui.maciel@gmail.com> - 2011-12-23 13:21 +0000
      Re: bug in gcc? Timon Gehr <timon.gehr@gmail.com> - 2011-12-23 05:36 -0800
    Re: bug in gcc? Marco Minutoli <mminutoli@gmail.com> - 2011-12-23 14:50 +0100
      Re: bug in gcc? Rui Maciel <rui.maciel@gmail.com> - 2011-12-23 14:14 +0000
        Re: bug in gcc? Timon Gehr <timon.gehr@gmail.com> - 2011-12-23 06:30 -0800
  Re: bug in gcc? jacob navia <jacob@spamsink.net> - 2011-12-23 14:43 +0100
  Re: bug in gcc? Johannes Schaub <schaub.johannes@googlemail.com> - 2011-12-24 17:22 +0100
    Re: bug in gcc? Miles Bader <miles@gnu.org> - 2011-12-25 11:36 +0900

csiph-web