[libcxx] r337519 - Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 19 18:44:33 PDT 2018


Author: ericwf
Date: Thu Jul 19 18:44:33 2018
New Revision: 337519

URL: http://llvm.org/viewvc/llvm-project?rev=337519&view=rev
Log:
Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return

Modified:
    libcxx/trunk/include/experimental/filesystem
    libcxx/trunk/src/experimental/filesystem/filesystem_common.h

Modified: libcxx/trunk/include/experimental/filesystem
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=337519&r1=337518&r2=337519&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/filesystem (original)
+++ libcxx/trunk/include/experimental/filesystem Thu Jul 19 18:44:33 2018
@@ -232,6 +232,7 @@
 
 #include <experimental/__config>
 #include <cstddef>
+#include <cstdlib>
 #include <chrono>
 #include <iterator>
 #include <iosfwd>
@@ -2250,6 +2251,7 @@ private:
           __ec->clear();
         return __data_.__type_;
       }
+      _LIBCPP_UNREACHABLE();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2270,6 +2272,7 @@ private:
         return __data_.__type_;
       }
       }
+      _LIBCPP_UNREACHABLE();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2284,6 +2287,7 @@ private:
       case _RefreshSymlink:
         return file_status(__get_ft(__ec), __data_.__non_sym_perms_);
       }
+      _LIBCPP_UNREACHABLE();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2299,6 +2303,7 @@ private:
       case _RefreshSymlinkUnresolved:
         return file_status(__get_sym_ft(__ec), __data_.__sym_perms_);
       }
+      _LIBCPP_UNREACHABLE();
     }
 
 
@@ -2324,6 +2329,7 @@ private:
         return __data_.__size_;
       }
       }
+      _LIBCPP_UNREACHABLE();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2342,6 +2348,7 @@ private:
         return __data_.__nlink_;
       }
       }
+      _LIBCPP_UNREACHABLE();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -2364,6 +2371,7 @@ private:
         return __data_.__write_time_;
       }
       }
+      _LIBCPP_UNREACHABLE();
     }
 private:
     _Path __p_;

Modified: libcxx/trunk/src/experimental/filesystem/filesystem_common.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/filesystem_common.h?rev=337519&r1=337518&r2=337519&view=diff
==============================================================================
--- libcxx/trunk/src/experimental/filesystem/filesystem_common.h (original)
+++ libcxx/trunk/src/experimental/filesystem/filesystem_common.h Thu Jul 19 18:44:33 2018
@@ -228,8 +228,8 @@ public:
 } // namespace time_util
 
 
-using TimeSpec = struct timespec;
-using StatT = struct stat;
+using TimeSpec = struct ::timespec;
+using StatT = struct ::stat;
 
 using FSTime = time_util::fs_time_util<file_time_type, time_t, struct timespec>;
 




More information about the cfe-commits mailing list