aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/assign-null.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-11-27 17:58:44 +0000
committerSteve Naroff <snaroff@apple.com>2007-11-27 17:58:44 +0000
commit529a4ad63bc82474d7d78fc189c340a3773da8bc (patch)
tree598cd26466d6386d1d7222d7f65a705bb513b69a /test/Sema/assign-null.c
parent7ee261c8e71f363d86461f4d1a37e3def354c976 (diff)
Move the null pointer constant check from Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible.
Thanks to Seo Sanghyeon for the bug, follow-through, and patch! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/assign-null.c')
-rw-r--r--test/Sema/assign-null.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/assign-null.c b/test/Sema/assign-null.c
new file mode 100644
index 0000000000..6972d90223
--- /dev/null
+++ b/test/Sema/assign-null.c
@@ -0,0 +1,10 @@
+// RUN: clang -fsyntax-only -verify %s
+
+#include <stddef.h>
+
+typedef void (*hookfunc)(void *arg);
+hookfunc hook;
+
+void clear_hook() {
+ hook = NULL;
+}