This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-10-26


2206. Composite type of object and function pointers

Section: Clause 7  [expr]     Status: C++17     Submitter: Mike Miller     Date: 2015-12-01

[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*.

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: