Commit 14e4193
committed
A16-2-2: Library includes are not useless on real compilers
Our useless include query is looking for includes where nothing from the
included file is used by the including file. In this case, the declaration of
v transitively uses std::size_t, and `#include <algorithm>` transitively
includes the file that defines std::size_t. To detect such cases we would need
to report redundant includes e.g. includes for which useful symbols are
provided, but which are made unnecessary by other imports in the file.
For now we just exclude these expected results, as modifying the query is
tricky. Furthermore, the intention of the rule is actually that we check
standard library includes against the list of symbols as per the standard
library, but again this is challenging.1 parent 6aaf0ee commit 14e4193
File tree
4 files changed
+5
-2
lines changed- cpp/autosar/test/rules/A16-2-2
4 files changed
+5
-2
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
0 commit comments