Skip to content

add_flag is ambiguous with c++20 #662

@steffenb7333

Description

@steffenb7333

Code:

#include <CLI/CLI.hpp>

int main()
{
    auto app = CLI::App{"test"};
    auto flag = app.add_flag("--flag", "desc");
    return 0;
}

Compiling with
g++ -std=c++20 cli11.cpp

results in

cli11.cpp: In function 'int main()':
cli11.cpp:6:29: error: call of overloaded 'add_flag(const char [7], const char [5])' is ambiguous

CLI11 is version 2.1.2. g++ is 11.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions