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++/17045] New: conflict between function template and class with same name


The following code is rejected by GCC 3.4.1 :

  template <typename T> void f (T) {}

  template <typename T> void g () { f(T()); }

  namespace N
  {
    struct f {};
  }

  void h () { g<N::f>(); }

Error:

  t.cpp: In function `void g() [with T = N::f]':
  t.cpp:10:   instantiated from here
  t.cpp:7: error: `struct N::f' is not a function,
  t.cpp:1: error:   conflict with `template<class T> void f(T)'
  t.cpp:3: error:   in call to `f'

Comeau 4.3.3 accepts the code.

-- 
           Summary: conflict between function template and class with same
                    name
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gccbugs at contacts dot eelis dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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