https://bugs.llvm.org/show_bug.cgi?id=44250

            Bug ID: 44250
           Summary: missing-noreturn and constexpr-if
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Clang says that this function should be labelled as noreturn which is not true
when the constexpr is false. Since we do not have conditional noreturn
statements, and noreturn is not part of the function's signature, this is a
false positive. 

    static auto
    fail_fast() noexcept -> void
    {
        if constexpr (!autosar_compliant) {
            if constexpr (details::autosar::exit_instead_of_abort) {
                std::exit(EXIT_FAILURE);    //NOSONAR
            }

            std::abort();    //NOSONAR
        }
    }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to