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: unassig...@gcc.gnu.org

        ReportedBy: schaub.johan...@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.

Reply via email to