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
diff --git a/test/Sema/assign-null.c b/test/Sema/assign-null.c
new file mode 100644
index 0000000..6972d90
--- /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;
+}