Opened 14 years ago

Closed 12 years ago

#2037 closed Bugs (worksforme)

concept_check fails with types declared in unnamed namespace

Reported by: Stephan Owned by: jsiek
Milestone: To Be Determined Component: concept_check
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc: stephan.diederich@…

Description

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 linebreaks the build
  return 0;
}

The error message is attached. Is this a problem of gcc or concept_check?

Attachments (1)

concept_error.log (2.2 KB ) - added by Stephan 14 years ago.
build error

Download all attachments as: .zip

Change History (4)

by Stephan, 14 years ago

Attachment: concept_error.log added

build error

comment:1 by anonymous, 14 years ago

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.

comment:2 by himmes@…, 13 years ago

Milestone: Boost 1.36.0To Be Determined
Version: Boost 1.35.0Boost 1.40.0

Just got this error when using a boost::circular_buffer<unsigned char>.

With gcc: gcc version 4.2.1 (Apple Inc. build 5646)

/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<cryptotec::sam::audio::<unnamed>::Storage<320> >’:
/Users/roman/dev/libs/boost_1_40_0/boost/concept_check.hpp:180:   instantiated from ‘boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> >’
/Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/has_constraints.hpp:40:   instantiated from ‘const bool boost::concept::not_satisfied<boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> > >::value’
/Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/has_constraints.hpp:43:   instantiated from ‘boost::concept::not_satisfied<boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> > >’
/Users/roman/dev/libs/boost_1_40_0/boost/mpl/if.hpp:67:   instantiated from ‘boost::mpl::if_<boost::concept::not_satisfied<boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> > >, boost::concept::constraint<boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> > >, boost::concept::requirement<boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> > > >’
/Users/roman/dev/libs/boost_1_40_0/boost/concept/detail/general.hpp:19:   instantiated from ‘boost::concept::requirement_<void (*)(boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> >)>’
/Users/roman/dev/libs/boost_1_40_0/boost/circular_buffer/base.hpp:72:   instantiated from ‘boost::circular_buffer<cryptotec::sam::audio::<unnamed>::Storage<320>, std::allocator<cryptotec::sam::audio::<unnamed>::Storage<320> > >’
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<Model>::failed [with Model = boost::concept::usage_requirements<boost::SGIAssignable<cryptotec::sam::audio::<unnamed>::Storage<320> > >]’ 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::SGIAssignable<cryptotec::sam::audio::<unnamed>::Storage<320> > >]’ has not external linkage
/Users/roman/dev/libs/boost_1_40_0/boost/circular_buffer/base.hpp: In instantiation of ‘boost::circular_buffer<cryptotec::sam::audio::<unnamed>::Storage<320>, std::allocator<cryptotec::sam::audio::<unnamed>::Storage<320> > >’:
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<Model>::failed [with Model = boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> >]’ is not a valid template argument for type ‘void (*)()’ because function ‘static void boost::concept::requirement<Model>::failed() [with Model = boost::SGIAssignableConcept<cryptotec::sam::audio::<unnamed>::Storage<320> >]’ has not external linkage

comment:3 by Jeremiah Willcock, 12 years ago

Resolution: worksforme
Status: newclosed

The example in the ticket works for me with both gcc 4.1.2 and 4.5.0.

Note: See TracTickets for help on using tickets.