tmp/tmpu20ma485/{from.md → to.md}
RENAMED
|
@@ -1,36 +1,42 @@
|
|
| 1 |
### Clause [[expr]]: expressions <a id="diff.expr">[[diff.expr]]</a>
|
| 2 |
|
| 3 |
[[expr.call]] **Change:** Implicit declaration of functions is not
|
| 4 |
-
allowed **Rationale:** The type-safe nature of C++. **Effect on
|
| 5 |
-
feature:** Deletion of semantically well-defined feature. Note:
|
| 6 |
-
original feature was labeled as “obsolescent” in ISO C. Syntactic
|
| 7 |
transformation. Facilities for producing explicit function declarations
|
| 8 |
are fairly widespread commercially. Common.
|
| 9 |
|
| 10 |
-
[[expr.
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
p = (void*)(struct x {int i;} *)0;
|
| 16 |
```
|
| 17 |
|
| 18 |
-
|
| 19 |
-
clarify the location of
|
| 20 |
-
original feature:** Deletion of
|
| 21 |
Syntactic transformation. Seldom.
|
| 22 |
|
| 23 |
-
[[expr.cond]], [[expr.ass]], [[expr.comma]]
|
| 24 |
-
|
| 25 |
-
**
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
expressions that implicitly rely on lvalue-to-rvalue conversions will
|
| 31 |
-
yield different results. For example,
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
char arr[100];
|
| 35 |
sizeof(0, arr)
|
| 36 |
```
|
|
|
|
| 1 |
### Clause [[expr]]: expressions <a id="diff.expr">[[diff.expr]]</a>
|
| 2 |
|
| 3 |
[[expr.call]] **Change:** Implicit declaration of functions is not
|
| 4 |
+
allowed. **Rationale:** The type-safe nature of C++. **Effect on
|
| 5 |
+
original feature:** Deletion of semantically well-defined feature. Note:
|
| 6 |
+
the original feature was labeled as “obsolescent” in ISO C. Syntactic
|
| 7 |
transformation. Facilities for producing explicit function declarations
|
| 8 |
are fairly widespread commercially. Common.
|
| 9 |
|
| 10 |
+
[[expr.post.incr]], [[expr.pre.incr]] **Change:** Decrement operator is
|
| 11 |
+
not allowed with `bool` operand. **Rationale:** Feature with surprising
|
| 12 |
+
semantics. **Effect on original feature:** A valid ISO C expression
|
| 13 |
+
utilizing the decrement operator on a `bool` lvalue (for instance, via
|
| 14 |
+
the C typedef in `<stdbool.h>`) is ill-formed in this International
|
| 15 |
+
Standard.
|
| 16 |
+
|
| 17 |
+
[[expr.sizeof]], [[expr.cast]] **Change:** Types must be defined in
|
| 18 |
+
declarations, not in expressions.
|
| 19 |
+
In C, a sizeof expression or cast expression may define a new type. For
|
| 20 |
+
example,
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
p = (void*)(struct x {int i;} *)0;
|
| 24 |
```
|
| 25 |
|
| 26 |
+
defines a new type, struct `x`. **Rationale:** This prohibition helps to
|
| 27 |
+
clarify the location of definitions in the source code. **Effect on
|
| 28 |
+
original feature:** Deletion of semantically well-defined feature.
|
| 29 |
Syntactic transformation. Seldom.
|
| 30 |
|
| 31 |
+
[[expr.cond]], [[expr.ass]], [[expr.comma]] **Change:** The result of a
|
| 32 |
+
conditional expression, an assignment expression, or a comma expression
|
| 33 |
+
may be an lvalue. **Rationale:** C++is an object-oriented language,
|
| 34 |
+
placing relatively more emphasis on lvalues. For example, functions may
|
| 35 |
+
return lvalues. **Effect on original feature:** Change to semantics of
|
| 36 |
+
well-defined feature. Some C expressions that implicitly rely on
|
| 37 |
+
lvalue-to-rvalue conversions will yield different results. For example,
|
|
|
|
|
|
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
char arr[100];
|
| 41 |
sizeof(0, arr)
|
| 42 |
```
|