diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-11 19:34:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-11 19:34:56 +0000 |
commit | f97e8fa2966e3e49eac433336450f24ccbdf8b4a (patch) | |
tree | 983fce26af6a8dd03d18e88b2c673920a129a5cd /lib/Sema/SemaDecl.cpp | |
parent | 9097af160e647df10829cdd548a06c84649f0231 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index d3f24cae90..278d8ecd90 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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)); |