public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator
@ 2021-11-20 12:18 redi at gcc dot gnu.org
  2021-11-20 12:19 ` [Bug libstdc++/103340] [12 Regression] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-20 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103340
           Summary: constexpr std::string is incompatible with
                    --enable-libstdcxx-allocator
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Only __gnu_cxx::new_allocator is usable in constant expressions. We need to
either disable constexpr std::string when other allocator base classes are
used, or make the changes needed to all/some of the allocator base classes to
e.g. add constexpr destructors.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
@ 2021-11-20 12:19 ` redi at gcc dot gnu.org
  2021-11-20 16:52 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-20 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
      Known to work|                            |11.2.1
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
            Summary|constexpr std::string is    |[12 Regression] constexpr
                   |incompatible with           |std::string is incompatible
                   |--enable-libstdcxx-allocato |with
                   |r                           |--enable-libstdcxx-allocato
                   |                            |r
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-11-20
           Keywords|                            |build
      Known to fail|                            |12.0
           Priority|P3                          |P1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This breaks bootstrap for users who are using a non-default allocator impl.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
  2021-11-20 12:19 ` [Bug libstdc++/103340] [12 Regression] " redi at gcc dot gnu.org
@ 2021-11-20 16:52 ` redi at gcc dot gnu.org
  2021-11-24  9:33 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-20 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #0)
> Only __gnu_cxx::new_allocator is usable in constant expressions.

And __gnu_cxx::malloc_allocator.

Making the others work isn't difficult.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
  2021-11-20 12:19 ` [Bug libstdc++/103340] [12 Regression] " redi at gcc dot gnu.org
  2021-11-20 16:52 ` redi at gcc dot gnu.org
@ 2021-11-24  9:33 ` redi at gcc dot gnu.org
  2021-11-24 10:00 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-24  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> Making the others work isn't difficult.

HA!

Making them usable in constexpr wasn't difficult, but analysing the test
results and realising that they're completely broken was much harder, see PR
103400. And --enable-libstdcxx-allocator=bitmap had been unable to bootstrap
for years, see PR 103381.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-11-24  9:33 ` redi at gcc dot gnu.org
@ 2021-11-24 10:00 ` redi at gcc dot gnu.org
  2021-12-02 16:53 ` cvs-commit at gcc dot gnu.org
  2021-12-02 17:10 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-24 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 51866
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51866&action=edit
Make all allocator base classes constexpr

This patch would make bitmap_allocator, __mt_alloc and __pool_alloc usable as
constexpr std::allocator in C++20.

But I'm not going to commit it, because these allocators are just broken (see
the linked PRs in the comment above). Instead, I'm going to remove them from
the allowed --enable-libstdcxx-allocator options.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-11-24 10:00 ` redi at gcc dot gnu.org
@ 2021-12-02 16:53 ` cvs-commit at gcc dot gnu.org
  2021-12-02 17:10 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-02 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:e2e98f524fdb80c16e3395f20fee930fbcad5562

commit r12-5754-ge2e98f524fdb80c16e3395f20fee930fbcad5562
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Dec 1 16:30:30 2021 +0000

    libstdc++: Remove broken std::allocator base classes [PR103340]

    The bitmap_allocator, __mt_alloc and __pool_alloc extensions are no
    longer suitable for use as the base class of std::allocator, because
    they have not been updated to meet the C++20 requirements.  There is a
    patch attached to PR 103340 which addresses that, but more work would be
    needed to solve the linking errors that occur when the library is
    configured to use them.

    Using --enable-libstdcxx-allocator=bitmap wouldn't even bootstrap for
    the past few years, and I can't find any gcc-testresults reports using
    any of these allocators. This patch removes the configure option to use
    these as the std::allocator base class. The allocators are still in the
    tree and can be used directly, you just can't configure the library to
    use one of them as the base class of std::allocator.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103340
            PR libstdc++/103400
            PR libstdc++/103381
            * acinclude.m4 (GLIBCXX_ENABLE_ALLOCATOR): Remove mt, bitmap
            and pool options.
            * configure: Regenerate.
            * config/allocator/bitmap_allocator_base.h: Removed.
            * config/allocator/mt_allocator_base.h: Removed.
            * config/allocator/pool_allocator_base.h: Removed.
            * doc/xml/manual/allocator.xml: Update.
            * doc/xml/manual/configure.xml: Update.
            * doc/xml/manual/evolution.xml: Document removal.
            * doc/xml/manual/mt_allocator.xml: Editorial tweaks.
            * doc/html/manual/*: Regenerate.

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

* [Bug libstdc++/103340] [12 Regression] constexpr std::string is incompatible with --enable-libstdcxx-allocator
  2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-12-02 16:53 ` cvs-commit at gcc dot gnu.org
@ 2021-12-02 17:10 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-02 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed by removing these options.

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

end of thread, other threads:[~2021-12-02 17:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-20 12:18 [Bug libstdc++/103340] New: constexpr std::string is incompatible with --enable-libstdcxx-allocator redi at gcc dot gnu.org
2021-11-20 12:19 ` [Bug libstdc++/103340] [12 Regression] " redi at gcc dot gnu.org
2021-11-20 16:52 ` redi at gcc dot gnu.org
2021-11-24  9:33 ` redi at gcc dot gnu.org
2021-11-24 10:00 ` redi at gcc dot gnu.org
2021-12-02 16:53 ` cvs-commit at gcc dot gnu.org
2021-12-02 17:10 ` 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).