<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 --- - Use of undefined local struct triggers assertion in SemaTemplateInstantiate.cpp"
   href="http://llvm.org/bugs/show_bug.cgi?id=17194">17194</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Use of undefined local struct triggers assertion in SemaTemplateInstantiate.cpp
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </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>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>m.krause@tu-harburg.de
          </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>Trying to compile the following with clang SVN trunk 190512 (also tried
clang-3.3, same result) triggers an assertion in
SemaTemplateInstantiate.cpp:2758: llvm::PointerUnion<clang::Decl*,
llvm::SmallVector<clang::Decl*, 4u>*>*
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.

--- SNIP ---

template <class U>
class B {};

template <typename T>
void g() {
    B<struct X> b;
}

void f() {
    g<double>();
}

--- SNIP ---

The assertion is NOT triggered, for example, when I replace g() with the
following version:

void g() {
    struct X;
    B<X> b;
}

Command line was simply 'clang++ -std=c++11 crash.cpp'.

This might be related to <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED --- - Crash on using local struct in function template as template parameter"
   href="show_bug.cgi?id=9685">bug #9685</a>, but I'm not sure.</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>