From Jason Turner

[stmt.ambig]

Diff to HTML by rtfpessoa

tmp/tmpeb9swjbt/{from.md → to.md} RENAMED
@@ -3,14 +3,17 @@
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*. To disambiguate, the whole *statement* might have to be
9
- examined to determine if it is an *expression-statement* or a
10
- *declaration*. This disambiguates many examples. assuming `T` is a
11
- *simple-type-specifier* ([[dcl.type]]),
 
 
 
12
 
13
  ``` cpp
14
  T(a)->m = 7; // expression-statement
15
  T(a)++; // expression-statement
16
  T(a,5)<<c; // expression-statement
@@ -77,23 +80,24 @@ void f() {
77
  ```
78
 
79
  <!-- Link reference definitions -->
80
  [basic.lookup.argdep]: basic.md#basic.lookup.argdep
81
  [basic.lookup.classref]: basic.md#basic.lookup.classref
 
82
  [basic.scope]: basic.md#basic.scope
83
  [basic.scope.pdecl]: basic.md#basic.scope.pdecl
84
  [basic.start.init]: basic.md#basic.start.init
85
  [basic.start.term]: basic.md#basic.start.term
86
  [basic.stc.auto]: basic.md#basic.stc.auto
87
  [basic.stc.static]: basic.md#basic.stc.static
88
  [basic.stc.thread]: basic.md#basic.stc.thread
89
- [class.conv]: special.md#class.conv
90
  [class.copy]: special.md#class.copy
91
  [class.ctor]: special.md#class.ctor
92
  [class.dtor]: special.md#class.dtor
93
  [class.temporary]: special.md#class.temporary
94
  [conv]: conv.md#conv
 
95
  [dcl.init]: dcl.md#dcl.init
96
  [dcl.init.list]: dcl.md#dcl.init.list
97
  [dcl.meaning]: dcl.md#dcl.meaning
98
  [dcl.spec.auto]: dcl.md#dcl.spec.auto
99
  [dcl.type]: dcl.md#dcl.type
 
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
+ If the *statement* cannot syntactically be a *declaration*, there is no
11
+ ambiguity, so this rule does not apply. The whole *statement* might need
12
+ to be examined to determine whether this is the case. This resolves the
13
+ meaning of many examples. Assuming `T` is a *simple-type-specifier* (
14
+ [[dcl.type]]),
15
 
16
  ``` cpp
17
  T(a)->m = 7; // expression-statement
18
  T(a)++; // expression-statement
19
  T(a,5)<<c; // expression-statement
 
80
  ```
81
 
82
  <!-- Link reference definitions -->
83
  [basic.lookup.argdep]: basic.md#basic.lookup.argdep
84
  [basic.lookup.classref]: basic.md#basic.lookup.classref
85
+ [basic.lookup.unqual]: basic.md#basic.lookup.unqual
86
  [basic.scope]: basic.md#basic.scope
87
  [basic.scope.pdecl]: basic.md#basic.scope.pdecl
88
  [basic.start.init]: basic.md#basic.start.init
89
  [basic.start.term]: basic.md#basic.start.term
90
  [basic.stc.auto]: basic.md#basic.stc.auto
91
  [basic.stc.static]: basic.md#basic.stc.static
92
  [basic.stc.thread]: basic.md#basic.stc.thread
 
93
  [class.copy]: special.md#class.copy
94
  [class.ctor]: special.md#class.ctor
95
  [class.dtor]: special.md#class.dtor
96
  [class.temporary]: special.md#class.temporary
97
  [conv]: conv.md#conv
98
+ [conv.prom]: conv.md#conv.prom
99
  [dcl.init]: dcl.md#dcl.init
100
  [dcl.init.list]: dcl.md#dcl.init.list
101
  [dcl.meaning]: dcl.md#dcl.meaning
102
  [dcl.spec.auto]: dcl.md#dcl.spec.auto
103
  [dcl.type]: dcl.md#dcl.type