This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37971] New: [4.3/4.4 Regression] Rejects default argument that is a template
- 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: 31 Oct 2008 00:05:40 -0000
- Subject: [Bug c++/37971] New: [4.3/4.4 Regression] Rejects default argument that is a template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take:
struct foo
{
private:
template<typename U>
static bool func(const U& x) {}
static bool func1(const int& x) {}
public:
unsigned int Find(const int& x, bool (*pFunc) (const int&) = func) const {}
unsigned int Find1(const int& x, bool (*pFunc) (const int&) = func1) const {}
};
foo b;
void f(void)
{
b.Find1(1);
b.Find(1);
}
--- CUT ---
Only the call to Find is rejected with the following error message:
t.cc: In function ?void f()?:
t.cc:5: error: ?static bool foo::func(const U&) [with U = int]? is private
t.cc:16: error: within this context
This is wrong as func is not private in the default argument.
--
Summary: [4.3/4.4 Regression] Rejects default argument that is a
template
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37971