[libcxx-commits] [PATCH] D118733: [libc++] Remove the std::string base class

Dimitry Andric via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 9 06:33:34 PST 2022


dim added a comment.

FWIW, this breaks compilation of Firefox:

  In file included from Unified_cpp_accessible_base1.cpp:20:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/firefox-97.0/accessible/base/TextLeafRange.cpp:11:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/a11y/DocAccessibleParent.h:11:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/ipc/ipdl/_ipdlheaders/mozilla/a11y/PDocAccessibleParent.h:9:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/ipc/ipdl/_ipdlheaders/mozilla/a11y/PDocAccessible.h:24:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/a11y/IPCTypes.h:16:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/GfxMessageUtils.h:30:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/ipc/ProtocolUtils.h:27:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/ipc/MessageChannel.h:23:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/stl_wrappers/stack:64:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/system_wrappers/stack:3:
  In file included from /usr/include/c++/v1/stack:105:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/stl_wrappers/deque:64:
  In file included from /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/system_wrappers/deque:3:
  /usr/include/c++/v1/deque:1854:9: error: call to '__throw_out_of_range' is ambiguous
          _VSTD::__throw_out_of_range("deque");
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/c++/v1/__config:824:15: note: expanded from macro '_VSTD'
  #define _VSTD std
                ^
  /wrkdirs/share/dim/ports/www/firefox/work/.build/dist/include/mozilla/throw_gcc.h:97:59: note: candidate function
  MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_out_of_range(
                                                            ^
  /usr/include/c++/v1/stdexcept:264:6: note: candidate function
  void __throw_out_of_range(const char*__msg)
       ^

That said, they're doing very naughty things in e.g. https://hg.mozilla.org/mozilla-central/file/tip/memory/mozalloc/throw_gcc.h#l47 :

  namespace std {
  
  // NB: user code is not supposed to touch the std:: namespace.  We're
  // doing this after careful review because we want to define our own
  // exception throwing semantics.  Don't try this at home!
  
  MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_bad_exception(
      void) {
    mozalloc_abort("fatal: STL threw bad_exception");
  }
  
  [...]
  
  MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_out_of_range(
      const char* msg) {
    mozalloc_abort(msg);
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118733/new/

https://reviews.llvm.org/D118733



More information about the libcxx-commits mailing list