diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 09:27:48 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:35 +0000 |
commit | 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b (patch) | |
tree | 07259601270022a6cbeb89826560262f015e1589 /gdb/cli/cli-cmds.c | |
parent | 6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff) | |
download | binutils-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.zip binutils-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.gz binutils-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.bz2 |
gdb: Replace gdb::optional with std::optional
Since GDB now requires C++17, we don't need the internally maintained
gdb::optional implementation. This patch does the following replacing:
- gdb::optional -> std::optional
- gdb::in_place -> std::in_place
- #include "gdbsupport/gdb_optional.h" -> #include <optional>
This change has mostly been done automatically. One exception is
gdbsupport/thread-pool.* which did not use the gdb:: prefix as it
already lives in the gdb namespace.
Change-Id: I19a92fa03e89637bab136c72e34fd351524f65e9
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r-- | gdb/cli/cli-cmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index fd93e5b..cb9ff55 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -655,12 +655,12 @@ show_script_ext_mode (struct ui_file *file, int from_tty, If SEARCH_PATH is non-zero, and the file isn't found in cwd, search for it in the source search path. */ -gdb::optional<open_script> +std::optional<open_script> find_and_open_script (const char *script_file, int search_path) { int fd; openp_flags search_flags = OPF_TRY_CWD_FIRST | OPF_RETURN_REALPATH; - gdb::optional<open_script> opened; + std::optional<open_script> opened; gdb::unique_xmalloc_ptr<char> file (tilde_expand (script_file)); @@ -742,7 +742,7 @@ source_script_with_search (const char *file, int from_tty, int search_path) if (file == NULL || *file == 0) error (_("source command requires file name of file to source.")); - gdb::optional<open_script> opened = find_and_open_script (file, search_path); + std::optional<open_script> opened = find_and_open_script (file, search_path); if (!opened) { /* The script wasn't found, or was otherwise inaccessible. |