public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/101571] New: DestroyGuard used by the ranges::uninitialized family should use addressof()
@ 2021-07-22  5:58 hewillk at gmail dot com
  2021-07-22  9:15 ` [Bug libstdc++/101571] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hewillk at gmail dot com @ 2021-07-22  5:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101571
           Summary: DestroyGuard used by the ranges::uninitialized family
                    should use addressof()
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

The Standard Library should consistently use addressof() to defend itself
against overloaded operator&().

#include <memory>

struct I {
  using value_type = std::string;
  using difference_type = std::ptrdiff_t;

  I& operator++();
  I operator++(int);
  value_type& operator*() const;
  void operator&() = delete;
  bool operator==(const I&) const;
};

int main() {
  std::ranges::uninitialized_default_construct(I{}, I{});
}

https://godbolt.org/z/5Pb67b9jx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-26 17:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  5:58 [Bug libstdc++/101571] New: DestroyGuard used by the ranges::uninitialized family should use addressof() hewillk at gmail dot com
2021-07-22  9:15 ` [Bug libstdc++/101571] " redi at gcc dot gnu.org
2021-07-22  9:37 ` redi at gcc dot gnu.org
2021-07-22 13:37 ` cvs-commit at gcc dot gnu.org
2021-07-22 13:40 ` redi at gcc dot gnu.org
2021-11-23 21:17 ` cvs-commit at gcc dot gnu.org
2021-11-26 16:35 ` cvs-commit at gcc dot gnu.org
2021-11-26 17:31 ` redi at gcc dot gnu.org

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).