simplify code to use adjustParameterType, apply objc arg attributes
to their arguments. llvm-svn: 68876
This commit is contained in:
@@ -2704,12 +2704,6 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
|
||||
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()) {
|
||||
@@ -2717,6 +2711,13 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user