summaryrefslogtreecommitdiff
path: root/test/Sema/implicit-decl.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2011-12-06 09:46:12 +0000
committerHans Wennborg <hans@hanshq.net>2011-12-06 09:46:12 +0000
commit122de3e131a6902d22c97471520ec9005cca6f03 (patch)
treee7a6ee7ebd0d081839ec5a5d20dfb1dce33217af /test/Sema/implicit-decl.c
parentd64251fd56577dd5c78903454632361e094c6dc1 (diff)
downloadclang-122de3e131a6902d22c97471520ec9005cca6f03.tar.gz
Suggest typo corrections for implicit function declarations.
A mistyped function call becomes an inmplicit function declaration in C. Suggest typo correction when one can be found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/implicit-decl.c')
-rw-r--r--test/Sema/implicit-decl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Sema/implicit-decl.c b/test/Sema/implicit-decl.c
index f455977536..72e42e05bb 100644
--- a/test/Sema/implicit-decl.c
+++ b/test/Sema/implicit-decl.c
@@ -3,6 +3,8 @@
typedef int int32_t;
typedef unsigned char Boolean;
+extern int printf(__const char *__restrict __format, ...); // expected-note{{'printf' declared here}}
+
void func() {
int32_t *vector[16];
const char compDesc[16 + 1];
@@ -10,8 +12,13 @@ void func() {
if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}} \
expected-warning {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}}
}
+
+ printg("Hello, World!\n"); // expected-warning{{implicit declaration of function 'printg' is invalid in C99}} \
+ // expected-note{{did you mean 'printf'?}}
+
+ __builtin_is_les(1, 3); // expected-error{{use of unknown builtin '__builtin_is_les'}} \
+ // expected-note{did you mean '__builtin_is_less'?}}
}
Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error{{conflicting types for '_CFCalendarDecomposeAbsoluteTimeV'}}
return 0;
}
-