Title
reinterpret_cast to same floating-point type
Status
nad
Section
7.6.1.10 [expr.reinterpret.cast]
Submitter
Aaron Ballman

Created on 2016-01-14.00:00:00 last changed 25 months ago

Messages

Date: 2016-11-15.00:00:00

Rationale (November, 2016):

The specification is as intended.

Date: 2022-11-20.07:54:16

Suggested resolution:

Change in 7.6.1.10 [expr.reinterpret.cast] paragraph 2 as follows:

... An expression of integralarithmetic, enumeration, pointer, or pointer-to-member type can be explicitly converted to its own type; such a cast yields the value of its operand.
Date: 2022-02-18.07:47:23

Consider this inconsistency:

  void func(long l, float f) {
   (void)reinterpret_cast<long *>(&l); // ok
   (void)reinterpret_cast<long>(l); // ok
   (void)reinterpret_cast<float *>(&f); // ok
   (void)reinterpret_cast<float>(f); // ill-formed
  }
History
Date User Action Args
2022-11-20 07:54:16adminsetmessages: + msg7036
2018-02-27 00:00:00adminsetmessages: + msg6005
2018-02-27 00:00:00adminsetstatus: open -> nad
2016-01-14 00:00:00admincreate