summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-08-27 21:17:47 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-08-27 21:17:47 +0000
commited916fa45881a75af33d38e18e22f93472814fbb (patch)
treeafd74ac02794454b0d661f86d6f73a993dcc7dcd /clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c
parent199fa13fff9f10907d6da8216465270f4f8304b0 (diff)
downloadbcm5719-llvm-ed916fa45881a75af33d38e18e22f93472814fbb.tar.gz
bcm5719-llvm-ed916fa45881a75af33d38e18e22f93472814fbb.zip
Expose language options to the checkers; disable UseNullptrCheck when not compiling in C++11 mode.
llvm-svn: 246209
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-use-nullptr.c10
1 files changed, 10 insertions, 0 deletions
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;
+}
OpenPOWER on IntegriCloud