Title
Composite type of object and function pointers
Status
c++17
Section
Clause [7] [expr]
Submitter
Mike Miller

Created on 2015-12-01.00:00:00 last changed 83 months ago

Messages

Date: 2017-01-15.00:00:00

Proposed resolution (January, 2017):

Change Clause 7 [expr] bullet 14.5 as follows:

The cv-combined type of two types T1 and T2 is a type T3 similar to T1 whose cv-qualification signature (7.3.6 [conv.qual]) is:

  • ...

  • if T1 or T2 is “pointer to cv1 void” and the other type is “pointer to cv2 T”, where T is an object type or void, “pointer to cv12 void”, where cv12 is the union of cv1 and cv2;

  • ...

Date: 2017-02-15.00:00:00

[Adopted at the February/March, 2017 meeting.]

Consider an example like

  void *p;
  void (*pf)();
  auto x = true ? p : pf;

The rules in Clause 7 [expr] paragraph 13 say that the composite type between a void* and a function pointer type is void*. This is surprising, since a function pointer type cannot be implicitly converted to void*.

History
Date User Action Args
2018-02-27 00:00:00adminsetstatus: tentatively ready -> c++17
2017-02-06 00:00:00adminsetmessages: + msg5730
2015-12-01 00:00:00admincreate