public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111854] New: new align_val_t usual deallocation
@ 2023-10-17 22:06 barry.revzin at gmail dot com
  2023-10-17 22:08 ` [Bug c++/111854] new (align_val_t) should be ill-formed pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: barry.revzin at gmail dot com @ 2023-10-17 22:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111854
           Summary: new align_val_t usual deallocation
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

gcc accepts this program (copied from the MSVC documentation for
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c2956?view=msvc-170)
without any warning or error:

#include <new>
struct T {};

int main()
{
    T* p = new (std::align_val_t{64}) T; // C2956
    delete p; // ordinary, not over-aligned delete
}

But this should be ill-formed, violating:
https://eel.is/c++draft/expr.new#28.sentence-3

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

end of thread, other threads:[~2023-10-18  9:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-17 22:06 [Bug c++/111854] New: new align_val_t usual deallocation barry.revzin at gmail dot com
2023-10-17 22:08 ` [Bug c++/111854] new (align_val_t) should be ill-formed pinskia at gcc dot gnu.org
2023-10-17 22:10 ` pinskia at gcc dot gnu.org
2023-10-17 22:11 ` pinskia at gcc dot gnu.org
2023-10-17 22:14 ` barry.revzin at gmail dot com
2023-10-17 22:19 ` pinskia at gcc dot gnu.org
2023-10-17 22:22 ` pinskia at gcc dot gnu.org
2023-10-18  2:21 ` rs2740 at gmail dot com
2023-10-18  9:32 ` redi at gcc dot gnu.org
2023-10-18  9:44 ` 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).