http://llvm.org/bugs/show_bug.cgi?id=22297
Bug ID: 22297
Summary: Spelling suggests something that doesn't make sense,
and then shows note for wrong definition
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
$ 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.
)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs