diff options
-rw-r--r-- | include/clang/AST/Builtins.def | 2 | ||||
-rw-r--r-- | test/Sema/vfprintf-invalid-redecl.c | 6 | ||||
-rw-r--r-- | test/Sema/vfprintf-valid-redecl.c | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/include/clang/AST/Builtins.def b/include/clang/AST/Builtins.def index 671c4bd6cd..11f3264faa 100644 --- a/include/clang/AST/Builtins.def +++ b/include/clang/AST/Builtins.def @@ -356,7 +356,7 @@ LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h") LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h") LIBBUILTIN(sprintf, "ic*cC*.", "fp:1:", "stdio.h") LIBBUILTIN(vprintf, "icC*a", "fP:0:", "stdio.h") -LIBBUILTIN(vfprintf, "iP*cC*a", "fP:1:", "stdio.h") +LIBBUILTIN(vfprintf, "i.", "fP:1:", "stdio.h") LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h") LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h") diff --git a/test/Sema/vfprintf-invalid-redecl.c b/test/Sema/vfprintf-invalid-redecl.c new file mode 100644 index 0000000000..02c5061d8c --- /dev/null +++ b/test/Sema/vfprintf-invalid-redecl.c @@ -0,0 +1,6 @@ +// RUN: clang-cc %s -fsyntax-only -verify +// PR4290 + +// The following declaration is not compatible with vfprintf(), but make +// sure this isn't an error: autoconf expects this to build. +char vfprintf(); // expected-warning {{incompatible redeclaration of library function 'vfprintf'}} expected-note {{'vfprintf' is a builtin}} diff --git a/test/Sema/vfprintf-valid-redecl.c b/test/Sema/vfprintf-valid-redecl.c new file mode 100644 index 0000000000..cc8e2c40d3 --- /dev/null +++ b/test/Sema/vfprintf-valid-redecl.c @@ -0,0 +1,6 @@ +// RUN: clang-cc %s -fsyntax-only -pedantic -verify +// PR4290 + +// The following declaration is compatible with vfprintf, so we shouldn't +// warn. +int vfprintf(); |