[C11/C2x] Change the behavior of the implicit function declaration warningC89 had a questionable feature where the compiler would implicitlydeclare a function that the user called but was never pr
[C11/C2x] Change the behavior of the implicit function declaration warningC89 had a questionable feature where the compiler would implicitlydeclare a function that the user called but was never previouslydeclared. The resulting function would be globally declared asextern int func(); -- a function without a prototype which accepts zeroor more arguments.C99 removed support for this questionable feature due to severesecurity concerns. However, there was no deprecation period; C89 hadthe feature, C99 didn't. So Clang (and GCC) both supported thefunctionality as an extension in C99 and later modes.C2x no longer supports that function signature as it now requires allfunctions to have a prototype, and given the known security issues withthe feature, continuing to support it as an extension is not tenable.This patch changes the diagnostic behavior for the-Wimplicit-function-declaration warning group depending on the languagemode in effect. We continue to warn by default in C89 mode (due to thefeature being dangerous to use). However, because this feature will notbe supported in C2x mode, we've diagnosed it as being invalid for solong, the security concerns with the feature, and the trivialworkaround for users (declare the function), we now default theextension warning to an error in C99-C17 mode. This still gives usersan easy workaround if they are extensively using the extension in thosemodes (they can disable the warning or use -Wno-error to downgrade theerror), but the new diagnostic makes it more clear that this feature isnot supported and should be avoided. In C2x mode, we no longer allow animplicit function to be defined and treat the situation the same as anyother lookup failure.Differential Revision: https://reviews.llvm.org/D122983
show more ...
[AIX][ZOS] Disable LIT tests on AIX and z/OS due to lack of Objective-C supportAIX and z/OS lack Objective-C support, so mark these tests as unsupported for AIX and z/OS.Reviewed By: jsjiDiffer
[AIX][ZOS] Disable LIT tests on AIX and z/OS due to lack of Objective-C supportAIX and z/OS lack Objective-C support, so mark these tests as unsupported for AIX and z/OS.Reviewed By: jsjiDifferential Revision: https://reviews.llvm.org/D109060
[CodeGen] Emit destructor calls to destruct compound literalsFix a bug in IRGen where it wasn't destructing compound literals in Cthat are ObjC pointer arrays or non-trivial structs. Also diagnose
[CodeGen] Emit destructor calls to destruct compound literalsFix a bug in IRGen where it wasn't destructing compound literals in Cthat are ObjC pointer arrays or non-trivial structs. Also diagnose jumpsthat enter or exit the lifetime of the compound literals.rdar://problem/51867864Differential Revision: https://reviews.llvm.org/D64464