Skip to content

[diff.expr] Update incorrect comment#8933

Merged
tkoeppe merged 2 commits into
cplusplus:mainfrom
Halalaluyafail3:main2
Apr 20, 2026
Merged

[diff.expr] Update incorrect comment#8933
tkoeppe merged 2 commits into
cplusplus:mainfrom
Halalaluyafail3:main2

Conversation

@Halalaluyafail3

Copy link
Copy Markdown
Contributor

+arr2 is a constraint violation in C, rather than being valid.

+arr2 is a constraint violation in C, rather than being valid.
@eisenwave eisenwave added the P2-Bug Presentational errors and omissions label Apr 9, 2026
@jensmaurer

Copy link
Copy Markdown
Member

@Halalaluyafail3 , please fix the check failure. (See annotation in diff view.)

@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Apr 9, 2026
@Halalaluyafail3

Halalaluyafail3 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

Should the above line also be changed to use \Cpp{}? The ^[^%]*[^{"]C++[^"}] pattern in check-source.sh seems to allow C++ at the beginning or end of a line but I do not see why that would be the intent.

Also fixes the line that was not causing a check failure.
@jensmaurer jensmaurer removed the changes requested Changes to the wording or approach have been requested and not yet applied. label Apr 16, 2026
@jensmaurer

Copy link
Copy Markdown
Member

Indeed, C23 says

6.5.4.3 Unary arithmetic operators
Constraints
The operand of the unary + or - operator shall have arithmetic type ...

For comparison, C++ says in [expr.unary.op] p7:

The operand of the unary + operator shall be a prvalue of arithmetic, unscoped enumeration, or pointer type...

@jensmaurer jensmaurer added this to the post-2026-03 milestone Apr 16, 2026
@jensmaurer jensmaurer added the after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. label Apr 16, 2026
@jensmaurer

Copy link
Copy Markdown
Member

@tkoeppe , I think this should go into C++26.

@tkoeppe tkoeppe merged commit cd6c5bf into cplusplus:main Apr 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

after-motions Pull request is to be applied after the pending edits from WG21 straw polls have been applied. P2-Bug Presentational errors and omissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants