public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107521] New: clang rejects invalid code in libstdc++
@ 2022-11-04  4:17 tim at klingt dot org
  2022-11-04  4:27 ` [Bug c++/107521] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tim at klingt dot org @ 2022-11-04  4:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107521
           Summary: clang rejects invalid code in libstdc++
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tim at klingt dot org
  Target Milestone: ---

compare https://github.com/llvm/llvm-project/issues/58754

https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/char_traits.h#L216-L217
```
          if (__s1 == __s2) // unlikely, but saves a lot of work
            return __s1;
```

according to aaron ballman:

> Heh, that's a fun one. http://eel.is/c++draft/lex.string#9 is what that code is referring to and I believe Clang is correct to reject it as a core constant expression per http://eel.is/c++draft/expr.const#5.24 because the equality operator's results are unspecified.

according to jonathan wakely:
> This is a libstdc++ bug.
> And a g++ bug, for letting me do it.

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

end of thread, other threads:[~2022-11-04  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04  4:17 [Bug c++/107521] New: clang rejects invalid code in libstdc++ tim at klingt dot org
2022-11-04  4:27 ` [Bug c++/107521] " pinskia at gcc dot gnu.org
2022-11-04  4:29 ` pinskia at gcc dot gnu.org
2022-11-04  8:17 ` jakub at gcc dot gnu.org
2022-11-04  8:26 ` jakub 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).