<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 --- - Assertion with template alias and gdwarf-2"
href="http://llvm.org/bugs/show_bug.cgi?id=19623">19623</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion with template alias and gdwarf-2
</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>All
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jonathan.sauer@gmx.de
</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=12463" name="attach_12463" title="Log of clang run">attachment 12463</a> <a href="attachment.cgi?id=12463&action=edit" title="Log of clang run">[details]</a></span>
Log of clang run
The following program crashes clang r207398 when compiling with -gdwarf-2:
template <bool>
struct enable_if { };
template <>
struct enable_if<true> { using type = void; };
template <bool C>
using enable_if_t = typename enable_if<C>::type;
template <unsigned int M, enable_if_t<M == 1>* = nullptr> // A
//template <unsigned int M, typename enable_if<M == 1>::type* = nullptr> // B
static void foo() {}
int main()
{
foo<1>();
}
This results in (full log attached):
% ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++11 -gdwarf-2 clang.cpp
Assertion failed: (Src), function CreateType, file
/Users/rynnsauer/LLVM/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp, line 725.
0 clang 0x00000001066b7388
llvm::sys::PrintStackTrace(__sFILE*) + 40
1 clang 0x00000001066b7884 SignalHandler(int) + 548
2 libsystem_platform.dylib 0x00007fff96f565aa _sigtramp + 26
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 1762302576
4 clang 0x00000001066b7646 abort + 22
5 clang 0x00000001066b7621 __assert_rtn + 81
6 clang 0x00000001050c551a
clang::CodeGen::CGDebugInfo::CreateType(clang::TemplateSpecializationType
const*, llvm::DIFile) + 682
7 clang
When compiling with line B instead of line A (using enable_if directly instead
of via a template alias), the code compiles successfully.</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>