This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22363] Problems with friend function injection and destructor
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2005 05:12:05 -0000
- Subject: [Bug c++/22363] Problems with friend function injection and destructor
- References: <20050708110943.22363.cxl@ntllib.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-30 05:12 -------
For the testcase in comment #2, on the mainline, we get a different error message:
t.cc:2: warning: friend declaration ?void foo(T*)? declares a non-template function
t.cc:2: warning: (if this is not what you intended, make sure the function template has already been
declared and add <> after the function name here) -Wno-non-template-friend disables this warning
t.cc: In function ?void bar() [with T = X<int>]?:
t.cc:10: instantiated from ?X<T>::X() [with T = X<int>]?
t.cc:13: instantiated from here
t.cc:5: error: ?foo? was not declared in this scope
This seems better as friend don't intject the declation at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22363