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

[std] There shall be no .1 subclause without a .2 sibling #3525

Closed
21 tasks done
JohelEGP opened this issue Dec 6, 2019 · 7 comments · Fixed by #4186
Closed
21 tasks done

[std] There shall be no .1 subclause without a .2 sibling #3525

JohelEGP opened this issue Dec 6, 2019 · 7 comments · Fixed by #4186

Comments

@JohelEGP
Copy link
Contributor

JohelEGP commented Dec 6, 2019

A subclause shall not be created unless there is at least one further subclause at the same level. For example, text in Clause 10 shall not be designated subclause “10.1” unless there is also a subclause “10.2”.

Affected subclauses, partially related to #574. Note that these are the parent subclauses of .1 subclauses without a .2 sibling:

  • [intro.compliance]
  • [dcl.spec.auto]
  • [class.mfct.non-static]
  • [class.union]
  • [allocator.requirements]
  • [cstdint]
  • [errno]
  • [c.locales]
  • [associative.reqmts]
  • [unord.req]
  • [unreachable.sentinels]
  • [view.interface]
  • [range.all]
  • [cfenv]
  • [conversions]
  • [fs.req]
  • [fs.class.filesystem.error]
  • [stopcallback]
  • [thread.sharedmutex.requirements]
  • [thread.sharedtimedmutex.requirements]
  • [depr.iterator.primitives]
@jwakely
Copy link
Member

jwakely commented Dec 6, 2019

[class.union] looks ok

@jensmaurer
Copy link
Member

@jwakely, how so? There is [class.union.anon] nested inside.

@jwakely
Copy link
Member

jwakely commented Dec 6, 2019

Oh I misread the directive as only talking about a subclause with a single .1 paragraph. But of course ISO doesn't even number paragraphs, it's talking about subclause numbers. Sorry.

@jwakely
Copy link
Member

jwakely commented Dec 6, 2019

N.B. the problem here is really that we have hanging paragraphs. If the content of [class.union] was in [class.union.xxx] then that would be a sibling of [class.union.anon], and we wouldn't be breaking this rule.

In the ISO world, where hanging paragraphs don't exist, a .1 subclause with no .2 sibling would mean the parent has no text of its own and has an "only child". That's obviously pointless and the content of the only child could be moved up into the empty parent.

With hanging paragraphs the parent is not actually empty, and an only child can make sense.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Dec 6, 2019
@JohelEGP JohelEGP changed the title There shall be no .1 subclause without a .2 sibling [std] There shall be no .1 subclause without a .2 sibling Dec 6, 2019
@jensmaurer
Copy link
Member

Editorial meeting: This is duplicative of the hanging paragraphs issue #1730.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Feb 10, 2020
@opensdh
Copy link
Contributor

opensdh commented Mar 24, 2020

cplusplus/papers#533 plans to remove [class.this], making [class.mfct.non-static]'s paragraphs non-hanging.

@zygoloid
Copy link
Member

zygoloid commented Sep 9, 2020

I'm using this Perl script to find these:

$d = 0;                                                        
@secs = {}; @seclabels = {};
while (<>) {
  if ($_ =~ /\\rSec(\d)/) {
    if ($1 < $d && $secs[$d] == 1) { print "isolated subclause $seclabels[$d] in $seclabels[$d-1]\n"; }
    $d = $1;                       
    $sec = $_;
    chomp $sec;
    $secs[$d] += 1;
    $seclabels[$d] = $sec;
    $secs[$d + 1] = 0;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants