[libcxx-commits] [PATCH] D111892: [SystemZ][z/OS] Raise assertion error when using unimplemented functions

Muiez Ahmed via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 15 08:58:08 PDT 2021


muiez created this revision.
muiez added reviewers: ldionne, ctetreau, libc++.
muiez requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

The path functions in this patch are unimplemented (as per the TODO comment from upstream). To avoid running into a linker error (missing symbol), this patch raises an assertion error during runtime to highlight the unimplemented function(s), which is more user friendly.

This approach has been confirmed by emailing the llvm-dev mailing-list. It was mentioned that there is no plan to implement those functions yet, and providing a function body that asserts is something we could do.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111892

Files:
  libcxx/include/filesystem


Index: libcxx/include/filesystem
===================================================================
--- libcxx/include/filesystem
+++ libcxx/include/filesystem
@@ -259,6 +259,7 @@
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+# include <cassert> // for unimplemented path functions
 # include <locale>
 # include <iomanip> // for quoted
 #endif
@@ -969,10 +970,14 @@
 #if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
   // TODO Implement locale conversions.
   template <class _Source, class = _EnableIfPathable<_Source, void> >
-  path(const _Source& __src, const locale& __loc, format = format::auto_format);
+  path(const _Source& __src, const locale& __loc, format = format::auto_format) {
+    assert(false && "locale conversions are unimplemented");
+  }
   template <class _InputIt>
   path(_InputIt __first, _InputIt _last, const locale& __loc,
-       format = format::auto_format);
+       format = format::auto_format) {
+         assert(false && "locale conversions are unimplemented");
+       }
 #endif
 
   _LIBCPP_INLINE_VISIBILITY


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111892.380025.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211015/6d2b2bd5/attachment.bin>


More information about the libcxx-commits mailing list