public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60608] New: Template argument problem
@ 2014-03-21 11:19 volumedriverteam at cloudfounders dot com
  2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: volumedriverteam at cloudfounders dot com @ 2014-03-21 11:19 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-02 17:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
2014-07-13 20:35 ` paolo.carlini at oracle dot com
2014-07-13 21:05 ` paolo.carlini at oracle dot com
2014-07-14 10:31 ` paolo.carlini at oracle dot com
2014-07-14 15:52 ` paolo.carlini at oracle dot com
2015-04-22 12:00 ` jakub at gcc dot gnu.org
2015-07-16  9:16 ` rguenth at gcc dot gnu.org
2023-10-02 17:43 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).