This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++ not conforming with --enable-concepts-check?
- From: Paolo Carlini <pcarlini at suse dot de>
- To: magfr at lysator dot liu dot se
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 22 Sep 2004 16:35:40 +0200
- Subject: Re: libstdc++ not conforming with --enable-concepts-check?
- References: <20040922124030.GB4836@sellafield.lysator.liu.se>
magfr@lysator.liu.se wrote:
Hello.
If I try to compile the attached program and have built the compiler with
--enable-concept-checks that fails but as far as I can see from the standard
queue only requires that the elements should be CopyConstructible, there is
no requirement for DefaultConstructability, so I think that is a bug in the
concept checking code.
Hi and thanks for your message: in my opinion, indeed, we have a bug.
The problem is tha we are enforcing a wrong requirement for sequences:
compare
Table 67 with:
template <class _Sequence>
struct _SequenceConcept
{
typedef typename _Sequence::reference _Reference;
typedef typename _Sequence::const_reference _Const_reference;
void __constraints() {
// Matt Austern's book puts DefaultConstructible here, the C++
// standard places it in Container
// function_requires< DefaultConstructible<Sequence> >();
__function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
__function_requires< _DefaultConstructibleConcept<_Sequence> >();
_Sequence
__c _IsUnused(__n), // line 730
__c2 _IsUnused(__n, __t),
__c3 _IsUnused(__first, __last);
...
...
...
The requirement enforced at line 730 is not present in Table 67 (*).
Removing it
allows your testcase to compile. I'm now testing a complete patch.
Thanks,
Paolo.
(*) To be fair, "many" "real life" sequences fulfill it... ;)