<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Type pretty printing for auto deduced non-type template parameter (P0127R2) in diagnostics can be confusing"
href="https://bugs.llvm.org/show_bug.cgi?id=42527">42527</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Type pretty printing for auto deduced non-type template parameter (P0127R2) in diagnostics can be confusing
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++17
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>piotr.rak@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22201" name="attach_22201" title="Test case">attachment 22201</a> <a href="attachment.cgi?id=22201&action=edit" title="Test case">[details]</a></span>
Test case
Since there is no type information about type deduced for auto placeholder in
non-type template parameter while pretty printing in diag, error message can
confuse user.
Please consider code:
template <typename, typename> struct is_same { enum { value = false};
};
template <typename Ty_> struct is_same<Ty_, Ty_> { enum { value = true };
};
template <auto> struct nonty_auto {};
using unsigned_auto_t = nonty_auto< unsigned(0)>;
using signed_auto_t = nonty_auto< int(0) >;
static_assert(is_same<unsigned_auto_t, signed_auto_t>::value, "might confuse
user");
That will result in error message:
confusing_P0127R2_pretty_printing.cc:12:1: error: static_assert failed due to
requirement 'is_same<nonty_auto<0>, nonty_auto<0> >::value' "might confuse
user"
static_assert(is_same<unsigned_auto_t, signed_auto_t>::value, "might confuse
user");
Based on that user is not able distinguish between nonty_auto instantiated with
signed and unsigned literal 0.</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>