This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30431] New: failure to check for visible declaration of friend function to template class
- From: "tkapela at poczta dot fm" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jan 2007 23:46:14 -0000
- Subject: [Bug c++/30431] New: failure to check for visible declaration of friend function to template class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
/ There should be no difference where friend declaration is made
// inside class. But in fact at least under GCC 4.1.1 there is.
template <typename T>
class CTest;
template <typename T>
T foo(const CTest<T> &test)
{
return test.m_data;
}
template <typename T>
class CTest{
public:
// In this place we can declare friend function foo
//friend T foo<>(const CTest &test);
T foo()
{ return m_data;}
// But in that place we can not declare friend function foo
friend T foo<>(const CTest &test);
private:
T m_data;
};
int main()
{
return 0;
}
--
Summary: failure to check for visible declaration of friend
function to template class
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkapela at poczta dot fm
GCC target triplet: Linux Mandriva 2007
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30431