aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDeclObjC.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 5e9e2b21e2..308c125d9a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1227,9 +1227,14 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration(
// FIXME: arg->AttrList must be stored too!
QualType argType;
- if (ArgTypes[i])
+ if (ArgTypes[i]) {
argType = QualType::getFromOpaquePtr(ArgTypes[i]);
- else
+ // Perform the default array/function conversions (C99 6.7.5.3p[7,8]).
+ if (argType->isArrayType()) // (char *[]) -> (char **)
+ argType = Context.getArrayDecayedType(argType);
+ else if (argType->isFunctionType())
+ argType = Context.getPointerType(argType);
+ } else
argType = Context.getObjCIdType();
ParmVarDecl* Param = ParmVarDecl::Create(Context, ObjCMethod,
SourceLocation(/*FIXME*/),