Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337519 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2018-07-20 01:44:33 +00:00
parent f8bfc79ac5
commit 0f8ee948c3
2 changed files with 10 additions and 2 deletions

View File

@@ -232,6 +232,7 @@
#include <experimental/__config> #include <experimental/__config>
#include <cstddef> #include <cstddef>
#include <cstdlib>
#include <chrono> #include <chrono>
#include <iterator> #include <iterator>
#include <iosfwd> #include <iosfwd>
@@ -2250,6 +2251,7 @@ private:
__ec->clear(); __ec->clear();
return __data_.__type_; return __data_.__type_;
} }
_LIBCPP_UNREACHABLE();
} }
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -2270,6 +2272,7 @@ private:
return __data_.__type_; return __data_.__type_;
} }
} }
_LIBCPP_UNREACHABLE();
} }
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -2284,6 +2287,7 @@ private:
case _RefreshSymlink: case _RefreshSymlink:
return file_status(__get_ft(__ec), __data_.__non_sym_perms_); return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
} }
_LIBCPP_UNREACHABLE();
} }
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -2299,6 +2303,7 @@ private:
case _RefreshSymlinkUnresolved: case _RefreshSymlinkUnresolved:
return file_status(__get_sym_ft(__ec), __data_.__sym_perms_); return file_status(__get_sym_ft(__ec), __data_.__sym_perms_);
} }
_LIBCPP_UNREACHABLE();
} }
@@ -2324,6 +2329,7 @@ private:
return __data_.__size_; return __data_.__size_;
} }
} }
_LIBCPP_UNREACHABLE();
} }
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -2342,6 +2348,7 @@ private:
return __data_.__nlink_; return __data_.__nlink_;
} }
} }
_LIBCPP_UNREACHABLE();
} }
_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
@@ -2364,6 +2371,7 @@ private:
return __data_.__write_time_; return __data_.__write_time_;
} }
} }
_LIBCPP_UNREACHABLE();
} }
private: private:
_Path __p_; _Path __p_;

View File

@@ -228,8 +228,8 @@ public:
} // namespace time_util } // namespace time_util
using TimeSpec = struct timespec; using TimeSpec = struct ::timespec;
using StatT = struct stat; using StatT = struct ::stat;
using FSTime = time_util::fs_time_util<file_time_type, time_t, struct timespec>; using FSTime = time_util::fs_time_util<file_time_type, time_t, struct timespec>;