mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
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
This commit is contained in:
parent
f0759fd982
commit
df43e47c00
@ -1831,9 +1831,9 @@ public:
|
|||||||
for (Argument *arg : group.m_elements) {
|
for (Argument *arg : group.m_elements) {
|
||||||
if (i + 1 == size) {
|
if (i + 1 == size) {
|
||||||
// last
|
// last
|
||||||
argument_names += "'" + arg->get_usage_full() + "' ";
|
argument_names += std::string("'") + arg->get_usage_full() + std::string("' ");
|
||||||
} else {
|
} else {
|
||||||
argument_names += "'" + arg->get_usage_full() + "' or ";
|
argument_names += std::string("'") + arg->get_usage_full() + std::string("' or ");
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user