diff options
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/encode-test.m | 2 | 
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 7422ca85973..dd9fce90e03 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -3396,6 +3396,11 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,                                 false);      return;    } +   +  if (isObjCSelType(T)) { +    S += ':'; +    return; +  }    if (const PointerType *PT = T->getAs<PointerType>()) {      QualType PointeeTy = PT->getPointeeType(); @@ -3429,10 +3434,6 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,          S.replace(S.end()-2, S.end(), replace);        }      } -    if (isObjCSelType(PointeeTy)) { -      S += ':'; -      return; -    }      if (PointeeTy->isCharType()) {        // char pointer types should be encoded as '*' unless it is a diff --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m index 6665cb9d584..7aca79a8f38 100644 --- a/clang/test/CodeGenObjC/encode-test.m +++ b/clang/test/CodeGenObjC/encode-test.m @@ -68,10 +68,12 @@ struct Innermost {  	int ivar;  }  -(void) test3: (Test*  [3] [4])b ;  +- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3;  @end  @implementation Test  -(void) test3: (Test* [3] [4])b {} +- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3 {}  @end  struct S { int iS; };  | 

