public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105967] New: Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier
@ 2022-06-14  7:25 iamsupermouse at mail dot ru
  2022-06-14  7:36 ` [Bug c++/105967] " pinskia at gcc dot gnu.org
  2022-06-14  7:38 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: iamsupermouse at mail dot ru @ 2022-06-14  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105967
           Summary: Forming a pointer to ref-qualified member function
                    using a function typedef ignores the qualifier
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamsupermouse at mail dot ru
  Target Milestone: ---

Consider following code:

    #include <type_traits>

    struct A {};
    using F = void() &; 
    static_assert(std::is_same_v<F A::*, void(A::*)() &>);

GCC fails the static_assert, while Clang and MSVC accept it.

Apparently `F A::*` becomes `void(A::*)()`, without `&`. Same happens for `&&`.

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

* [Bug c++/105967] Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier
  2022-06-14  7:25 [Bug c++/105967] New: Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier iamsupermouse at mail dot ru
@ 2022-06-14  7:36 ` pinskia at gcc dot gnu.org
  2022-06-14  7:38 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-14  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note it looks like the pointer to member function type is where it loses the
ref-qualifer and not earlier.
That is GCC correctly rejects:
    using F = void() &; 
    F t;

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

* [Bug c++/105967] Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier
  2022-06-14  7:25 [Bug c++/105967] New: Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier iamsupermouse at mail dot ru
  2022-06-14  7:36 ` [Bug c++/105967] " pinskia at gcc dot gnu.org
@ 2022-06-14  7:38 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-06-14  7:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |4.8.1, 5.1.0
   Last reconfirmed|                            |2022-06-14

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is a testcase without using static_assert:
    struct A {void g()&;};
    using F = void() &; 
    F A::* t = &A::g;

Confirmed. Not a regression.

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

end of thread, other threads:[~2022-06-14  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14  7:25 [Bug c++/105967] New: Forming a pointer to ref-qualified member function using a function typedef ignores the qualifier iamsupermouse at mail dot ru
2022-06-14  7:36 ` [Bug c++/105967] " pinskia at gcc dot gnu.org
2022-06-14  7:38 ` 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).