Skip to content

Wrong C++ version check for span_HAVE_NORETURN? #83

@simark

Description

@simark

Compiling as C++11, I see:

/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:831:1: error: function 'throw_out_of_range' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
  831 | {
      | ^
/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:854:1: error: function 'report_contract_violation' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
  854 | {
      | ^

The definition of span_HAVE_NORETURN is:

 #define span_HAVE_NORETURN                  span_CPP17_000

cppreference says it's available in C++11:

https://en.cppreference.com/w/cpp/language/attributes/noreturn

So I guess the definition of span_HAVE_RETURN should be span_CPP11_OR_GREATER or one of the span_CPP11_* ones. I have no idea about the support of MSVC for this, unfortunately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions