aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorThomas Köppe <tkoeppe@google.com>2024-09-25 17:25:46 +0100
committerGitHub <noreply@github.com>2024-09-25 09:25:46 -0700
commitcebb7c010854e39a77065cfd681db91a79e7ce15 (patch)
treecf0642aa99efd1a5cb9db2ddd00f884920b06a53 /clang/lib/Lex/ModuleMap.cpp
parentd01e336336f2b7fb4137e3dcc7d5c0b06ca1f3d6 (diff)
downloadllvm-cebb7c010854e39a77065cfd681db91a79e7ce15.zip
llvm-cebb7c010854e39a77065cfd681db91a79e7ce15.tar.gz
llvm-cebb7c010854e39a77065cfd681db91a79e7ce15.tar.bz2
[clang-tidy] modernize-use-nullptr matches "NULL" in templates (#109169)
Make modernize-use-nullptr matcher also match "NULL", but not "0", when it appears on a substituted type of a template specialization. Previously, any matches on a substituted type were excluded, but this meant that a situation like the following is not diagnosed: ```c++ template <typename T> struct X { T val; X() { val = NULL; } // should diagnose }; ``` When the user says `NULL`, we expect that the destination type is always meant to be a pointer type, so this should be converted to `nullptr`. By contrast, we do not propose changing a literal `0` in that case, which appears as initializers of both pointer and integer specializations in reasonable real code. (If `NULL` is used erroneously in such a situation, it should be changed to `0` or `{}`.)
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions