<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Crash building CFG with -fms-compatibility -Wuninitialized"
   href="http://llvm.org/bugs/show_bug.cgi?id=20048">20048</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash building CFG with -fms-compatibility -Wuninitialized
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alp@nuanti.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Test case crashes with clang r211005:

// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++11
-Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
-Wuninitialized

namespace ms_protected_scope {
  struct C { C(); };

  int jump_over_variable_init(bool b) {
    if (b)
      goto foo; // expected-warning {{goto into protected scope}}
    C c; // expected-note {{jump bypasses variable initialization}}
  foo:
    return 1;
  }

  struct Y {
    ~Y();
  };

  void jump_over_var_with_dtor() {
    goto end; // expected-warning{{goto into protected scope}}
    Y y; // expected-note {{jump bypasses variable with a non-trivial
destructor}}
   end:
      ;
  }

}



Trace:

Assertion failed: (F != const_iterator() && "L iterator is not reachable from F
iterator."), function distance, file
/Users/alp/Projects/llvm-work/upstream/clang/lib/Analysis/CFG.cpp, line 198.
0  libLLVMSupport.dylib       0x000000010be4e6bf
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVMSupport.dylib       0x000000010be4eaaa SignalHandler(int) + 248
2  libsystem_platform.dylib   0x00007fff939f05aa _sigtramp + 26
3  libsystem_platform.dylib   000000000000000000 _sigtramp + 1818294896
4  libLLVMSupport.dylib       0x000000010be4e911 abort + 22
5  libLLVMSupport.dylib       0x000000010be4e8fb abort + 0
6  libclangAnalysis.dylib     0x000000010d59ec7e (anonymous
namespace)::LocalScope::const_iterator::distance((anonymous
namespace)::LocalScope::const_iterator) + 82
7  libclangAnalysis.dylib     0x000000010d5a364d (anonymous
namespace)::CFGBuilder::addAutomaticObjDtors((anonymous
namespace)::LocalScope::const_iterator, (anonymous
namespace)::LocalScope::const_iterator, clang::Stmt*) + 145
8  libclangAnalysis.dylib     0x000000010d5a06b8 (anonymous
namespace)::CFGBuilder::Visit(clang::Stmt*, (anonymous
namespace)::AddStmtChoice) + 4406
9  libclangAnalysis.dylib     0x000000010d5a324b (anonymous
namespace)::CFGBuilder::VisitCompoundStmt(clang::CompoundStmt*) + 69
10 libclangAnalysis.dylib     0x000000010d5a0493 (anonymous
namespace)::CFGBuilder::Visit(clang::Stmt*, (anonymous
namespace)::AddStmtChoice) + 3857
11 libclangAnalysis.dylib     0x000000010d59b066
clang::CFG::buildCFG(clang::Decl const*, clang::Stmt*, clang::ASTContext*,
clang::CFG::BuildOptions const&) + 1502
12 libclangAnalysis.dylib     0x000000010d594d6f
clang::AnalysisDeclContext::getCFG() + 111
13 libclangSema.dylib         0x000000010cf05f5d
clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy,
clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) +
4067
14 libclangSema.dylib         0x000000010cf39583
clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy
const*, clang::Decl const*, clang::BlockExpr const*) + 97
15 libclangSema.dylib         0x000000010cfbcd19
clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 2285
16 libclangParse.dylib        0x000000010cd725db
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 287
17 libclangParse.dylib        0x000000010cd802e4
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2104</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>