From 6d97e5e4b7abdae710c2548b51f4ed0298e86d80 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 1 Mar 2010 20:59:53 +0000 Subject: 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; ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97497 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/Sema.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Sema/Sema.cpp') diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 38c842eede..fb7d1991fb 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -127,6 +127,8 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, if (getLangOptions().CPlusPlus) FieldCollector.reset(new CXXFieldCollector()); + NumErrorsAtStartOfFunction = 0; + // Tell diagnostics how to render things from the AST library. PP.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument, &Context); -- cgit v1.2.3-18-g5258