vfprintf-valid-redecl.c 602 B

12345678910111213141516
  1. // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
  2. // RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify -DPREDECLARE
  3. // expected-no-diagnostics
  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; }
  10. #endif
  11. // PR4290
  12. // The following declaration is compatible with vfprintf, so we shouldn't
  13. // warn.
  14. int vfprintf();