if (D.getInvalidType())
New->setInvalidDecl();
- // Parameter declarators cannot be qualified (C++ [dcl.meaning]p1).
- if (D.getCXXScopeSpec().isSet()) {
- Diag(D.getIdentifierLoc(), diag::err_qualified_param_declarator)
- << D.getCXXScopeSpec().getRange();
- New->setInvalidDecl();
- }
// Parameter declarators cannot be interface types. All ObjC objects are
// passed by reference.
if (T->isObjCInterfaceType()) {
diag::err_object_cannot_be_passed_returned_by_value) << 1 << T;
New->setInvalidDecl();
}
+
+ // Parameter declarators cannot be qualified (C++ [dcl.meaning]p1).
+ if (D.getCXXScopeSpec().isSet()) {
+ Diag(D.getIdentifierLoc(), diag::err_qualified_param_declarator)
+ << D.getCXXScopeSpec().getRange();
+ New->setInvalidDecl();
+ }
// Add the parameter declaration into this scope.
S->AddDecl(DeclPtrTy::make(New));
bool isVariadic) {
Decl *ClassDecl = classDecl.getAs<Decl>();
- // FIXME: Param attributes.
-
// Make sure we can establish a context for the method.
if (!ClassDecl) {
Diag(MethodLoc, diag::error_missing_method_context);
} else {
UnpromotedArgType = ArgType = QualType::getFromOpaquePtr(ArgInfo[i].Type);
// 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 if (ArgType->isObjCInterfaceType()) {
- Diag(ArgInfo[i].NameLoc,
- diag::err_object_cannot_be_passed_returned_by_value)
- << 1 << ArgType;
- ObjCMethod->setInvalidDecl();
- return DeclPtrTy();
- }
+ ArgType = adjustParameterType(ArgType);
}
ParmVarDecl* Param;
UnpromotedArgType,
VarDecl::None, 0);
+ if (ArgType->isObjCInterfaceType()) {
+ Diag(ArgInfo[i].NameLoc,
+ diag::err_object_cannot_be_passed_returned_by_value)
+ << 1 << ArgType;
+ Param->setInvalidDecl();
+ }
+
Param->setObjCDeclQualifier(
CvtQTToAstBitMask(ArgInfo[i].DeclSpec.getObjCDeclQualifier()));
+
+ // Apply the attributes to the parameter.
+ ProcessDeclAttributeList(Param, ArgInfo[i].ArgAttrs);
+
Params.push_back(Param);
}