From 7e0f376cf3301d8736ae2d92eb51febef2394713 Mon Sep 17 00:00:00 2001 From: Alde Rojas Date: Fri, 11 Sep 2026 02:43:14 -0500 Subject: [PATCH] tests : take the schema label as const char * to satisfy gcc dangling-reference --- tests/test-json-schema.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-json-schema.cpp b/tests/test-json-schema.cpp index fd14c26f57..32bfb4a9c5 100644 --- a/tests/test-json-schema.cpp +++ b/tests/test-json-schema.cpp @@ -14,10 +14,10 @@ static common_schema_document parse(const std::string & schema) { // the node as T, aborting the current test when it is some other kind template -static const T & as(testing & t, const common_schema * node, std::string what) { +static const T & as(testing & t, const common_schema * node, const char * what) { const T * typed = dynamic_cast(node); - if (!t.assert_true(what + " has the expected kind", typed != nullptr)) { - throw std::runtime_error(what + " has the wrong kind"); + if (!t.assert_true(std::string(what) + " has the expected kind", typed != nullptr)) { + throw std::runtime_error(std::string(what) + " has the wrong kind"); } return *typed; }