<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 --- - clang crashes when compiling template"
   href="http://llvm.org/bugs/show_bug.cgi?id=15808">15808</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes when compiling template
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </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>llvmbugs-9floo@rtdt.eu
          </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=10395" name="attach_10395" title="reduced example file to trigger bug">attachment 10395</a> <a href="attachment.cgi?id=10395&action=edit" title="reduced example file to trigger bug">[details]</a></span>
reduced example file to trigger bug

Not sure if this is a bug. When compiling broken code clang crashes.
Works if line is changed to "struct foo<T> *temp = new struct foo<T>;"

console output:
###############################
clang: SemaTemplateInstantiate.cpp:2683: 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.
0  clang     0x09e87d18
1  clang     0x09e88284
2            0xb77b3400 __kernel_sigreturn + 0
3            0xb77b3424 __kernel_vsyscall + 16
4  libc.so.6 0xb750e941 gsignal + 81
5  libc.so.6 0xb7511d72 abort + 386
6  libc.so.6 0xb7507b58 __assert_fail + 248
7  clang     0x08a79219
clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*) + 425
Stack dump:
0.      Program arguments: /llvm/llvm-3.2.src/Release+Asserts/bin-array
-target-cpu pentium4 -target-linker-version 2.22
-momit-leaf-frame-pointeclude/c++/4.7 -internal-isystem
/usr/lib/gcc/i486-linux-gnu/4.7/../../../../inclsrc/Release+Asserts/bin/../lib/clang/3.2/include
-internal-externc-isystem /usr/ -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fco
1.      <eof> parser at end of file
2.      a.cpp:8:3: instantiating function definition 'a'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocat
clang version 3.2 (tags/RELEASE_32/final)
Target: i386-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a>
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/a-z2Qjxz.cpp
clang: note: diagnostic msg: /tmp/a-z2Qjxz.sh
clang: note: diagnostic msg: 

********************</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>