[cfe-dev] libc++ fails to build with exception disabled

Konstantin Tokarev annulen at yandex.ru
Mon Jun 11 08:24:25 PDT 2012


Hi all,

I've tried to build libc++ on Linux using clang with LIBCXX_ENABLE_EXCEPTIONS=OFF in CMake-based build system, but got compilation error:

cd /home/kostya/src/git/libcxx/build-noexcept/lib && /usr/local/bin/clang++   -Dcxx_EXPORTS -D_LIBCPP_NO_EXCEPTIONS -DNDEBUG -fPIC -I/home/kostya/src/git/libcxx/include    -nostdinc++ -std=c++0x -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-long-long -fno-exceptions -fPIC -o CMakeFiles/cxx.dir/__/src/debug.cpp.o -c /home/kostya/src/git/libcxx/src/debug.cpp
/home/kostya/src/git/libcxx/src/debug.cpp:149:13: error: cannot use 'throw' with exceptions disabled
            throw bad_alloc();
            ^
/home/kostya/src/git/libcxx/src/debug.cpp:170:9: error: cannot use 'throw' with exceptions disabled
        throw bad_alloc();
        ^
/home/kostya/src/git/libcxx/src/debug.cpp:405:13: error: cannot use 'throw' with exceptions disabled
            throw bad_alloc();
            ^
/home/kostya/src/git/libcxx/src/debug.cpp:427:13: error: cannot use 'throw' with exceptions disabled
            throw bad_alloc();
            ^
/home/kostya/src/git/libcxx/src/debug.cpp:448:9: error: cannot use 'throw' with exceptions disabled
        throw bad_alloc();
        ^
5 errors generated.


Is it a bug or LIBCXX_ENABLE_EXCEPTIONS option is not supported and should be removed?

-- 
Regards,
Konstantin



More information about the cfe-dev mailing list