2007-07-11 21:01:13 +04:00
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
// Minor random things that can be improved
|
|
|
|
//===---------------------------------------------------------------------===//
|
2008-03-18 23:05:01 +03:00
|
|
|
|
2007-07-11 21:01:13 +04:00
|
|
|
|
2007-10-10 22:08:07 +04:00
|
|
|
Warn about "X && 0x1000" saying that the user may mean "X & 0x1000".
|
2007-10-11 20:06:02 +04:00
|
|
|
We should do this for any immediate except zero, so long as it doesn't come
|
|
|
|
from a macro expansion. Likewise for ||.
|
2007-07-11 21:01:13 +04:00
|
|
|
|
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
Lexer-related diagnostics should point to the problematic character, not the
|
|
|
|
start of the token. For example:
|
|
|
|
|
|
|
|
int y = 0000\
|
|
|
|
00080;
|
|
|
|
|
|
|
|
diag.c:4:9: error: invalid digit '8' in octal constant
|
|
|
|
int y = 0000\
|
|
|
|
^
|
|
|
|
|
|
|
|
should be:
|
|
|
|
|
|
|
|
diag.c:4:9: error: invalid digit '8' in octal constant
|
|
|
|
00080;
|
|
|
|
^
|
|
|
|
|
2007-07-16 10:55:01 +04:00
|
|
|
This specific diagnostic is implemented, but others should be updated.
|
|
|
|
|
2007-07-11 21:01:13 +04:00
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
|
2007-10-10 22:52:22 +04:00
|
|
|
C++ (checker): For iterators, warn of the use of "iterator++" instead
|
|
|
|
of "++iterator" when when the value returned by operator++(int) is
|
|
|
|
ignored.
|
2008-11-17 20:14:10 +03:00
|
|
|
|
|
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
We want to keep more source range information in Declarator to help
|
|
|
|
produce better diagnostics. Declarator::getSourceRange() should be
|
|
|
|
implemented to give a range for the whole declarator with all of its
|
|
|
|
specifiers, and DeclaratorChunk::ParamInfo should also have a source
|
|
|
|
range covering the whole parameter, so that an error message like this:
|
|
|
|
|
|
|
|
overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float')
|
|
|
|
X operator++(X&, const float& f);
|
|
|
|
^
|
|
|
|
can be turned into something like this:
|
|
|
|
|
|
|
|
overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float')
|
|
|
|
X operator++(X&, const float& f);
|
|
|
|
^ ~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|