This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60608] New: Template argument problem


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]