public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/15664] Linker fails to find (inline) function
Date: Thu, 27 May 2004 13:50:00 -0000	[thread overview]
Message-ID: <20040526205642.6890.qmail@sourceware.org> (raw)
In-Reply-To: <20040526185537.15664.igodard@pacbell.net>


------- Additional Comments From bangerth at dealii dot org  2004-05-26 20:56 -------
Alright, that's better. I think this actually shows a gcc bug: 
------------------ 
template <int N> struct S { 
    template<template<typename> class A> 
    friend void foo(); 
}; 
 
template<template<typename> class A> 
void foo(); 
 
template <typename> struct X {}; 
 
int main () { 
  S<1> s; 
  foo<X>(); 
} 
------------------- 
The friend declaration should inject the name into the global namespace, 
and it should be identified with the other declaration. However, we get 
this: 
 
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc 
x.cc: In function `int main()': 
x.cc:13: error: call of overloaded `foo()' is ambiguous 
x.cc:7: error: candidates are: void foo() [with A = X] 
x.cc:3: error:                 void foo() [with A = X, int N = 1] 
 
(Note also that the last line is pretty bad, since it lists the 
template argument to the enclosing class, which, however, isn't 
specified at all in the rest of the line.) Interestingly enough, 
the error goes away if  
a) S is made a non-template 
b) foo takes as template argument not a template template parameter, 
   but a regular type or value 
 
May someone else try to figure out from this what's going wrong. 
 
This bug is on all versions of gcc. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |2.95.3 3.3.4 3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-26 20:56:41
               date|                            |


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


  parent reply	other threads:[~2004-05-26 20:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27 11:39 [Bug c++/15664] New: " igodard at pacbell dot net
2004-05-27 11:41 ` [Bug c++/15664] " igodard at pacbell dot net
2004-05-27 11:44 ` igodard at pacbell dot net
2004-05-27 11:44 ` igodard at pacbell dot net
2004-05-27 11:47 ` bangerth at dealii dot org
2004-05-27 12:12 ` igodard at pacbell dot net
2004-05-27 13:05 ` igodard at pacbell dot net
2004-05-27 13:17 ` igodard at pacbell dot net
2004-05-27 13:50 ` bangerth at dealii dot org [this message]
2004-05-27 18:48 ` [Bug c++/15664] Template friend injection fails giovannibajo at libero dot it
2004-08-12  0:57 ` pinskia at gcc dot gnu dot org
2004-11-11 12:44 ` lerdsuwa at gcc dot gnu dot org
2004-11-12 16:58 ` lerdsuwa at gcc dot gnu dot org
2004-12-02 12:01 ` cvs-commit at gcc dot gnu dot org
2004-12-02 12:02 ` lerdsuwa at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040526205642.6890.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).