From cb8bc831bdacbb07e25308a2796f5f53af689513 Mon Sep 17 00:00:00 2001 From: mxHuber Date: Sun, 28 Apr 2024 11:33:59 +0200 Subject: [PATCH] Optimized deprecation warinings for getAsJson --- include/phasar/Pointer/AliasInfo.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/phasar/Pointer/AliasInfo.h b/include/phasar/Pointer/AliasInfo.h index d93d4f064..3ab63412e 100644 --- a/include/phasar/Pointer/AliasInfo.h +++ b/include/phasar/Pointer/AliasInfo.h @@ -138,7 +138,8 @@ class AliasInfoRef : public AnalysisPropertiesMixin> { VT->Print(AA, OS); } - [[nodiscard]] nlohmann::json getAsJson() const { + [[nodiscard, deprecated("Use printAsJson() instead")]] nlohmann::json + getAsJson() const { assert(VT != nullptr); return VT->GetAsJson(AA); } @@ -239,11 +240,13 @@ class AliasInfoRef : public AnalysisPropertiesMixin> { static_cast(AA)->print(OS); }, [](const void *AA) noexcept { - /// TODO: die commit changes von fabian nehmen +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated" if constexpr (has_getAsJson::value) { return static_cast(AA)->getAsJson(); } return nlohmann::json(); +#pragma GCC diagnostic pop }, [](const void *AA, llvm::raw_ostream &OS) { static_cast(AA)->printAsJson(OS);