[cfe-commits] r73077 - in /cfe/trunk: lib/Sema/SemaTemplateDeduction.cpp test/SemaTemplate/temp_class_spec.cpp
Anders Carlsson
andersca at mac.com
Mon Jun 8 12:22:24 PDT 2009
Author: andersca
Date: Mon Jun 8 14:22:23 2009
New Revision: 73077
URL: http://llvm.org/viewvc/llvm-project?rev=73077&view=rev
Log:
Address comments from Doug.
Modified:
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
cfe/trunk/test/SemaTemplate/temp_class_spec.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=73077&r1=73076&r2=73077&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Mon Jun 8 14:22:23 2009
@@ -276,7 +276,17 @@
const FunctionProtoType *FunctionProtoParam =
cast<FunctionProtoType>(Param);
+
+ if (FunctionProtoParam->getTypeQuals() !=
+ FunctionProtoArg->getTypeQuals())
+ return false;
+
+ if (FunctionProtoParam->getNumArgs() != FunctionProtoArg->getNumArgs())
+ return false;
+ if (FunctionProtoParam->isVariadic() != FunctionProtoArg->isVariadic())
+ return false;
+
// Check return types.
if (!DeduceTemplateArguments(Context,
FunctionProtoParam->getResultType(),
@@ -284,9 +294,6 @@
Deduced))
return false;
- if (FunctionProtoParam->getNumArgs() != FunctionProtoArg->getNumArgs())
- return false;
-
for (unsigned I = 0, N = FunctionProtoParam->getNumArgs(); I != N; ++I) {
// Check argument types.
if (!DeduceTemplateArguments(Context,
Modified: cfe/trunk/test/SemaTemplate/temp_class_spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/temp_class_spec.cpp?rev=73077&r1=73076&r2=73077&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/temp_class_spec.cpp (original)
+++ cfe/trunk/test/SemaTemplate/temp_class_spec.cpp Mon Jun 8 14:22:23 2009
@@ -134,6 +134,8 @@
int is_unary_function7[is_unary_function_with_same_return_type_as_argument_type<int (*)(int, bool)>::value ? -1 : 1];
int is_unary_function8[is_unary_function_with_same_return_type_as_argument_type<int (*)(bool)>::value ? -1 : 1];
int is_unary_function9[is_unary_function_with_same_return_type_as_argument_type<int (*)(int)>::value ? 1 : -1];
+int is_unary_function10[is_unary_function_with_same_return_type_as_argument_type<int (*)(int, ...)>::value ? -1 : 1];
+int is_unary_function11[is_unary_function_with_same_return_type_as_argument_type<int (* const)(int)>::value ? -1 : 1];
template<typename T>
struct is_binary_function {
More information about the cfe-commits
mailing list