llvm-project/clang/test/FixIt
Aaron Ballman 11da1b53d8 [C89/C2x] Improve diagnostics around strict prototypes in C
Functions without prototypes in C (also known as K&R C functions) were
introduced into C89 as a deprecated feature and C2x is now reclaiming
that syntax space with different semantics. However, Clang's
-Wstrict-prototypes diagnostic is off-by-default (even in pedantic
mode) and does not suffice to warn users about issues in their code.

This patch changes the behavior of -Wstrict-prototypes to only diagnose
declarations and definitions which are not going to change behavior in
C2x mode, and enables the diagnostic in -pedantic mode. The diagnostic
is now specifically about the fact that the feature is deprecated.

It also adds -Wdeprecated-non-prototype, which is grouped under
-Wstrict-prototypes and diagnoses declarations or definitions which
will change behavior in C2x mode. This diagnostic is enabled by default
because the risk is higher for the user to continue to use the
deprecated feature.

Differential Revision: https://reviews.llvm.org/D122895
2022-04-08 16:19:58 -04:00
..
Inputs
atomic-property.m
auto-fixit.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
auto-isa-fixit.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
bridge-cast-in-arc.mm
bridge-in-non-arc.m
dereference-addressof.c
fixit-add-synthesize-to-property.m
fixit-autoreleasepool.m
fixit-availability-maccatalyst.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-availability.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-availability.mm
fixit-c++2a.cpp
fixit-c++11.cpp [clang] [C++2b] [P1102] Accept lambdas without parameter list (). 2021-03-24 14:42:27 +01:00
fixit-c90.c
fixit-class-method-messaging.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-cxx-init-order.cpp [clang] Add fixit for Wreorder-ctor 2021-03-24 19:22:53 +00:00
fixit-cxx1y-compat.cpp
fixit-cxx11-attributes.cpp
fixit-cxx11-compat.cpp
fixit-eof-space.c
fixit-errors-1.c
fixit-errors.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-format-darwin.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-format-ios-nopedantic.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-format-ios.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-function-call.cpp
fixit-include.c
fixit-include.h
fixit-interface-as-param.m
fixit-large-file.cpp
fixit-missing-method-return-type.m
fixit-missing-self-in-block.m
fixit-multiple-selector-warnings.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-newline-style.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-nsstring-compare.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-nullability-declspec.cpp
fixit-objc-arc.m
fixit-objc-bridge-related-attr.m
fixit-objc-bridge-related-property.m
fixit-objc-bridge-related.m
fixit-objc-direct.m
fixit-objc-message-comma-separator.m
fixit-objc-message.m
fixit-objc-missing-method-impl.m Reland "[clang][ObjC] Add fix it for missing methods in impl" 2022-01-06 10:55:02 -05:00
fixit-objc.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-pmem.cpp
fixit-pragma-attribute.c [Clang] Support multiple attributes in a single pragma 2022-03-18 12:20:41 +00:00
fixit-pragma-attribute.cpp [Clang] Support multiple attributes in a single pragma 2022-03-18 12:20:41 +00:00
fixit-pragma-pack.c
fixit-recompile.c
fixit-recursive-block.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-static-assert.cpp
fixit-static-object-decl.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-suffix.c
fixit-typedef-instead-of-typename-typo.cpp
fixit-unicode-with-utf8-output.c
fixit-unicode.c Implement P1949 2021-08-18 07:33:14 -04:00
fixit-uninit.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
fixit-unrecoverable.c
fixit-unrecoverable.cpp
fixit-unused-lambda-capture.cpp
fixit-vexing-parse-cxx0x.cpp
fixit-vexing-parse.cpp
fixit.c [C89/C2x] Improve diagnostics around strict prototypes in C 2022-04-08 16:19:58 -04:00
fixit.cpp [clang] Stop providing builtin overload candidate for relational function pointer comparisons 2021-06-26 00:08:02 +02:00
format-darwin.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
format-no-fixit.m
format.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
format.mm
member-mismatch.cpp [Sema] Add FixIt when a C++ out-of-line method has extra/missing const 2021-12-15 14:30:54 +01:00
messages.cpp
multiarg-selector-fixit.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
no-diagnostics-fixit-info.c
no-fixit.cpp
no-macro-fixit.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
no-typo.c
nullability.mm
objc-literals.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
property-access-fixit.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
selector-fixit.m
typo-crash.cpp
typo-crash.m
typo-location-bugs.cpp
typo-using.cpp
typo.c Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00
typo.cpp
typo.m Use functions with prototypes when appropriate; NFC 2022-02-09 17:16:10 -05:00