public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56190] New: GCC fails deducing a "void(*)(int, float, double)" to a "void(*)(T..., float, double)" with T={int}
@ 2013-02-03 13:57 schaub.johannes at googlemail dot com
  2021-07-27  7:06 ` [Bug c++/56190] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: schaub.johannes at googlemail dot com @ 2013-02-03 13:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56190

             Bug #: 56190
           Summary: GCC fails deducing a "void(*)(int, float, double)" to
                    a "void(*)(T..., float, double)" with T={int}
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


From
http://stackoverflow.com/questions/14664589/variadic-template-code-compiles-on-gcc-4-6-but-not-on-clang-or-gcc-4-7
:

class Test {
    public:
    template <class... A2> void print (void(*function)(A2..., float, double)) {

    }
};

void test_print (int a, float b, double c) { }

int main () {
    Test test;
    test.print<int> (&test_print);
}

Fails with

source.cpp:14:33: note: candidate is:
source.cpp:3:33: note: template<class ... A2> void Test::print(void (*)(A2 ...,
float, double))
source.cpp:3:33: note:   template argument deduction/substitution failed:
source.cpp:14:33: note:   mismatched types 'float' and 'int'

GCC does apparently not substitute the explicitly specified arguments of "A2"
before attempting the argument deduction.


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

end of thread, other threads:[~2022-05-31 23:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-03 13:57 [Bug c++/56190] New: GCC fails deducing a "void(*)(int, float, double)" to a "void(*)(T..., float, double)" with T={int} schaub.johannes at googlemail dot com
2021-07-27  7:06 ` [Bug c++/56190] " pinskia at gcc dot gnu.org
2021-07-27  7:06 ` pinskia at gcc dot gnu.org
2021-08-10  3:02 ` pinskia at gcc dot gnu.org
2022-02-24 10:26 ` pinskia at gcc dot gnu.org
2022-05-31 23:30 ` pinskia at gcc dot gnu.org
2022-05-31 23:32 ` 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).