public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111539] New: __is_range_adaptor_closure_fn is too loosely defined
@ 2023-09-22 14:46 hewillk at gmail dot com
  0 siblings, 0 replies; only message in thread
From: hewillk at gmail dot com @ 2023-09-22 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111539

            Bug ID: 111539
           Summary: __is_range_adaptor_closure_fn is too loosely defined
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

template<typename _Tp, typename _Up>
    requires (!same_as<_Tp, _RangeAdaptorClosure<_Up>>)
    void __is_range_adaptor_closure_fn
      (const _Tp&, const _RangeAdaptorClosure<_Up>&); // not defined

  template<typename _Tp>
    concept __is_range_adaptor_closure
      = requires (_Tp __t) { __adaptor::__is_range_adaptor_closure_fn(__t,
__t); };

The standard requires range adapter closure object type T to model
derived_from<range_adaptor_closure<T>>. However, the above definition does not
consider whether the template parameter of range_adaptor_closure is T, which
makes libstdc++ accept the following

  #include <ranges>

  struct _;
  struct closure : std::ranges::range_adaptor_closure<_> {
    int operator()(auto&&);
  };

  int main() {
    auto r = std::views::iota(0) | closure{};
  }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-22 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 14:46 [Bug c++/111539] New: __is_range_adaptor_closure_fn is too loosely defined hewillk at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).