public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110904] New: __is_convertible incorrectly reports non-referenceable  function prototypes as convertible
@ 2023-08-04 18:05 nikolasklauser at berlin dot de
  2023-08-04 18:08 ` [Bug c++/110904] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: nikolasklauser at berlin dot de @ 2023-08-04 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110904
           Summary: __is_convertible incorrectly reports non-referenceable
                     function prototypes as convertible
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nikolasklauser at berlin dot de
  Target Milestone: ---

```
#include <utility>

using Function = void();
using ConstFunction = void() const;

static_assert((!std::is_convertible<ConstFunction, Function>::value), "");
static_assert((!std::is_convertible<ConstFunction, Function*>::value), ""); //
convertible
static_assert((!std::is_convertible<ConstFunction, Function&>::value), ""); //
convertible
static_assert((!std::is_convertible<ConstFunction, Function&&>::value), ""); //
convertible
static_assert((!std::is_convertible<Function*, ConstFunction>::value), "");
static_assert((!std::is_convertible<Function&, ConstFunction>::value), "");
static_assert((!std::is_convertible<ConstFunction, ConstFunction>::value), "");
static_assert((!std::is_convertible<ConstFunction, void>::value), "");
```
__is_convertible() claims that the cases marked above are convertible, but
AFAICT that shouldn't be true. According to the standard,
```
To test() {
  return declval<From>();
}
```
has to be well formed, but that's never the case for `ConstFunction`.

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

* [Bug c++/110904] __is_convertible incorrectly reports non-referenceable  function prototypes as convertible
  2023-08-04 18:05 [Bug c++/110904] New: __is_convertible incorrectly reports non-referenceable function prototypes as convertible nikolasklauser at berlin dot de
@ 2023-08-04 18:08 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-04 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 109680.

*** This bug has been marked as a duplicate of bug 109680 ***

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

end of thread, other threads:[~2023-08-04 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 18:05 [Bug c++/110904] New: __is_convertible incorrectly reports non-referenceable function prototypes as convertible nikolasklauser at berlin dot de
2023-08-04 18:08 ` [Bug c++/110904] " pinskia 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).