public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17045] New: conflict between function template and class with same name
@ 2004-08-16  3:08 gccbugs at contacts dot eelis dot net
  2004-08-16  3:40 ` [Bug c++/17045] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: gccbugs at contacts dot eelis dot net @ 2004-08-16  3:08 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <bug-17045-5473@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2006-09-19  4:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16  3:08 [Bug c++/17045] New: conflict between function template and class with same name gccbugs at contacts dot eelis dot net
2004-08-16  3:40 ` [Bug c++/17045] " pinskia at gcc dot gnu dot org
2004-08-16  4:12 ` gccbugs at contacts dot eelis dot net
2004-08-16 14:53 ` bangerth at dealii dot org
2004-12-21 13:15 ` redi at gcc dot gnu dot org
     [not found] <bug-17045-5473@http.gcc.gnu.org/bugzilla/>
2006-09-19  4:15 ` 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).