simplify code to use adjustParameterType, apply objc arg attributes
to their arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68876 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index d3f24ca..278d8ec 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2704,12 +2704,6 @@
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 @@
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));