public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29131]  New: Bad name lookup for templates
@ 2006-09-18 16:39 andrew dot stubbs at st dot com
  2010-03-24 16:45 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: andrew dot stubbs at st dot com @ 2006-09-18 16:39 UTC (permalink / raw)
  To: gcc-bugs

The following C++ code should not compile:

template<class T>
int t(T i)
{
  return f (i);  // error: f not visible here
}

int
f (int i)
{
  return i;
}

int
main()
{
  return t(1);
}

The C++ standard clause 14.6.3 states that names should be looked up from the
point they are used. I.e. functions defined after that point are not visible.
This is true for regular functions, but GCC does not get this right for
template functions.


-- 
           Summary: Bad name lookup for templates
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-04-26 21:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29131-4@http.gcc.gnu.org/bugzilla/>
2010-10-18 20:28 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL pinskia at gcc dot gnu.org
2011-05-05  0:59 ` redi at gcc dot gnu.org
2011-05-20 16:42 ` jason at gcc dot gnu.org
2011-05-20 16:58 ` jason at gcc dot gnu.org
2011-05-20 18:36 ` jason at gcc dot gnu.org
2011-05-20 19:24 ` jason at gcc dot gnu.org
2011-09-26 17:40 ` jason at gcc dot gnu.org
2012-04-25 17:34 ` nplatis at freemail dot gr
2012-04-26 14:10 ` jason at gcc dot gnu.org
2012-04-26 14:35 ` nplatis at freemail dot gr
2012-04-26 15:54 ` jason at gcc dot gnu.org
2012-04-26 19:16 ` marc.glisse at normalesup dot org
2012-04-26 21:05 ` nplatis at freemail dot gr
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
2010-03-24 16:45 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL pinskia at gcc dot gnu dot org
2010-03-29 20:53 ` pinskia at gcc dot gnu dot org
2010-07-29 15:20 ` pinskia at gcc dot gnu dot org

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).