From f36a425eba7ecea9a0c9d0cc9c7c6b43ac9bbb31 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 28 Aug 2015 13:20:46 +0000 Subject: Reapplying r246209, which exposed language options to the checkers. This time disable UseNullptrCheck when not compiling in C++ mode, but still allow in C++11 mode since it's likely the user wishes to modernize their code. llvm-svn: 246298 --- clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c (limited to 'clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c') diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c new file mode 100644 index 00000000000..c2ccbbd8117 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c @@ -0,0 +1,10 @@ +// RUN: clang-tidy %s -checks=-*,modernize-use-nullptr -- | count 0 + +// Note: this test expects no diagnostics, but FileCheck cannot handle that, +// hence the use of | count 0. + +#define NULL 0 +void f(void) { + char *str = NULL; // ok + (void)str; +} -- cgit v1.2.3