http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50013
Summary: Internal compiler error: Error reporting routines
re-entered using decltype
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: fabian.bergm...@gmail.com
namespace functor
{
template
class Functor
{
public:
virtual ret exec(fparam,param...) = 0;
};
template
class Functor
{
public:
virtual ret exec(void) = 0;
};
template
class Function : public Functor
{
public:
Function(ret(type::*f)(fparam,param...),type* t) : obj(t), func(f)
{
}
virtual ret exec(fparam fp,param... p)
{
return (obj->*func)(fp, p...);
}
protected:
type* obj;
ret(type::*func)(fparam,param...);
};
template
class Function : public Functor
{
public:
template
class Default;
public:
Function(ret(type::*f)(void), type* t) : obj(t), func(f)
{
}
virtual ret exec()
{
return (obj->*func)();
}
protected:
type* obj;
ret(type::*func)(void);
};
template
template
class Function::Default : public Functor, public Function
{
public:
Default(decltype(Function::func) f, type* t,
fdefault fd) : Function(f, t), save(fd)
{
}
virtual ret exec()
{
return (obj->*func)(save);
}
protected:
fdefault save;
};
}
class Test
{
public:
void test(int) {};
};
int main()
{
Test test;
functor::Function::Default(&Test::test, &test, 10);
}
fabian@ubuntu:~$ g++ test.cpp -o test -std=c++0x
test.cpp: In instantiation of ‘functor::Function::Default’:
test.cpp:83:72: instantiated from here
test.cpp:32:36: error: ‘void (Test::* functor::Function::func)(int)’ is protected
test.cpp:60:4: error: within this context
test.cpp:32:36: error: ‘void (Test::* functor::Function::func)(int)’ is protected
test.cpp:60:58: error: within this context
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
If someone could explain if test.cpp:60 really is an error and if so, how to do
it instead, I would be very grateful.