This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Moved to DR at the May, 2015 meeting.]
According to bullet 2.5 of 7.7 [expr.const],
A conditional-expression e is a core constant expression unless the evaluation of e, following the rules of the abstract machine (6.9.1 [intro.execution]), would evaluate one of the following expressions:
...
an operation that would have undefined behavior [Note: including, for example, signed integer overflow (Clause 7 [expr]), certain pointer arithmetic (7.6.6 [expr.add]), division by zero (7.6.5 [expr.mul]), or certain shift operations (7.6.7 [expr.shift]) —end note];
...
The definition of “operation” is unclear. In particular, is it intended to include use of library components that are specified to produce undefined behavior, such as use of the offsetof macro when applied to a non-standard-layout class?
Proposed resolution (April, 2015):
Change 7.7 [expr.const] bullet 2.5 as follows:
an operation that would have undefined behavior as specified in Clauses Clause 4 [intro] through Clause 15 [cpp] of this International Standard [Note: including, for example, signed integer overflow ( Clause 7 [expr]), certain pointer arithmetic (7.6.6 [expr.add]), division by zero (7.6.5 [expr.mul]), or certain shift operations (7.6.7 [expr.shift]) —end note];
Add the following at the end of 7.7 [expr.const] paragraph 2:
If e satisfies the constraints of a core constant expression, but evaluation of e would evaluate an operation that has undefined behavior as specified in Clauses Clause 16 [library] through Clause 33 [thread] of this International Standard, it is unspecified whether e is a core constant expression.