This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11808] New: Wrong namespace lookup for template function when induced by a template parameter


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]