From Jason Turner

[stmt.ambig]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptz65n_ra/{from.md → to.md} +19 -11
tmp/tmptz65n_ra/{from.md → to.md} RENAMED
@@ -1,10 +1,10 @@
1
  ## Ambiguity resolution <a id="stmt.ambig">[[stmt.ambig]]</a>
2
 
3
  There is an ambiguity in the grammar involving *expression-statement*s
4
  and *declaration*s: An *expression-statement* with a function-style
5
- explicit type conversion ([[expr.type.conv]]) as its leftmost
6
  subexpression can be indistinguishable from a *declaration* where the
7
  first *declarator* starts with a `(`. In those cases the *statement* is
8
  a *declaration*.
9
 
10
  [*Note 1*:
@@ -14,11 +14,11 @@ ambiguity, so this rule does not apply. The whole *statement* might need
14
  to be examined to determine whether this is the case. This resolves the
15
  meaning of many examples.
16
 
17
  [*Example 1*:
18
 
19
- Assuming `T` is a *simple-type-specifier* ([[dcl.type]]),
20
 
21
  ``` cpp
22
  T(a)->m = 7; // expression-statement
23
  T(a)++; // expression-statement
24
  T(a,5)<<c; // expression-statement
@@ -94,32 +94,38 @@ void f() {
94
 
95
  — *end example*]
96
 
97
  <!-- Link reference definitions -->
98
  [basic.def.odr]: basic.md#basic.def.odr
 
99
  [basic.lookup.argdep]: basic.md#basic.lookup.argdep
100
  [basic.lookup.classref]: basic.md#basic.lookup.classref
101
  [basic.lookup.unqual]: basic.md#basic.lookup.unqual
102
  [basic.scope]: basic.md#basic.scope
 
103
  [basic.scope.pdecl]: basic.md#basic.scope.pdecl
104
  [basic.start.main]: basic.md#basic.start.main
105
  [basic.start.term]: basic.md#basic.start.term
106
  [basic.stc.auto]: basic.md#basic.stc.auto
107
  [basic.stc.static]: basic.md#basic.stc.static
108
  [basic.stc.thread]: basic.md#basic.stc.thread
109
- [class.copy]: special.md#class.copy
110
- [class.ctor]: special.md#class.ctor
111
- [class.dtor]: special.md#class.dtor
112
- [class.temporary]: special.md#class.temporary
113
- [conv]: conv.md#conv
114
- [conv.prom]: conv.md#conv.prom
 
 
115
  [dcl.init]: dcl.md#dcl.init
116
  [dcl.meaning]: dcl.md#dcl.meaning
117
  [dcl.spec.auto]: dcl.md#dcl.spec.auto
118
  [dcl.type]: dcl.md#dcl.type
119
- [expr]: expr.md#expr
 
120
  [expr.const]: expr.md#expr.const
 
121
  [expr.type.conv]: expr.md#expr.type.conv
122
  [stmt.ambig]: #stmt.ambig
123
  [stmt.block]: #stmt.block
124
  [stmt.break]: #stmt.break
125
  [stmt.cont]: #stmt.cont
@@ -130,18 +136,20 @@ void f() {
130
  [stmt.goto]: #stmt.goto
131
  [stmt.if]: #stmt.if
132
  [stmt.iter]: #stmt.iter
133
  [stmt.jump]: #stmt.jump
134
  [stmt.label]: #stmt.label
 
135
  [stmt.ranged]: #stmt.ranged
136
  [stmt.return]: #stmt.return
 
137
  [stmt.select]: #stmt.select
138
  [stmt.stmt]: #stmt.stmt
139
  [stmt.switch]: #stmt.switch
140
  [stmt.while]: #stmt.while
141
- [support.start.term]: language.md#support.start.term
142
- [temp]: temp.md#temp
143
 
144
  [^1]: In other words, the `else` is associated with the nearest un-elsed
145
  `if`.
146
 
147
  [^2]: The transfer from the condition of a `switch` statement to a
 
1
  ## Ambiguity resolution <a id="stmt.ambig">[[stmt.ambig]]</a>
2
 
3
  There is an ambiguity in the grammar involving *expression-statement*s
4
  and *declaration*s: An *expression-statement* with a function-style
5
+ explicit type conversion [[expr.type.conv]] as its leftmost
6
  subexpression can be indistinguishable from a *declaration* where the
7
  first *declarator* starts with a `(`. In those cases the *statement* is
8
  a *declaration*.
9
 
10
  [*Note 1*:
 
14
  to be examined to determine whether this is the case. This resolves the
15
  meaning of many examples.
16
 
17
  [*Example 1*:
18
 
19
+ Assuming `T` is a *simple-type-specifier* [[dcl.type]],
20
 
21
  ``` cpp
22
  T(a)->m = 7; // expression-statement
23
  T(a)++; // expression-statement
24
  T(a,5)<<c; // expression-statement
 
94
 
95
  — *end example*]
96
 
97
  <!-- Link reference definitions -->
98
  [basic.def.odr]: basic.md#basic.def.odr
99
+ [basic.life]: basic.md#basic.life
100
  [basic.lookup.argdep]: basic.md#basic.lookup.argdep
101
  [basic.lookup.classref]: basic.md#basic.lookup.classref
102
  [basic.lookup.unqual]: basic.md#basic.lookup.unqual
103
  [basic.scope]: basic.md#basic.scope
104
+ [basic.scope.block]: basic.md#basic.scope.block
105
  [basic.scope.pdecl]: basic.md#basic.scope.pdecl
106
  [basic.start.main]: basic.md#basic.start.main
107
  [basic.start.term]: basic.md#basic.start.term
108
  [basic.stc.auto]: basic.md#basic.stc.auto
109
  [basic.stc.static]: basic.md#basic.stc.static
110
  [basic.stc.thread]: basic.md#basic.stc.thread
111
+ [class.copy.elision]: class.md#class.copy.elision
112
+ [class.ctor]: class.md#class.ctor
113
+ [class.dtor]: class.md#class.dtor
114
+ [class.temporary]: basic.md#class.temporary
115
+ [conv]: expr.md#conv
116
+ [conv.prom]: expr.md#conv.prom
117
+ [dcl.dcl]: dcl.md#dcl.dcl
118
+ [dcl.fct.def.coroutine]: dcl.md#dcl.fct.def.coroutine
119
  [dcl.init]: dcl.md#dcl.init
120
  [dcl.meaning]: dcl.md#dcl.meaning
121
  [dcl.spec.auto]: dcl.md#dcl.spec.auto
122
  [dcl.type]: dcl.md#dcl.type
123
+ [except.ctor]: except.md#except.ctor
124
+ [expr.await]: expr.md#expr.await
125
  [expr.const]: expr.md#expr.const
126
+ [expr.context]: expr.md#expr.context
127
  [expr.type.conv]: expr.md#expr.type.conv
128
  [stmt.ambig]: #stmt.ambig
129
  [stmt.block]: #stmt.block
130
  [stmt.break]: #stmt.break
131
  [stmt.cont]: #stmt.cont
 
136
  [stmt.goto]: #stmt.goto
137
  [stmt.if]: #stmt.if
138
  [stmt.iter]: #stmt.iter
139
  [stmt.jump]: #stmt.jump
140
  [stmt.label]: #stmt.label
141
+ [stmt.pre]: #stmt.pre
142
  [stmt.ranged]: #stmt.ranged
143
  [stmt.return]: #stmt.return
144
+ [stmt.return.coroutine]: #stmt.return.coroutine
145
  [stmt.select]: #stmt.select
146
  [stmt.stmt]: #stmt.stmt
147
  [stmt.switch]: #stmt.switch
148
  [stmt.while]: #stmt.while
149
+ [support.start.term]: support.md#support.start.term
150
+ [temp.pre]: temp.md#temp.pre
151
 
152
  [^1]: In other words, the `else` is associated with the nearest un-elsed
153
  `if`.
154
 
155
  [^2]: The transfer from the condition of a `switch` statement to a