[Bug c++/67070] New: [concepts] Concept with negation and disjunction not checked correctly
eric.niebler at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 30 19:53:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67070
Bug ID: 67070
Summary: [concepts] Concept with negation and disjunction not
checked correctly
Product: gcc
Version: c++-concepts
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric.niebler at gmail dot com
Target Milestone: ---
Created attachment 36093
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36093&action=edit
preprocessed source archive
The static assertion in the attached file fires when it shouldn't. If the
_ContainerLike concept is changed from this:
template <class T>
concept bool _ContainerLike =
Range<T>() &&
Range<const T>() &&
!Same<ReferenceType<IteratorType<T>>,
ReferenceType<IteratorType<const T>>>();
... to this:
template <class T>
constexpr bool __container_like() { return false; }
template <Range T>
requires Range<const T>() &&
!Same<ReferenceType<IteratorType<T>>,
ReferenceType<IteratorType<const T>>>()
constexpr bool __container_like() { return true; }
template <class T>
concept bool _ContainerLike = __container_like<T>();
... the static assertion goes away. These two seem the same to me.
More information about the Gcc-bugs
mailing list