xref: /aosp_15_r20/external/clang/test/Sema/vfprintf-valid-redecl.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
2*67e74705SXin Li // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE
3*67e74705SXin Li // expected-no-diagnostics
4*67e74705SXin Li 
5*67e74705SXin Li #ifdef PREDECLARE
6*67e74705SXin Li // PR16344
7*67e74705SXin Li // Clang has defined 'vfprint' in builtin list. If the following line occurs before any other
8*67e74705SXin Li // `vfprintf' in this file, and we getPreviousDecl()->getTypeSourceInfo() on it, then we will
9*67e74705SXin Li // get a null pointer since the one in builtin list doesn't has valid TypeSourceInfo.
vfprintf(void)10*67e74705SXin Li int vfprintf(void) { return 0; }
11*67e74705SXin Li #endif
12*67e74705SXin Li 
13*67e74705SXin Li // PR4290
14*67e74705SXin Li // The following declaration is compatible with vfprintf, so we shouldn't
15*67e74705SXin Li // warn.
16*67e74705SXin Li int vfprintf();
17