<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 - "friends can only be classes or functions" should also be diagnosed when trying to befriend a concept"
href="https://bugs.llvm.org/show_bug.cgi?id=45837">45837</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>"friends can only be classes or functions" should also be diagnosed when trying to befriend a concept
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>arthur.j.odwyer@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><a href="https://godbolt.org/z/jntYnj">https://godbolt.org/z/jntYnj</a>
Given this code:
struct S {
template<class>
friend concept fooable;
};
Clang produces this harsh syntax error:
error: expected member name or ';' after declaration specifiers
friend concept fooable;
^
If you try to befriend any other kind of entity -- for example, a variable or
variable template -- Clang gives a much friendlier error message, indicating
that it understands what you were *trying* to do:
error: friends can only be classes or functions
friend bool fooable_v;
^
People are already trying to befriend concepts in the field, so it would be
nice if Clang gave that same friendly error message
(diag::err_unexpected_friend) for the `concept` case, as well.</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>