[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / vfprintf-valid-redecl.c
blob7cd3cb7a00f1971dfc3bbda266322440d2b3f1bd
1 // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -std=c99
2 // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE -std=c99
4 #ifdef PREDECLARE
5 // PR16344
6 // Clang has defined 'vfprint' in builtin list. If the following line occurs before any other
7 // `vfprintf' in this file, and we getPreviousDecl()->getTypeSourceInfo() on it, then we will
8 // get a null pointer since the one in builtin list doesn't has valid TypeSourceInfo.
9 int vfprintf(void) { return 0; } // expected-warning {{requires inclusion of the header <stdio.h>}}
10 #endif
12 // PR4290
13 // The following declaration is compatible with vfprintf, so we shouldn't
14 // reject.
15 int vfprintf(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
16 #ifndef PREDECLARE
17 // expected-warning@-2 {{requires inclusion of the header <stdio.h>}}
18 #endif