<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 --- - Abort after class declaration as template argument"
   href="http://llvm.org/bugs/show_bug.cgi?id=18653">18653</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Abort after class declaration as template argument
          </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>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pkeir@outlook.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11968" name="attach_11968" title="The C++ code which produces the abort">attachment 11968</a> <a href="attachment.cgi?id=11968&action=edit" title="The C++ code which produces the abort">[details]</a></span>
The C++ code which produces the abort

The attached code causes clang to abort (core dump). The code provides a class
declaration as the template argument to a function call made within a class
template method. I believe this is a C++11 feature, and so I provide the
-std=c++11 flag; though the same error occurs without it.

clang++ -c -std=c++11 declbug.cpp

If I instead declare class newclass outside a code scope, for example outside
the class template, (so changing to external linkage), the abort disappears.

The errors produced start with:

clang:
/home/xxxxx/projects/llvm_src/local_repo/Mon-25-Nov-2013--11-46-50/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2785:
llvm::PointerUnion<Decl *, LocalInstantiationScope::DeclArgumentPack *>
*clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl *):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.

clang++ --version provides:

clang version 3.4 (ssh://superserver/var/lib/git/clang.git
4695dcd5c247a1848faed59b575909bdf2829888)
(ssh://superserver/var/lib/git/llvm.git
53f84cf3a29b54666bd58749f2fdf9834ef4daa7)
Target: x86_64-unknown-linux-gnu
Thread model: posix</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>