Details
- Reviewers
aaron.ballman gribozavr2 alexfh
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | IIRC, some of the modernize- checks were meant to be useful to make the pre-C++11 code compile in C++11. This check is an example of this (maybe the only one?). Limiting the check to C++11 and deleting this test is a bit too radical. |
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | I'm lost, this check is all about replacing assignment of pointer to 0 with nullptr a keyword which doesn't exist pre c++11, so this test case will just result in invalid code. Or am I missing the point? |
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | The idea, if I understand correctly, is that you start with C++98 code, apply modernize-* checks, and get C++11 code. |
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | Yep, at least for this particular check there are cases, which won't compile in C++11, but will compile after its fixes are applied. Not sure if this was ever used like this though. |
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | My understanding of the modernize module was its designed to convert the old c++98/03 code to use newer (safer) c++ constructs. Its purpose isn't to fix compiler errors in c++11 mode that compile OK in c++98 mode |
clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp | ||
---|---|---|
1 | This and a number of other modernize- checks were migrated from the clang-modernize (previously cpp11-migrate) tool. It's hard to tell now, whether running on code in C++98 mode and fixing errors that would appear in C++11 was a supported use case at the time (though all commits are in git and one could look up, if someone wants to). But that's irrelevant. We need to decide now, whether we want to support this use case or not. |
IIRC, some of the modernize- checks were meant to be useful to make the pre-C++11 code compile in C++11. This check is an example of this (maybe the only one?). Limiting the check to C++11 and deleting this test is a bit too radical.