Boost C++ Libraries: Ticket #2037: concept_check fails with types declared in unnamed namespace https://svn.boost.org/trac10/ticket/2037 <p> after upgrading to gcc 4.2.3 the following snippet fails to compile </p> <pre class="wiki">#include &lt;boost/concept_check.hpp&gt; struct MyVisitor{}; namespace test{ struct MyVisitor{};} namespace{ struct MyVisitorAnon{};} int main(){ using namespace boost; function_requires&lt;CopyConstructible&lt;MyVisitor&gt; &gt;(); function_requires&lt;CopyConstructible&lt;test::MyVisitor&gt; &gt;(); function_requires&lt;CopyConstructible&lt;MyVisitorAnon&gt; &gt;(); //this linebreaks the build return 0; } </pre><p> The error message is attached. Is this a problem of gcc or concept_check? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2037 Trac 1.4.3 Stephan Mon, 23 Jun 2008 08:48:07 GMT attachment set https://svn.boost.org/trac10/ticket/2037 https://svn.boost.org/trac10/ticket/2037 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">concept_error.log</span> </li> </ul> <p> build error </p> Ticket anonymous Sat, 02 Aug 2008 16:45:14 GMT <link>https://svn.boost.org/trac10/ticket/2037#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2037#comment:1</guid> <description> <p> I see a similar error with gcc-4.2.3/4.2.4 for boost-1.35.0. Boost-1.34.1 shows no compilation problem for the same compilers. I feel this is related to the boost version rather than compiler. </p> </description> <category>Ticket</category> </item> <item> <author>himmes@…</author> <pubDate>Mon, 07 Sep 2009 14:27:46 GMT</pubDate> <title>version, milestone changed https://svn.boost.org/trac10/ticket/2037#comment:2 https://svn.boost.org/trac10/ticket/2037#comment:2 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.35.0</span> → <span class="trac-field-new">Boost 1.40.0</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.36.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Just got this error when using a boost::circular_buffer&lt;unsigned char&gt;. </p> <p> With gcc: gcc version 4.2.1 (Apple Inc. build 5646) </p> <pre class="wiki">/Users/roman/dev/libs/boost_1_40_0/boost/concept_check.hpp: At global scope: /Users/roman/dev/libs/boost_1_40_0/boost/concept_check.hpp: In instantiation of ‘boost::SGIAssignable&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt;’: /Users/roman/dev/libs/boost_1_40_0/boost/concept_check.hpp:180: instantiated from ‘boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt;’ /Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/has_constraints.hpp:40: instantiated from ‘const bool boost::concept::not_satisfied&lt;boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;::value’ /Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/has_constraints.hpp:43: instantiated from ‘boost::concept::not_satisfied&lt;boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;’ /Users/roman/dev/libs/boost_1_40_0/boost/mpl/if.hpp:67: instantiated from ‘boost::mpl::if_&lt;boost::concept::not_satisfied&lt;boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;, boost::concept::constraint&lt;boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;, boost::concept::requirement&lt;boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt; &gt;’ /Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/general.hpp:19: instantiated from ‘boost::concept::requirement_&lt;void (*)(boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt;)&gt;’ /Users/roman/dev/libs/boost_1_40_0/boost/circular_buffer/base.hpp:72: instantiated from ‘boost::circular_buffer&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt;, std::allocator&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;’ audioio/duplex_audio.cpp:321: instantiated from here /Users/roman/dev/libs/boost_1_40_0/boost/concept_check.hpp:182: error: ‘boost::concept::requirement&lt;Model&gt;::failed [with Model = boost::concept::usage_requirements&lt;boost::SGIAssignable&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;]’ is not a valid template argument for type ‘void (*)()’ because function ‘static void boost::concept::requirement&lt;Model&gt;::failed() [with Model = boost::concept::usage_requirements&lt;boost::SGIAssignable&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;]’ has not external linkage /Users/roman/dev/libs/boost_1_40_0/boost/circular_buffer/base.hpp: In instantiation of ‘boost::circular_buffer&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt;, std::allocator&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt; &gt;’: audioio/duplex_audio.cpp:321: instantiated from here /Users/roman/dev/libs/boost_1_40_0/boost/circular_buffer/base.hpp:72: error: ‘boost::concept::requirement&lt;Model&gt;::failed [with Model = boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt;]’ is not a valid template argument for type ‘void (*)()’ because function ‘static void boost::concept::requirement&lt;Model&gt;::failed() [with Model = boost::SGIAssignableConcept&lt;cryptotec::sam::audio::&lt;unnamed&gt;::Storage&lt;320&gt; &gt;]’ has not external linkage </pre> Ticket Jeremiah Willcock Tue, 08 Jun 2010 23:36:29 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2037#comment:3 https://svn.boost.org/trac10/ticket/2037#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> The example in the ticket works for me with both gcc 4.1.2 and 4.5.0. </p> Ticket