<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 --- - Spelling suggests something that doesn't make sense, and then shows note for wrong definition"
href="http://llvm.org/bugs/show_bug.cgi?id=22297">22297</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Spelling suggests something that doesn't make sense, and then shows note for wrong definition
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nicolasweber@gmx.de
</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>$ cat test.cc
#include <math.h>
namespace base {
struct TimeTicks {
static void Now();
};
}
void f() {
base::TimeTicks::now();
}
$ ~/src/llvm-build/bin/clang -c test.cc -isysroot $(xcrun -show-sdk-path)
test.cc:10:20: error: no member named 'now' in 'base::TimeTicks'; did you mean
'pow'?
base::TimeTicks::now();
~~~~~~~~~~~~~~~~~^~~
pow
test.cc:5:15: note: 'pow' declared here
static void Now();
^
1 error generated.
Two problems:
1. pow() doesn't exist in the base::TimeTicks scope, so it shouldn't be
suggested.
2. The note says "'pow' declared here", but it prints at the thing that
should've been suggested.
(If I replace "now" with "pow", I get a different nonsensical suggestion:
test.cc:10:20: error: no member named 'pow' in 'base::TimeTicks'; did you mean
'powf'?
base::TimeTicks::pow();
~~~~~~~~~~~~~~~~~^~~
powf
test.cc:5:15: note: 'powf' declared here
static void Now();
^
1 error generated.
If I apply this suggestion, it goes on:
test.cc:10:20: error: no member named 'powf' in 'base::TimeTicks'; did you mean
'cosf'?
base::TimeTicks::powf();
~~~~~~~~~~~~~~~~~^~~~
cosf
test.cc:5:15: note: 'cosf' declared here
static void Now();
^
1 error generated.
)</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>