public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2437: template name binding problem
@ 2001-08-12 9:40 lerdsuwa
0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2001-08-12 9:40 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, kenny.simpson, nobody
Synopsis: template name binding problem
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Aug 12 09:40:39 2001
State-Changed-Why:
Confirm as a bug. Two-phase name binding is not yet
properly implemented.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2437&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
* c++/2437: template name binding problem
@ 2001-03-30 7:56 kenny.simpson
0 siblings, 0 replies; 2+ messages in thread
From: kenny.simpson @ 2001-03-30 7:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 2437
>Category: c++
>Synopsis: template name binding problem
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Mar 30 07:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Kenny Simpson
>Release: gcc version 3.0 20010327 (prerelease)
>Organization:
>Environment:
online compiler 2001-03-30
>Description:
Names that do not depend on a template arguments should be bound at the point of definition, however, gcc seems to be binding names at a later time.
This is a modified example from Stroustrup C.13.8:
>How-To-Repeat:
Compile this -O3 to assembly, observe that "g(int)" is emmitted, not "g(double)".
inline void g(double) { __asm(" g(double) ");}
template <class T> struct X
{
void f() { g(2);} // should call g(double)
};
inline void g(int) { __asm(" g(int) ");}
int main()
{
X<int>().f(); // should call g(double), but calls g(int)
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-12 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-12 9:40 c++/2437: template name binding problem lerdsuwa
-- strict thread matches above, loose matches on Subject: below --
2001-03-30 7:56 kenny.simpson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).