Opened 8 years ago

Closed 7 years ago

#11175 closed Bugs (fixed)

signals2, filesystem, probably others fail on clang targeting win32 when exceptions are disabled

Reported by: hlandau@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

To reproduce:

  clang -fno-exceptions -std=c++14 reprod.cpp

reprod.cpp:

  #include <boost/filesystem.hpp>
  #include <boost/signals2.hpp>

You can target win32 from Linux using wclang (https://github.com/tpoechtrager/wclang), though you must have a i686-w64-mingw32 environment installed. Substitute 'clang' for 'w32-clang' above. This is how I tested; since clang is rather universal as a compiler, these errors likely also occur when compiling for win32 on win32.

The documentation for filesystem3 indicates that it should be usable with exceptions disabled, so this is a bug.

Errors:

                                                                                                             

In file included from reprod.cpp:1:
In file included from /usr/i686-w64-mingw32/local/include/boost/filesystem.hpp:17:
/usr/i686-w64-mingw32/local/include/boost/filesystem/operations.hpp:80:9: error: cannot use 'try' with exceptions
      disabled
        try
        ^
/usr/i686-w64-mingw32/local/include/boost/filesystem/operations.hpp:92:9: error: cannot use 'try' with exceptions
      disabled
        try
        ^
/usr/i686-w64-mingw32/local/include/boost/filesystem/operations.hpp:105:9: error: cannot use 'try' with
      exceptions disabled
        try
        ^
/usr/i686-w64-mingw32/local/include/boost/filesystem/operations.hpp:132:9: error: cannot use 'try' with
      exceptions disabled
        try
        ^
/usr/i686-w64-mingw32/local/include/boost/filesystem/operations.hpp:1005:11: error: cannot use 'throw' with
      exceptions disabled
          BOOST_FILESYSTEM_THROW(filesystem_error(
          ^
/usr/i686-w64-mingw32/local/include/boost/filesystem/config.hpp:46:36: note: expanded from macro
      'BOOST_FILESYSTEM_THROW'
#define BOOST_FILESYSTEM_THROW(EX) throw EX
                                   ^
In file included from reprod.cpp:2:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2.hpp:16:
/usr/i686-w64-mingw32/local/include/boost/signals2/deconstruct_ptr.hpp:43:9: error: cannot use 'try' with
      exceptions disabled
        try
        ^
In file included from reprod.cpp:2:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2.hpp:18:
/usr/i686-w64-mingw32/local/include/boost/signals2/last_value.hpp:45:11: error: cannot use 'try' with exceptions
      disabled
          try
          ^
/usr/i686-w64-mingw32/local/include/boost/signals2/last_value.hpp:66:11: error: cannot use 'try' with exceptions
      disabled
          try
          ^
In file included from reprod.cpp:2:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2.hpp:19:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2/signal.hpp:28:
/usr/i686-w64-mingw32/local/include/boost/signals2/detail/slot_call_iterator.hpp:87:15: error: cannot use 'throw'
      with exceptions disabled
              throw;
              ^
/usr/i686-w64-mingw32/local/include/boost/signals2/detail/slot_call_iterator.hpp:80:13: error: cannot use 'try'
      with exceptions disabled
            try
            ^
In file included from reprod.cpp:2:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2.hpp:19:
In file included from /usr/i686-w64-mingw32/local/include/boost/signals2/signal.hpp:29:
/usr/i686-w64-mingw32/local/include/boost/signals2/optional_last_value.hpp:32:11: error: cannot use 'try' with
      exceptions disabled
          try
          ^
/usr/i686-w64-mingw32/local/include/boost/signals2/optional_last_value.hpp:53:11: error: cannot use 'try' with
      exceptions disabled
          try
          ^
12 errors generated.

Change History (1)

comment:1 by Beman Dawes, 7 years ago

Resolution: fixed
Status: newclosed

The problem was out-of-date documentation causing users to incorrectly expect that the library could be used with exceptions disabled. It cannot be used without exceptions, and the documentation has been changed to reflect this reality.

Sorry for the confusion,

--Beman

Note: See TracTickets for help on using tickets.