tmp/tmpdmb8k9bv/{from.md → to.md}
RENAMED
|
@@ -1,18 +1,31 @@
|
|
| 1 |
-
###
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
original feature:** Valid C++03 code that uses integer division rounds
|
| 6 |
the result toward 0 or toward negative infinity, whereas this
|
| 7 |
International Standard always rounds the result toward 0.
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
illustrates:
|
| 14 |
|
| 15 |
``` cpp
|
| 16 |
bool b1 = new int && false; // previously false, now ill-formed
|
| 17 |
struct S { operator int(); };
|
| 18 |
bool b2 = &S::operator int && false; // previously false, now ill-formed
|
|
|
|
| 1 |
+
### [[expr]]: expressions <a id="diff.cpp03.expr">[[diff.cpp03.expr]]</a>
|
| 2 |
|
| 3 |
+
**Change:** Only literals are integer null pointer constants.
|
| 4 |
+
**Rationale:** Removing surprising interactions with templates and
|
| 5 |
+
constant expressions. **Effect on original feature:** Valid C++03 code
|
| 6 |
+
may fail to compile or produce different results in this International
|
| 7 |
+
Standard. For example:
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
void f(void *); // #1
|
| 11 |
+
void f(...); // #2
|
| 12 |
+
template<int N> void g() {
|
| 13 |
+
f(0*N); // calls #2; used to call #1
|
| 14 |
+
}
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
**Change:** Specify rounding for results of integer `/` and `%`.
|
| 18 |
+
**Rationale:** Increase portability, C99 compatibility. **Effect on
|
| 19 |
original feature:** Valid C++03 code that uses integer division rounds
|
| 20 |
the result toward 0 or toward negative infinity, whereas this
|
| 21 |
International Standard always rounds the result toward 0.
|
| 22 |
|
| 23 |
+
**Change:** `&&` is valid in a *type-name*. **Rationale:** Required for
|
| 24 |
+
new features. **Effect on original feature:** Valid C++03 code may fail
|
| 25 |
+
to compile or produce different results in this International Standard.
|
| 26 |
+
For example:
|
|
|
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
bool b1 = new int && false; // previously false, now ill-formed
|
| 30 |
struct S { operator int(); };
|
| 31 |
bool b2 = &S::operator int && false; // previously false, now ill-formed
|