Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify |
Richard Smith | 71bdbb0 | 2013-06-25 22:37:05 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE |
Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 3 | // expected-no-diagnostics |
Eli Friedman | 8246b6f | 2009-06-03 09:54:50 +0000 | [diff] [blame] | 4 | |
Richard Smith | 71bdbb0 | 2013-06-25 22:37:05 +0000 | [diff] [blame] | 5 | #ifdef PREDECLARE |
Richard Smith | ef87be3 | 2013-06-25 20:34:17 +0000 | [diff] [blame] | 6 | // PR16344 |
| 7 | // Clang has defined 'vfprint' in builtin list. If the following line occurs before any other |
| 8 | // `vfprintf' in this file, and we getPreviousDecl()->getTypeSourceInfo() on it, then we will |
| 9 | // get a null pointer since the one in builtin list doesn't has valid TypeSourceInfo. |
| 10 | int vfprintf(void) { return 0; } |
Richard Smith | 71bdbb0 | 2013-06-25 22:37:05 +0000 | [diff] [blame] | 11 | #endif |
Richard Smith | ef87be3 | 2013-06-25 20:34:17 +0000 | [diff] [blame] | 12 | |
| 13 | // PR4290 |
Eli Friedman | 8246b6f | 2009-06-03 09:54:50 +0000 | [diff] [blame] | 14 | // The following declaration is compatible with vfprintf, so we shouldn't |
| 15 | // warn. |
| 16 | int vfprintf(); |