Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expr.new] does not specify pointer value in case of an empty array allocation CWG2532 #3178

Open
languagelawyer opened this issue Aug 15, 2019 · 2 comments
Labels
cwg Issue must be reviewed by CWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@languagelawyer
Copy link
Contributor

p5:

When the allocated object is not an array, the result of the new-expression is a pointer to the object created.

p6:

When the allocated object is an array (that is, the noptr-new-declarator syntax is used or the new-type-id or type-id denotes an array type), the new-expression yields a pointer to the initial element (if any) of the array.

p9:

When the value of the expression is zero, the allocation function is called to allocate an array with no elements.

IMO p9 (or p6) should specify what kind of pointer value ([basic.compound]) is produced by a new-expression allocating an array with no elements

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Aug 30, 2019
@jensmaurer jensmaurer added cwg Issue must be reviewed by CWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Sep 9, 2019
@jensmaurer
Copy link
Member

Editorial teleconference: Defer to CWG.

@jensmaurer
Copy link
Member

Submitted to the CWG reflector: http://lists.isocpp.org/core/2019/09/7203.php

@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label Sep 17, 2019
@jensmaurer jensmaurer changed the title [expr.new] does not specify pointer value in case of an empty array allocation [expr.new] does not specify pointer value in case of an empty array allocation CWG2532 Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

No branches or pull requests

2 participants