<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 --- - decltype as default template argument & C++11 in-class initialization"
href="http://llvm.org/bugs/show_bug.cgi?id=18560">18560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>decltype as default template argument & C++11 in-class initialization
</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>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>malekchristoph@gmail.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>clang++ -v:
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
====
This code crashes the frontend.
As you can see, only the in-class initialization does not work.
struct some_type
{
int m_some_member{0};
};
template<typename T, typename Value_Type = decltype(T::m_some_member)>
Value_Type some_func()
{return 10;}
class some_wrapper
{
int m_some_more_member{some_func<some_type>()}; // CRASH!
public:
some_wrapper() :
m_some_more_member{some_func<some_type>()} // WORKS!
{ }
void some_method() noexcept
{
m_some_more_member = some_func<some_type>(); // WORKS!
}
};</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>