Note that there are some explanatory texts on larger screens.

plurals
  1. POlibc++ Error in instantiation of exception specification for vector and string compiling simple code
    text
    copied!<p>I get errors when compiling this simple code and if I remove the noexcept I don't get the error:</p> <pre><code>#include&lt;vector&gt; #include&lt;string&gt; class Foo { public: protected: Foo(Foo&amp;&amp;) noexcept = default; Foo&amp; operator=(Foo&amp;&amp;) noexcept = default; Foo() { } private: std::vector&lt;std::string&gt; vectorFoo_; }; </code></pre> <p>This is the errors I get, I understand it is in the instantiation of the exception specification, but I doubt the std::string is not nothrow move constructible,.. the first error make me think there is a bug. </p> <blockquote> <p>In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: /usr/local/bin/../lib/c++/v1/vector:575:67: error: no member named 'value' in 'std::__1::is_nothrow_move_constructible, std::__1::allocator > > >' <em>NOEXCEPT</em>(is_nothrow_move_constructible::value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:264: /usr/local/bin/../lib/c++/v1/__config:325:34: note: expanded from macro '<em>NOEXCEPT</em>' define <em>NOEXCEPT</em>(x) noexcept(x) ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:29:29: note: in instantiation of exception specification for 'vector' requested here std::vector vectorFoo_; ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:265: In file included from /usr/local/bin/../lib/c++/v1/__bit_reference:15: In file included from /usr/local/bin/../lib/c++/v1/algorithm:624: /usr/local/bin/../lib/c++/v1/type_traits:2676:53: note: in instantiation of template class 'std::__1::add_rvalue_reference, std::__1::allocator > > >' requested here : public is_nothrow_constructible&lt;_Tp, typename add_rvalue_reference&lt;<em>Tp>::type> ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: /usr/local/bin/../lib/c++/v1/vector:575:20: note: in instantiation of template class 'std::</em>_1::is_nothrow_move_constructible, std::__1::allocator > > >' requested here <em>NOEXCEPT</em>(is_nothrow_move_constructible::value); ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:264: /usr/local/bin/../lib/c++/v1/__config:325:34: note: expanded from macro '<em>NOEXCEPT</em>' define <em>NOEXCEPT</em>(x) noexcept(x) ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:29:29: note: in instantiation of exception specification for 'vector' requested here std::vector vectorFoo_; ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: /usr/local/bin/../lib/c++/v1/vector:582:58: error: no member named 'value' in 'std::__1::is_nothrow_move_assignable, std::__1::allocator > > >' is_nothrow_move_assignable::value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:264: /usr/local/bin/../lib/c++/v1/__config:325:34: note: expanded from macro '<em>NOEXCEPT</em>' define <em>NOEXCEPT</em>(x) noexcept(x) ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:29:29: note: in instantiation of exception specification for 'operator=' requested here std::vector vectorFoo_; ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:265: In file included from /usr/local/bin/../lib/c++/v1/__bit_reference:15: In file included from /usr/local/bin/../lib/c++/v1/algorithm:624: /usr/local/bin/../lib/c++/v1/type_traits:2760:45: note: in instantiation of template class 'std::__1::add_lvalue_reference, std::__1::allocator > > >' requested here : public is_nothrow_assignableTp>::type, ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: /usr/local/bin/../lib/c++/v1/vector:582:14: note: in instantiation of template class 'std::_1::is_nothrow_move_assignable, std::__1::allocator > > >' requested here is_nothrow_move_assignable::value); ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:264: /usr/local/bin/../lib/c++/v1/__config:325:34: note: expanded from macro '<em>NOEXCEPT</em>' define <em>NOEXCEPT</em>(x) noexcept(x) ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:29:29: note: in instantiation of exception specification for 'operator=' requested here std::vector vectorFoo_; ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:265: In file included from /usr/local/bin/../lib/c++/v1/__bit_reference:15: In file included from /usr/local/bin/../lib/c++/v1/algorithm:624: /usr/local/bin/../lib/c++/v1/type_traits:2676:53: note: in instantiation of template class 'std::__1::add_rvalue_reference, std::__1::allocator > > >' requested here : public is_nothrow_constructible&lt;_Tp, typename add_rvalue_reference&lt;<em>Tp>::type> ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: /usr/local/bin/../lib/c++/v1/vector:575:20: note: in instantiation of template class 'std::</em>_1::is_nothrow_move_constructible, std::__1::allocator > > >' requested here <em>NOEXCEPT</em>(is_nothrow_move_constructible::value); ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:4: In file included from /usr/local/bin/../lib/c++/v1/vector:264: /usr/local/bin/../lib/c++/v1/__config:325:34: note: expanded from macro '<em>NOEXCEPT</em>' define <em>NOEXCEPT</em>(x) noexcept(x) ^ In file included from /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.cpp:1: /Users/Mani/Development/Projects/flowOfLife/Graphics/Graphics/TestCompileError.h:29:29: note: in instantiation of exception specification for 'vector' requested here std::vector vectorFoo_;</p> </blockquote> <p>My compiler is clang from the top of tree. What am-I doing wrong?</p> <p>Thanks</p> <p><strong>Update</strong> <a href="http://coliru.stacked-crooked.com/a/ab2fb522c4982c72" rel="nofollow">The error on Coliru</a>. It seam that if I don't specify libc++ and instead use stdlibc++ it compiles. It is starting to look alot like a bug in libc++.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload