[concept_check] fails with types declared in anonymous namespace (gcc 4.2.3)

::value' /usr/include/boost/concept/detail/has_constraints.hpp:43: instantiated from 'boost::concept::not_satisfied<boost::CopyConstructible<<unnamed>::MyVisitorAnon> ' /usr/include/boost/mpl/if.hpp:67: instantiated from 'boost::mpl::if_<boost::concept::not_satisfied<boost::CopyConstructible<<unnamed>::MyVisitorAnon> , boost::concept::constraint<boost::CopyConstructible<<unnamed>::MyVisitorAnon> , boost::concept::requirement<boost::CopyConstructible<<unnamed>::MyVisitorAnon>
' /usr/include/boost/concept/detail/general.hpp:19: instantiated from 'boost::concept::requirement_<void (*)(boost::CopyConstructible<<unnamed>::MyVisitorAnon>)>' /usr/include/boost/concept_check.hpp:43: instantiated from 'void boost::function_requires(Model*) [with Model = boost::CopyConstructible<<unnamed>::MyVisitorAnon>]' /home/diederich/projects/tests/make/graph_concept.cpp:11: instantiated from here /usr/include/boost/concept_check.hpp:156: error: 'boost::concept::requirement<Model>::failed [with Model = boost::concept::usage_requirements<boost::CopyConstructible<<unnamed>::MyVisitorAnon> ]' is not a valid template argument for type 'void (*)()' because function 'static void boost::concept::requirement<Model>::failed() [with Model = boost::concept::usage_requirements<boost::CopyConstructible<<unnamed>::MyVisitorAnon> ]' has not external linkage /usr/include/boost/concept_check.hpp: In function 'void boost::function_requires(Model*) [with Model = boost::CopyConstructible<<unnamed>::MyVisitorAnon>]': /home/diederich/projects/tests/make/graph_concept.cpp:11: instantiated from here /usr/include/boost/concept_check.hpp:43: error: 'boost::concept::requirement<Model>::failed [with Model = boost::CopyConstructible<<unnamed>::MyVisitorAnon>]' is not a valid template argument for type 'void (*)()' because function 'static void boost::concept::requirement<Model>::failed() [with Model = boost::CopyConstructible<<unnamed>::MyVisitorAnon>]' has not external
Hi, after upgrading to gcc 4.2.3 the following snippet fails to compile #include <boost/concept_check.hpp> struct MyVisitor{}; namespace test{ struct MyVisitor{};} namespace{ struct MyVisitorAnon{};} int main(){ using namespace boost; function_requires<CopyConstructible<MyVisitor> >(); function_requires<CopyConstructible<test::MyVisitor> >(); function_requires<CopyConstructible<MyVisitorAnon> >(); //this line breaks the build return 0; } with the error message: /usr/include/boost/concept_check.hpp: In instantiation of 'boost::CopyConstructible<<unnamed>::MyVisitorAnon>': /usr/include/boost/concept/detail/has_constraints.hpp:40: instantiated from 'const bool boost::concept::not_satisfied<boost::CopyConstructible<<unnamed>::MyVisitorAnon> linkage I found the error while compiling a module which uses depth_first_search where a visitor is declared in an unnamed namespace. Can someone help me with that? Thanks in advance, Stephan

Ticket opened @ http://svn.boost.org/trac/boost/ticket/2037 Best regards, Stephan On Tue, Jun 17, 2008 at 3:39 PM, Stephan Diederich <stephan.diederich@googlemail.com> wrote:
Hi,
after upgrading to gcc 4.2.3 the following snippet fails to compile
#include <boost/concept_check.hpp> struct MyVisitor{}; namespace test{ struct MyVisitor{};} namespace{ struct MyVisitorAnon{};}
int main(){ using namespace boost; function_requires<CopyConstructible<MyVisitor> >(); function_requires<CopyConstructible<test::MyVisitor> >(); function_requires<CopyConstructible<MyVisitorAnon> >(); //this line breaks the build return 0; } [snip]
participants (1)
-
Stephan Diederich