mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-03 22:14:33 +08:00
added [[noreturn]] attribute to pybind11_fail
This commit is contained in:
parent
87810d8e91
commit
fc92d82bba
@ -56,7 +56,6 @@ public:
|
|||||||
/* This function has no arguments. The trailing comma
|
/* This function has no arguments. The trailing comma
|
||||||
in the previous line is needed for some compilers */
|
in the previous line is needed for some compilers */
|
||||||
);
|
);
|
||||||
throw std::runtime_error("this will never be reached");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void pure_virtual() {
|
virtual void pure_virtual() {
|
||||||
|
|||||||
@ -324,7 +324,7 @@ struct error_already_set : public std::runtime_error { public: error_already_set
|
|||||||
/// Thrown when pybind11::cast or handle::call fail due to a type casting error
|
/// Thrown when pybind11::cast or handle::call fail due to a type casting error
|
||||||
struct cast_error : public std::runtime_error { public: cast_error(const std::string &w = "") : std::runtime_error(w) {} };
|
struct cast_error : public std::runtime_error { public: cast_error(const std::string &w = "") : std::runtime_error(w) {} };
|
||||||
|
|
||||||
PYBIND11_NOINLINE inline void pybind11_fail(const char *reason) { throw std::runtime_error(reason); }
|
[[noreturn]] PYBIND11_NOINLINE inline void pybind11_fail(const char *reason) { throw std::runtime_error(reason); }
|
||||||
PYBIND11_NOINLINE inline void pybind11_fail(const std::string &reason) { throw std::runtime_error(reason); }
|
[[noreturn]] PYBIND11_NOINLINE inline void pybind11_fail(const std::string &reason) { throw std::runtime_error(reason); }
|
||||||
|
|
||||||
NAMESPACE_END(pybind11)
|
NAMESPACE_END(pybind11)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user