<html>
    <head>
      <base href="https://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 --- - Assertion failure when recovering from unknown identifier."
   href="https://llvm.org/bugs/show_bug.cgi?id=27229">27229</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure when recovering from unknown identifier.
          </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>Linux
          </td>
        </tr>

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

        <tr>
          <th>Keywords</th>
          <td>crash-on-invalid
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rtrieu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat test.cc
class Runner {
  void Run();
};

template <typename, typename>
class Two {};
template <typename>
class One {};
class Zero {};

namespace {

void Stop(const Two<int, One<Unknown>>&) {}
}

const int kTwenty = 20;

void Runner::Run() {
  switch (0)
  case 0:
  Zero zero;
}
$ clang -std=c++11 test.cc
test.cc:13:30: error: use of undeclared identifier 'Unknown'
void Stop(const Two<int, One<Unknown>>&) {}
                             ^
test.cc:14:1: error: expected a type
}
^
test.cc:16:23: error: expected ')'
const int kTwenty = 20;
                      ^
test.cc:13:10: note: to match this '('
void Stop(const Two<int, One<Unknown>>&) {}
         ^
test.cc:18:14: error: cannot define or redeclare 'Run' here because namespace
''
      does not enclose namespace 'Runner'
void Runner::Run() {
     ~~~~~~~~^
clang-3.5: ../include/llvm/ADT/SmallVector.h:164: reference
llvm::SmallVectorTemplateCommon<clang::SwitchStmt *, void>::back() [T =
clang::SwitchStmt *]: Assertion `!empty()' failed.

The identifier 'Unknown' is not defined, causing the first error.  However, the
recover from that error messes up the scope, causing the assertion failure when
processing the switch statement.</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>