public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/30260] New: add support for pointer-to-member types
@ 2023-03-22 11:37 gprocida at google dot com
  2023-03-22 12:29 ` [Bug default/30260] " gprocida at google dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gprocida at google dot com @ 2023-03-22 11:37 UTC (permalink / raw)
  To: libabigail

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.

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

end of thread, other threads:[~2023-12-01 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 11:37 [Bug default/30260] New: add support for pointer-to-member types gprocida at google dot com
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

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).