aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorAndrew Oates <andrew@andrewoates.com>2025-02-16 16:16:25 +0100
committerTom de Vries <tdevries@suse.de>2025-02-16 16:16:25 +0100
commit3aaca06b672010329144b88f5788e379c3cc74cb (patch)
tree91dd9cf8629f5b7e9c6c5a8a1370b326508d9898 /gdb/cli
parent5b4873b6de66a869c11b5bdaae9f76682c7fe600 (diff)
downloadbinutils-3aaca06b672010329144b88f5788e379c3cc74cb.zip
binutils-3aaca06b672010329144b88f5788e379c3cc74cb.tar.gz
binutils-3aaca06b672010329144b88f5788e379c3cc74cb.tar.bz2
gdb: fix color_option_def compile error (clang)
color_option_def was added in commit 6447969d0 ("Add an option with a color type."), but not used. The color_option_def constructor passes the wrong number of arguments to the option_def constructor. Since color_option_def is a template and never actually instantiated, GCC does not fail to compile this. clang generates an error (see below). This passes nullptr to the extra_literals_ option_def ctor argument, which matches what filename_option_def above it does. clang's generated error: ../../gdb/cli/cli-option.h:343:7: error: no matching constructor for initialization of 'option_def' : option_def (long_option_, var_color, ^ ~~~~~~~~~~~~~~~~~~~~~~~~ ../../gdb/cli/cli-option.h:50:13: note: candidate constructor not viable: requires 8 arguments, but 7 were provided constexpr option_def (const char *name_, ^ ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 7 were provided struct option_def ^ ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 7 were provided Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-option.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h
index ac614c3..38dcd82 100644
--- a/gdb/cli/cli-option.h
+++ b/gdb/cli/cli-option.h
@@ -340,7 +340,7 @@ struct color_option_def : option_def
const char *set_doc_,
const char *show_doc_ = nullptr,
const char *help_doc_ = nullptr)
- : option_def (long_option_, var_color,
+ : option_def (long_option_, var_color, nullptr,
(erased_get_var_address_ftype *) get_var_address_cb_,
show_cmd_cb_,
set_doc_, show_doc_, help_doc_)