blob: 78f965b426aa479e73a97b11dad40f480636e41d [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===---------------------------------------------------------------------===//
2// Minor random things that can be improved
3//===---------------------------------------------------------------------===//
Steve Naroff3981bf72008-03-18 20:05:01 +00004
Reid Spencer5f016e22007-07-11 17:01:13 +00005
Chris Lattnercd098472007-10-10 18:08:07 +00006Warn about "X && 0x1000" saying that the user may mean "X & 0x1000".
Chris Lattner507cc6c2007-10-11 16:06:02 +00007We should do this for any immediate except zero, so long as it doesn't come
8from a macro expansion. Likewise for ||.
Reid Spencer5f016e22007-07-11 17:01:13 +00009
10//===---------------------------------------------------------------------===//
11
12Lexer-related diagnostics should point to the problematic character, not the
13start of the token. For example:
14
15int y = 0000\
1600080;
17
18diag.c:4:9: error: invalid digit '8' in octal constant
19int y = 0000\
20 ^
21
22should be:
23
24diag.c:4:9: error: invalid digit '8' in octal constant
2500080;
26 ^
27
Chris Lattner136f93a2007-07-16 06:55:01 +000028This specific diagnostic is implemented, but others should be updated.
29
Reid Spencer5f016e22007-07-11 17:01:13 +000030//===---------------------------------------------------------------------===//
31
Ted Kremenekdbff47f2007-10-10 18:52:22 +000032C++ (checker): For iterators, warn of the use of "iterator++" instead
33 of "++iterator" when when the value returned by operator++(int) is
34 ignored.
Douglas Gregora26877f2008-11-17 17:14:10 +000035
36//===---------------------------------------------------------------------===//
37
38We want to keep more source range information in Declarator to help
39produce better diagnostics. Declarator::getSourceRange() should be
40implemented to give a range for the whole declarator with all of its
41specifiers, and DeclaratorChunk::ParamInfo should also have a source
42range covering the whole parameter, so that an error message like this:
43
44overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float')
45X operator++(X&, const float& f);
46 ^
47can be turned into something like this:
48
49overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float')
50X operator++(X&, const float& f);
51 ^ ~~~~~~~~~~~~~~
52
53
54
55