diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-04 23:30:57 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-04 23:30:57 +0000 |
commit | 3062887c9956f2eeabc2e017fbab5c3ab94710b9 (patch) | |
tree | 40a2492244b718eea595e1c308b75f3a83f67c8a /clang/lib/Sema/SemaExprObjC.cpp | |
parent | ff5527718d5d3b9966f6e8948866c0dc15ffcf3c (diff) | |
download | bcm5719-llvm-3062887c9956f2eeabc2e017fbab5c3ab94710b9.tar.gz bcm5719-llvm-3062887c9956f2eeabc2e017fbab5c3ab94710b9.zip |
[SemaObjC] Don't infer the availabilty of +new from -init if the receiver has Class type
rdar://47713266
Differential revision: https://reviews.llvm.org/D57712
llvm-svn: 353115
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index fdb59874cc9..4b7e320b15d 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -2805,8 +2805,8 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, } else { if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) { if (ObjCInterfaceDecl *ClassDecl = CurMeth->getClassInterface()) { - // FIXME: Is this correct? Why are we assuming that a message to - // Class will call a method in the current interface? + // As a guess, try looking for the method in the current interface. + // This very well may not produce the "right" method. // First check the public methods in the class interface. Method = ClassDecl->lookupClassMethod(Sel); @@ -2814,8 +2814,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, if (!Method) Method = ClassDecl->lookupPrivateClassMethod(Sel); - if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, nullptr, - false, false, ClassDecl)) + if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) return ExprError(); } } |