<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 3.6 crash on invalid template specialization code"
href="http://llvm.org/bugs/show_bug.cgi?id=21310">21310</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang 3.6 crash on invalid template specialization code
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>sanders_roger@hotmail.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>Created <span class=""><a href="attachment.cgi?id=13216" name="attach_13216" title="Preprocessed source and run script">attachment 13216</a> <a href="attachment.cgi?id=13216&action=edit" title="Preprocessed source and run script">[details]</a></span>
Preprocessed source and run script
The following invalid template code crashed the clang compiler:
template <class T1>
class SomeClass
{
public:
template <class T2>
void SomeFunc(T2 someArg)
{}
};
template <class T1>
void SomeClass<T1>::SomeFunc<int>(int someArg)
{}
The development environment is Windows 8.1 with Visual Studio 2013 Update 3,
using the following distribution of Clang for Windows:
<a href="http://llvm.org/builds/downloads/LLVM-3.6.0-r219740-win32.exe">http://llvm.org/builds/downloads/LLVM-3.6.0-r219740-win32.exe</a>
The output log from the compilation process is as follows:
1>crash.cpp(11,21): error : cannot specialize a member of an unspecialized
template
1> void SomeClass<T1>::SomeFunc<int>(int someArg)
1> ^ ~~~~~
1> Assertion failed: TemplateTypeParm->getDepth() == 0 && "Can't deduce with
depth > 0", file ..\tools\clang\lib\Sema\SemaTemplateDeduction.cpp, line 1129
1>clang-cl.exe : error : clang frontend command failed due to signal (use -v to
see invocation)
1> clang version 3.6.0 (219740)
1> Target: i686-pc-windows-msvc
1> Thread model: posix
1> clang-cl.exe: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
1> clang-cl.exe: note: diagnostic msg:
1> ********************
1>
1> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
1> Preprocessed source(s) and associated run script(s) are located at:
1> clang-cl.exe: note: diagnostic msg: C:\TEMP\crash-68eb19.cpp
1> clang-cl.exe: note: diagnostic msg: C:\TEMP\crash-68eb19.sh
1> clang-cl.exe: note: diagnostic msg:
The preprocessed source file and run script referenced in this build log are
attached to this report.</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>