@@ -597,6 +597,7 @@ TEST(FunctionReflectionTest, BestTemplateFunctionMatch) {
597597 template<class A> long get_size(A&);
598598 template<class A> long get_size();
599599 template<class A, class B> long get_size(A a, B b);
600+ template<class A> long add_size(float a);
600601 };
601602
602603 template<class A>
@@ -609,6 +610,11 @@ TEST(FunctionReflectionTest, BestTemplateFunctionMatch) {
609610 return sizeof(A) + 1;
610611 }
611612
613+ template<class A>
614+ long MyTemplatedMethodClass::add_size(float a) {
615+ return sizeof(A) + long(a);
616+ }
617+
612618 template<class A, class B>
613619 long MyTemplatedMethodClass::get_size(A a, B b) {
614620 return sizeof(A) + sizeof(B);
@@ -626,21 +632,24 @@ TEST(FunctionReflectionTest, BestTemplateFunctionMatch) {
626632 std::vector<Cpp::TemplateArgInfo> args0;
627633 std::vector<Cpp::TemplateArgInfo> args1 = {C.IntTy .getAsOpaquePtr ()};
628634 std::vector<Cpp::TemplateArgInfo> args2 = {C.CharTy .getAsOpaquePtr (), C.FloatTy .getAsOpaquePtr ()};
635+ std::vector<Cpp::TemplateArgInfo> args3 = {C.FloatTy .getAsOpaquePtr ()};
629636
630637 std::vector<Cpp::TemplateArgInfo> explicit_args0;
631638 std::vector<Cpp::TemplateArgInfo> explicit_args1 = {C.IntTy .getAsOpaquePtr ()};
632-
633639
634640 Cpp::TCppFunction_t func1 = Cpp::BestTemplateFunctionMatch (candidates, explicit_args0, args1);
635641 Cpp::TCppFunction_t func2 = Cpp::BestTemplateFunctionMatch (candidates, explicit_args1, args0);
636642 Cpp::TCppFunction_t func3 = Cpp::BestTemplateFunctionMatch (candidates, explicit_args0, args2);
643+ Cpp::TCppFunction_t func4 = Cpp::BestTemplateFunctionMatch (candidates, explicit_args1, args3);
637644
638645 EXPECT_EQ (Cpp::GetFunctionSignature (func1),
639646 " template<> long MyTemplatedMethodClass::get_size<int>(int &)" );
640647 EXPECT_EQ (Cpp::GetFunctionSignature (func2),
641648 " template<> long MyTemplatedMethodClass::get_size<int>()" );
642649 EXPECT_EQ (Cpp::GetFunctionSignature (func3),
643650 " template<> long MyTemplatedMethodClass::get_size<char, float>(char a, float b)" );
651+ EXPECT_EQ (Cpp::GetFunctionSignature (func4),
652+ " template<> long MyTemplatedMethodClass::get_size<float>(float &)" );
644653}
645654
646655TEST (FunctionReflectionTest, IsPublicMethod) {
0 commit comments