On Dienstag, 11. Januar 2022 13:35:05 CET Christian Schoenebeck wrote: > Curiousity was stronger: the original clang behaviour was as I explained: > https://github.com/llvm-mirror/clang/commit/0a0d2b179085a52c10402feebeb6db8b > 4d96a140#diff-97c4322e86bf436b7f79f4fcafc4b7beb092da08c5c23f294f98b5bb0a7f9a > 31 > > Quote: > > " > For example, > > void foo() > > __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsolete > d=10.6))); > > ... > > - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" > will result in a deprecation warning, as if we had placed > attribute((deprecated)) on it ... > " > > Relevant code section (in that original commit): > > static AvailabilityResult CheckAvailability(ASTContext &Context, > const AvailabilityAttr *A, > std::string *Message) { > ... > VersionTuple TargetMinVersion = Context.Target.getPlatformMinVersion(); > ... > // Make sure that this declaration hasn't been deprecated. > if (!A->getDeprecated().empty() && TargetMinVersion >= A->getDeprecated())
Stupid me, you are right. No deprecated warning unless minimum deployment target is >= the attribute's deprecated version. So it was always like this. My bad. :) > { if (Message) { > Message->clear(); > llvm::raw_string_ostream Out(*Message); > Out << "first deprecated in " << PrettyPlatformName << ' ' > << A->getDeprecated(); > } > > return AR_Deprecated; > } > ... > } Best regards, Christian Schoenebeck