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

[basic.scope.block] Fix regression introduced by P1787R6 CWG2502 #4843

Closed
wants to merge 1 commit into from

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Aug 26, 2021

"if (int a = 1) if (int a = 1) ..." is intended to be valid.

Fixes #4841

http://lists.isocpp.org/core/2021/08/11372.php

"if (int a = 1) if (int a = 1) ..." is intended to be valid.
@jensmaurer jensmaurer added the cwg Issue must be reviewed by CWG. label Aug 26, 2021
@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 16, 2021

Does everyone agree that this was the original intention, and that this is really editorial? @opensdh, @zygoloid?

@opensdh
Copy link
Contributor

opensdh commented Sep 16, 2021

I can confirm that I didn't intend to forbid that valid C++20 code. It wasn't immediately clear to me when it was brought up on the reflector whether or not that was a "happy accident" that it prohibited bad code. Richard pointed out that use in else if is not nearly so strange, so I'm happy with Jens' fix.

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 16, 2021

Yes, I like else if, too, one of my better-liked kinds of statement. Until recentlly I think the Google style guide had banned it (presumably inadvertently!), but I fixed that :-)

@jensmaurer jensmaurer changed the title [basic.scope.block] Fix regression introduced by P1787R6 [basic.scope.block] Fix regression introduced by P1787R6 CWG2502 Sep 21, 2021
@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label Sep 21, 2021
@jensmaurer jensmaurer deleted the c43 branch February 16, 2022 08:15
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

Successfully merging this pull request may close these issues.

[basic.scope.block] p1 The note should be as a normative rule
3 participants