cor3ntin added inline comments.
================ Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:5566-5567 +def warn_non_prototype_changes_behavior : Warning< + "this function declaration without a prototype is deprecated in all versions " + "of C and changes behavior in C2x">, InGroup<DeprecatedNonPrototype>; +def warn_prototype_changes_behavior : Warning< ---------------- "declaration of a function without a prototype is deprecated", may be slightly better? ================ Comment at: clang/lib/Sema/SemaDecl.cpp:3881 + if (WithProto->getNumParams() != 0) { + // The function definition has parameters, so this will change + // behavior in C2x. ---------------- I wonder if - This shouldn't be placed in a separate function for clarity - We could bail out early for built ins ? ================ Comment at: clang/lib/Sema/SemaType.cpp:5560-5562 if (!LangOpts.CPlusPlus && - D.getFunctionDefinitionKind() == FunctionDefinitionKind::Declaration) { + (D.getFunctionDefinitionKind() == FunctionDefinitionKind::Declaration || + D.getFunctionDefinitionKind() == FunctionDefinitionKind::Definition)) { ---------------- `if (!LangOpts.CPlusPlus)` is probably enough here CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122895/new/ https://reviews.llvm.org/D122895 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits