diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-01 20:59:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-01 20:59:53 +0000 |
commit | 30d0cfda354ec7f271ff3fa006db02d10a9e9610 (patch) | |
tree | af0b01ca1669547c4585763ce944fc02e09b6464 /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | 115da88f01a9014bc6f56bbf8d13536c318e969e (diff) | |
download | bcm5719-llvm-30d0cfda354ec7f271ff3fa006db02d10a9e9610.tar.gz bcm5719-llvm-30d0cfda354ec7f271ff3fa006db02d10a9e9610.zip |
Implement jump checking for initialized c++ variables, implementing
a fixme and PR6451.
Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.
On the testcase in the PR, we produce:
t.cc:6:3: error: illegal goto into protected scope
goto later;
^
t.cc:7:5: note: jump bypasses variable initialization
X x;
^
llvm-svn: 97497
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 939ccab35db..0ec793360b0 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -50,6 +50,7 @@ void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) { return; CurFunctionNeedsScopeChecking = false; + NumErrorsAtStartOfFunction = getDiagnostics().getNumErrors(); // Allow the rest of sema to find private method decl implementations. if (MDecl->isInstanceMethod()) |