diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-03 21:11:36 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-03 21:11:36 +0000 |
commit | 22bfa2c28bdbca09949ba4cf8670c310d3e42c71 (patch) | |
tree | 27e9efff069b7c1a7bb8b948c83913b77a67fd76 /clang/lib/Sema/SemaExprObjC.cpp | |
parent | 9ed9e5f31c1fe946a5c6c1ffb651052925570fd4 (diff) | |
download | bcm5719-llvm-22bfa2c28bdbca09949ba4cf8670c310d3e42c71.tar.gz bcm5719-llvm-22bfa2c28bdbca09949ba4cf8670c310d3e42c71.zip |
[objc] Emit a warning when the implementation of a designated initializer does not chain to
an init method that is a designated initializer for the superclass.
llvm-svn: 196316
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index a60749b0224..20f4b4f7248 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -2447,6 +2447,16 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, } } + if (SuperLoc.isValid() && getCurFunction()->ObjCIsDesignatedInit) { + if (const ObjCObjectPointerType * + OCIType = ReceiverType->getAsObjCInterfacePointerType()) { + if (const ObjCInterfaceDecl *ID = OCIType->getInterfaceDecl()) { + if (ID->isDesignatedInitializer(Sel)) + getCurFunction()->ObjCWarnForNoDesignatedInitChain = false; + } + } + } + // Check the message arguments. unsigned NumArgs = ArgsIn.size(); Expr **Args = ArgsIn.data(); |