rsmith added inline comments.
================ Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:591 +def warn_implicit_decl_no_jmp_buf + : Warning<"declaration of built-in '%0' requires the definition of the " + "'jmp_buf' type">, ---------------- We only require a declaration of `jmp_buf`, not a definition. And please retain the word "function" after "built-in". ================ Comment at: clang/lib/Sema/SemaDecl.cpp:1971 << Context.BuiltinInfo.getName(ID); + return nullptr; + } ---------------- It'd be nice to produce `note_include_header_or_declare` here. (Ideally, that note should be suppressed if we're transitively in a header with the right name already, but I think it'll be clear enough what's wrong even if we produce the note unconditionally.) ================ Comment at: clang/test/Sema/builtin-setjmp.c:4-10 +#ifdef NO_JMP_BUF +extern long setjmp(long *); // no_jmp_buf-warning {{declaration of built-in 'setjmp' requires the definition of the 'jmp_buf' type}} +#else +typedef long jmp_buf; +extern int setjmp(char); // redecl-warning@8 {{incompatible redeclaration of library function 'setjmp'}} + // redecl-note@8 {{'setjmp' is a builtin with type 'int (jmp_buf)' (aka 'int (long)')}} +#endif ---------------- You don't need custom `-verify` prefixes for this (`-verify` respects `#ifdef`s); just use `expected`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58091/new/ https://reviews.llvm.org/D58091 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits