2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
|
2013-06-26 06:37:05 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE
|
2009-06-03 17:54:50 +08:00
|
|
|
|
2013-06-26 06:37:05 +08:00
|
|
|
#ifdef PREDECLARE
|
2013-06-26 04:34:17 +08:00
|
|
|
// PR16344
|
|
|
|
// Clang has defined 'vfprint' in builtin list. If the following line occurs before any other
|
|
|
|
// `vfprintf' in this file, and we getPreviousDecl()->getTypeSourceInfo() on it, then we will
|
|
|
|
// get a null pointer since the one in builtin list doesn't has valid TypeSourceInfo.
|
2016-12-20 07:59:34 +08:00
|
|
|
int vfprintf(void) { return 0; } // expected-warning {{requires inclusion of the header <stdio.h>}}
|
2013-06-26 06:37:05 +08:00
|
|
|
#endif
|
2013-06-26 04:34:17 +08:00
|
|
|
|
|
|
|
// PR4290
|
2009-06-03 17:54:50 +08:00
|
|
|
// The following declaration is compatible with vfprintf, so we shouldn't
|
2016-12-20 07:59:34 +08:00
|
|
|
// reject.
|
2009-06-03 17:54:50 +08:00
|
|
|
int vfprintf();
|
2016-12-20 07:59:34 +08:00
|
|
|
#ifndef PREDECLARE
|
|
|
|
// expected-warning@-2 {{requires inclusion of the header <stdio.h>}}
|
|
|
|
#endif
|