public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114395] New: std::is_constructible_v result of const reference incorrect
@ 2024-03-19 14:53 yronglin777 at gmail dot com
  2024-03-19 16:17 ` [Bug c++/114395] [c++20+] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: yronglin777 at gmail dot com @ 2024-03-19 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114395
           Summary: std::is_constructible_v result of const reference
                    incorrect
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/h5af6f5x9
```
#include <type_traits>

struct A {
    int a;
};
struct B : public A {};

static_assert(!std::is_constructible_v<const B &, const A &>);
static_assert(!std::is_constructible_v<const B *, const A *>);

```
Clang and MSVC accepted this code, but gcc rejected.

```
<source>:8:15: error: static assertion failed
    8 | static_assert(!std::is_constructible_v<const B &, const A &>);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiler returned: 1
```

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

end of thread, other threads:[~2024-03-20 12:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 14:53 [Bug c++/114395] New: std::is_constructible_v result of const reference incorrect yronglin777 at gmail dot com
2024-03-19 16:17 ` [Bug c++/114395] [c++20+] " pinskia at gcc dot gnu.org
2024-03-19 16:28 ` pinskia at gcc dot gnu.org
2024-03-19 16:40 ` mpolacek at gcc dot gnu.org
2024-03-19 16:49 ` pinskia at gcc dot gnu.org
2024-03-19 17:10 ` redi at gcc dot gnu.org
2024-03-19 17:14 ` mpolacek at gcc dot gnu.org
2024-03-19 17:19 ` redi at gcc dot gnu.org
2024-03-19 18:29 ` pinskia at gcc dot gnu.org
2024-03-19 19:07 ` pinskia at gcc dot gnu.org
2024-03-20 10:23 ` de34 at live dot cn
2024-03-20 12:47 ` mpolacek 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).