This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60608] New: Template argument problem
- From: "volumedriverteam at cloudfounders dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Mar 2014 11:19:07 +0000
- Subject: [Bug c++/60608] New: Template argument problem
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Bug ID: 60608
Summary: Template argument problem
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: volumedriverteam at cloudfounders dot com
#include <functional>
template<typename... Args>
void
wrapper(void (*f)(Args...),
Args... args)
{
f(std::forward<Args...>(args...));
}
void
myfun(int)
{}
void
myfun2(const int)
{}
void
test()
{
int a = 0;
wrapper<int>(myfun, a);
wrapper(myfun, a);
wrapper<int>(myfun2, a);
const int b = 0;
wrapper(myfun2, b);
wrapper<const int>(myfun2, b);
}
It's not clear why the last line doesn't compile. It doesn't give any problem
on clang. The compiler seems to get the type of myfun2 wrong.