<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 - Misleading carat in fixit hint for constexpr-not-const"
href="https://bugs.llvm.org/show_bug.cgi?id=40205">40205</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Misleading carat in fixit hint for constexpr-not-const
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jyknight@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Given this:
clang -std=c++11 -fsyntax-only -c -Wconstexpr-not-const test.cc
test.cc:
class Foo {
constexpr int operator()() { return 0; }
};
You get:
test.cc:2:17: warning: 'constexpr' non-static member function will not be
implicitly 'const' in C++14; add 'const' to avoid a change in behavior
[-Wconstexpr-not-const]
constexpr int operator()() { return 0; }
^
const
The carat points before/to the function name -- which makes it seem like that's
where it wants you to add "const". However, you really need to add it at the
end -- where the text "const" is printed, rather than where the carat points
to.
That's confusing.</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>