public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "gprocida at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/30260] New: add support for pointer-to-member types
Date: Wed, 22 Mar 2023 11:37:05 +0000	[thread overview]
Message-ID: <bug-30260-9487@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30260

            Bug ID: 30260
           Summary: add support for pointer-to-member types
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

libabigail currently lacks support for pointer-to-member types.

These are very simple to model but there may be complexities around building
type names and referring to their components (as no standardised naming seems
to exist).

Useful references:

* https://eel.is/c++draft/expr.mptr.oper
* https://eel.is/c++draft/dcl.mptr - "there is no 'reference-to-member' type"
* https://en.cppreference.com/w/cpp/language/pointer#Pointers_to_members

Test case:

struct X {
  void f(int);
  int a;
};
struct Y;

int X::* pmi = &X::a;
void (X::* pmf)(int) = &X::f;
double X::* pmd;
char Y::* pmc;

typedef struct { int t; } T;
auto pmy = &T::t;

namespace {
struct Z { int z; };
}
int Z::* pmz = &Z::z;

union U { int u; };
auto pmu = &U::u;

typedef const U CU;
auto pmcu = &CU::u;

Model:

* no intrinsic name
* containing type (in practice: can be class/struct, union or typedef; after
typedef resolution can be qualified or anonymous)
* (member) type

Naming:

$ c++decl declare x as pointer to member of class NAME function returning int  
int (NAME::*x)()
$ c++decl declare x as array 7 of pointer to member of class NAME int
int NAME::*x[7]

But this doesn't account for the more complex cases for NAME (see the test case
above).

Component naming (for diff reporting):

¯\_(ツ)_/¯

Concrete representation in XML:

¯\_(ツ)_/¯

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2023-03-22 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 11:37 gprocida at google dot com [this message]
2023-03-22 12:29 ` [Bug default/30260] " gprocida at google dot com
2023-03-24  9:45 ` gprocida at google dot com
2023-10-24 15:24 ` dodji at redhat dot com
2023-10-24 15:43 ` woodard at redhat dot com
2023-11-30 16:35 ` dodji at redhat dot com
2023-11-30 21:51 ` gprocida at google dot com
2023-12-01 16:03 ` dodji at redhat dot com
2023-12-01 16:04 ` dodji at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30260-9487@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).