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
  2006-09-18 17:28 ` [Bug c++/29131] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ 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] 14+ messages in thread

end of thread, other threads:[~2010-07-29 15:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
2006-09-18 17:28 ` [Bug c++/29131] " pinskia at gcc dot gnu dot org
2006-09-19  3:47 ` pinskia at gcc dot gnu dot org
2006-09-19  3:49 ` pinskia at gcc dot gnu dot org
2006-09-19  3:51 ` pinskia at gcc dot gnu dot org
2006-09-19  4:06 ` pinskia at gcc dot gnu dot org
2006-09-19  4:30 ` [Bug c++/29131] [DR 225] " pinskia at gcc dot gnu dot org
2009-12-05  0:13 ` pinskia at gcc dot gnu dot org
2009-12-08 22:03 ` pinskia at gcc dot gnu dot org
2010-02-05 12:52 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to foundemtal types namespace for ADL paolo dot carlini at oracle dot com
2010-03-04 20:28 ` pinskia at gcc dot gnu dot org
2010-03-24 16:45 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental " 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).