[llvm-bugs] [Bug 48684] error: no return statement in constexpr function for templated MPI_Datatype

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 7 17:47:52 PST 2021


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
The code in question:

template <typename num>
constexpr MPI_Datatype get_mpi_type() {
throw std::logic_error("ERROR: get_mpi_type NOT IMPLEMENTED FOR THIS
DATATYPE");
}

This violates the language rules: no specialization of this function could ever
be used in a constant expression, so a compiler is permitted (but not required)
to diagnose it. Try removing the 'constexpr' from this declaration.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210108/46912453/attachment.html>


More information about the llvm-bugs mailing list