From df43e47c00e758e07be3afa425892c6a181a1694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 20 May 2024 14:50:02 -0300 Subject: [PATCH] parse_args(): work around GCC 12 warning bug. This bug [1] causes GCC to emit a wrong warning when adding a short string literal to a std::string. Wrapping the literal in a std::string doesn't have a large impact and avoids the warning. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 --- include/argparse/argparse.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index 921a4b4..1269863 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -1831,9 +1831,9 @@ public: for (Argument *arg : group.m_elements) { if (i + 1 == size) { // last - argument_names += "'" + arg->get_usage_full() + "' "; + argument_names += std::string("'") + arg->get_usage_full() + std::string("' "); } else { - argument_names += "'" + arg->get_usage_full() + "' or "; + argument_names += std::string("'") + arg->get_usage_full() + std::string("' or "); } i += 1; }