public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11808] New: Wrong namespace lookup for template function when induced by a template parameter
@ 2003-08-05 15:56 gcc-bugzilla at gcc dot gnu dot org
  2003-08-05 17:25 ` [Bug c++/11808] [3.4 Regression] " pinskia at physics dot uc dot edu
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-08-05 15:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Wrong namespace lookup for template function when
                    induced by a template parameter
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nicolas dot burrus at lrde dot epita dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


This is a refinement of PR c++/11744 which was fixed the
2003-08-01. The bug is still present when the function call is
actually a call to a function template:

namespace nsp_foo {

  struct A {};

  struct foo {};

}

namespace nsp_bar {

  template <class T> // PR 11744 fixed the case where foo took
  void foo(T) {}     // a nsp_foo::A parameter.

  template <class T>
  void bar(T t)
  {
    nsp_bar::foo(t);
  }

}

int main()
{
  nsp_bar::bar(nsp_foo::A());
}

Here is g++-3.4 output:

namespaces.cc: In function `void nsp_bar::bar(T) [with T = nsp_foo::A]':
namespaces.cc:24:   instantiated from here
namespaces.cc:5: error: `struct nsp_foo::foo' is not a function,
namespaces.cc:12: error:   conflict with `template<class T> void
   nsp_bar::foo(T)'
namespaces.cc:17: error:   in call to `foo'

g++-3.3 and above, como and icc accepts this code.

Environment:
System: Linux meissa 2.4.21 #1 Sat Jul 26 02:06:42 CEST 2003 i686 GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/nes/work/lrde/ext/gcc/configure --prefix=/opt/gcc-3.4 --enable-languages=c,c++ : (reconfigured)

How-To-Repeat:
Compile the given code.


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

end of thread, other threads:[~2003-09-03  5:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-05 15:56 [Bug c++/11808] New: Wrong namespace lookup for template function when induced by a template parameter gcc-bugzilla at gcc dot gnu dot org
2003-08-05 17:25 ` [Bug c++/11808] [3.4 Regression] " pinskia at physics dot uc dot edu
2003-08-05 18:21 ` [Bug c++/11808] [3.4 regression] " bangerth at dealii dot org
2003-08-06  0:09 ` janis187 at us dot ibm dot com
2003-08-06 14:39 ` bangerth at dealii dot org
2003-08-07 13:22 ` bangerth at dealii dot org
2003-08-17 17:38 ` bangerth at dealii dot org
2003-08-18 21:32 ` bangerth at dealii dot org
2003-09-02 17:32 ` cvs-commit at gcc dot gnu dot org
2003-09-02 17:33 ` mmitchel at gcc dot gnu dot org
2003-09-03  5:42 ` 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).