[PATCH] D75538: [clang-tidy] Updated language supported restrictions on some checks

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 09:33:01 PST 2020


njames93 marked an inline comment as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-nullptr-basic.cpp:1
-// RUN: %check_clang_tidy -std=c++98 %s modernize-use-nullptr %t -- -- -Wno-non-literal-null-conversion
-//
----------------
alexfh wrote:
> gribozavr2 wrote:
> > njames93 wrote:
> > > alexfh wrote:
> > > > 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.
> > > 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?
> > The idea, if I understand correctly, is that you start with C++98 code, apply modernize-* checks, and get C++11 code.
> 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.
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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75538/new/

https://reviews.llvm.org/D75538





More information about the cfe-commits mailing list