Add explicit support for diagnosing implicit function decls.
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/implicit-decl.c b/test/Sema/implicit-decl.c
new file mode 100644
index 0000000..ea40e61
--- /dev/null
+++ b/test/Sema/implicit-decl.c
@@ -0,0 +1,17 @@
+// RUN: clang %s -verify -fsyntax-only
+
+typedef int int32_t;
+typedef unsigned char Boolean;
+
+void func() {
+ int32_t *vector[16];
+ const char compDesc[16 + 1];
+ int32_t compCount = 0;
+ if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-error{{previous implicit declaration is here}}
+ }
+ return ((void *)0);
+}
+Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error{{conflicting types for '_CFCalendarDecomposeAbsoluteTimeV'}}
+ return 0;
+}
+