public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113960] New: std::map with std::vector as input overwrites itself with c++20, on s390x platform
@ 2024-02-16 14:34 miladfarca at gmail dot com
  2024-02-17  0:57 ` [Bug target/113960] " sjames at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: miladfarca at gmail dot com @ 2024-02-16 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113960
           Summary: std::map with std::vector as input overwrites itself
                    with c++20, on s390x platform
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: miladfarca at gmail dot com
  Target Milestone: ---
              Host: s390x
            Target: s390x

```
#include <map>
#include <vector>
#include <iostream>

int main(){
 std::vector<unsigned short> v1 = {1}; 
 std::vector<unsigned short> v2 = {2};

 std::map<std::vector<unsigned short>, int> m;
 m[v1] = 1;
 m[v2] = 2; // this overwrites m[v1]

 std::cout << m.size() << std::endl; // prints 1, should be 2

 return 0;
}

```
Compile with `g++ std=c++20`. Output is correct with c++17. Tested on g++
12.2.1 and g++ 13.2.1

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

end of thread, other threads:[~2024-03-18 16:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 14:34 [Bug c++/113960] New: std::map with std::vector as input overwrites itself with c++20, on s390x platform miladfarca at gmail dot com
2024-02-17  0:57 ` [Bug target/113960] " sjames at gcc dot gnu.org
2024-02-19  7:53 ` rguenth at gcc dot gnu.org
2024-02-27 12:53 ` stefansf at linux dot ibm.com
2024-02-27 13:26 ` stefansf at linux dot ibm.com
2024-02-27 13:37 ` redi at gcc dot gnu.org
2024-02-27 14:43 ` stefansf at linux dot ibm.com
2024-02-27 14:51 ` redi at gcc dot gnu.org
2024-02-27 14:57 ` redi at gcc dot gnu.org
2024-02-27 15:00 ` stefansf at linux dot ibm.com
2024-02-27 15:07 ` redi at gcc dot gnu.org
2024-02-27 15:13 ` redi at gcc dot gnu.org
2024-02-28  3:38 ` miladfarca at gmail dot com
2024-02-28 11:30 ` miladfarca at gmail dot com
2024-02-28 11:35 ` [Bug target/113960] [11/12/13/14 Regression] " redi at gcc dot gnu.org
2024-02-28 11:35 ` redi at gcc dot gnu.org
2024-02-29 17:50 ` cvs-commit at gcc dot gnu.org
2024-03-01 10:53 ` [Bug target/113960] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-03-01 10:54 ` [Bug target/113960] [11/12 " redi at gcc dot gnu.org
2024-03-18 14:06 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:13 ` redi at gcc dot gnu.org
2024-03-18 16:53 ` [Bug target/113960] [11 " miladfarca 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).