Date
2022-11-20.07:54:16
Message id
5271

Content

There is implementation divergence on the handling of typeid in constant expressions, for example:

  static_assert(&typeid(int) == &typeid(int), ""); // #1

According to the current wording, it is unspecified whether two evaluations of the typeid operator produce the same result, even though typeid can be used in constant expressions as long as its operand is not a glvalue of a polymorphic class type. Of particular concern is the case where typeid might be evaluated in different translation units.