summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/compare.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-06 20:14:23 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-06 20:14:23 +0000
commite64c196868540bd016e8a59f4f60a0be987acc03 (patch)
tree27773befb35e0d825bb428f95a9492b494abf9da /clang/test/Sema/compare.c
parentb1281025f107caed701816f18c47371250bfe95e (diff)
downloadbcm5719-llvm-e64c196868540bd016e8a59f4f60a0be987acc03.tar.gz
bcm5719-llvm-e64c196868540bd016e8a59f4f60a0be987acc03.zip
Fix a problem with false diagnostics when comparing distinct NULL pointer types, from David Majnemer
llvm-svn: 74850
Diffstat (limited to 'clang/test/Sema/compare.c')
-rw-r--r--clang/test/Sema/compare.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/compare.c b/clang/test/Sema/compare.c
index 51f77317385..b7c5c25ddb6 100644
--- a/clang/test/Sema/compare.c
+++ b/clang/test/Sema/compare.c
@@ -1,5 +1,7 @@
// RUN: clang-cc -fsyntax-only -pedantic -verify %s
+#include <stddef.h>
+
int test(char *C) { // nothing here should warn.
return C != ((void*)0);
return C != (void*)0;
@@ -29,3 +31,8 @@ int function_pointers(int (*a)(int), int (*b)(int))
return a == (void *) 0;
return a == (void *) 1; // expected-warning {{comparison of distinct pointer types}}
}
+
+int void_pointers(void *foo)
+{
+ return foo == NULL;
+}
OpenPOWER on IntegriCloud