tmp/tmpi1jsoj5l/{from.md → to.md}
RENAMED
|
@@ -1,23 +1,22 @@
|
|
| 1 |
-
###
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
transformation. Seldom.
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
objects. If some flow paths execute a return without specifying any
|
| 20 |
value, the implementation must embody many more complications. Besides,
|
| 21 |
promising to return a value of a given type, and then not returning such
|
| 22 |
a value, has always been recognized to be a questionable practice,
|
| 23 |
tolerated only because very-old C had no distinction between void
|
|
|
|
| 1 |
+
### [[stmt.stmt]]: statements <a id="diff.stat">[[diff.stat]]</a>
|
| 2 |
|
| 3 |
+
**Change:** It is now invalid to jump past a declaration with explicit
|
| 4 |
+
or implicit initializer (except across entire block not entered).
|
| 5 |
+
**Rationale:** Constructors used in initializers may allocate resources
|
| 6 |
+
which need to be de-allocated upon leaving the block. Allowing jump past
|
| 7 |
+
initializers would require complicated runtime determination of
|
| 8 |
+
allocation. Furthermore, any use of the uninitialized object could be a
|
| 9 |
+
disaster. With this simple compile-time rule, C++ assures that if an
|
| 10 |
+
initialized variable is in scope, then it has assuredly been
|
| 11 |
+
initialized. **Effect on original feature:** Deletion of semantically
|
| 12 |
+
well-defined feature. Semantic transformation. Seldom.
|
|
|
|
| 13 |
|
| 14 |
+
**Change:** It is now invalid to return (explicitly or implicitly) from
|
| 15 |
+
a function which is declared to return a value without actually
|
| 16 |
+
returning a value. **Rationale:** The caller and callee may assume
|
| 17 |
+
fairly elaborate return-value mechanisms for the return of class
|
| 18 |
objects. If some flow paths execute a return without specifying any
|
| 19 |
value, the implementation must embody many more complications. Besides,
|
| 20 |
promising to return a value of a given type, and then not returning such
|
| 21 |
a value, has always been recognized to be a questionable practice,
|
| 22 |
tolerated only because very-old C had no distinction between void
|