public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56760] namespaces, templates and forwarding declarations.
Date: Thu, 28 Mar 2013 11:05:00 -0000 [thread overview]
Message-ID: <bug-56760-4-btE881UvM4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56760-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56760
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-28 11:05:26 UTC ---
(In reply to comment #8)
> I read the section on name lookup changes at
> http://gcc.gnu.org/gcc-4.7/porting_to.html
>
> but it talks about a different kind of problem. Consider that there the
> compiler does error messages. But here at our problem the linker (!) does the
> error.
It's the same problem. You get a linker error because this line:
func(containHolder, b); // COMMENT THIS OUT AND IT WORKS
calls this function:
template<class T> void func(const seco::contain<T> &a, nam::binbuffer &b)
{ func(*a.wombat, b); }
which then calls this function:
template<class T> void func (const T &a, nam::binbuffer &b);
which is not defined. So you get a linker error.
You are expecting it to call this function:
template<class T> void func(const seco::holder<T> &a, nam::binbuffer &b)
{ func(*a.fun, b); }
but it cannot, because that is not declared before it is used. This is the
situation described in the name lookup changes.
Your code is not valid C++, the compiler is correct.
next prev parent reply other threads:[~2013-03-28 11:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 7:00 [Bug c++/56760] New: " erik.thiele@thiele-hydraulik.de
2013-03-28 7:01 ` [Bug c++/56760] " erik.thiele@thiele-hydraulik.de
2013-03-28 7:05 ` erik.thiele@thiele-hydraulik.de
2013-03-28 7:14 ` pinskia at gcc dot gnu.org
2013-03-28 7:58 ` erik.thiele@thiele-hydraulik.de
2013-03-28 8:22 ` erik.thiele@thiele-hydraulik.de
2013-03-28 8:27 ` erik.thiele@thiele-hydraulik.de
2013-03-28 9:16 ` redi at gcc dot gnu.org
2013-03-28 9:55 ` erik.thiele@thiele-hydraulik.de
2013-03-28 11:05 ` redi at gcc dot gnu.org [this message]
2013-03-28 16:50 ` erik.thiele@thiele-hydraulik.de
2013-03-28 17:19 ` redi at gcc dot gnu.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=bug-56760-4-btE881UvM4@http.gcc.gnu.org/bugzilla/ \
--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).