Skip to content

Commit a7dd9ec

Browse files
committed
Various doc/comment cleanup, and remove the "helpful for Cpp1 transition" check for * following a type
Closes #1194
1 parent e621024 commit a7dd9ec

File tree

7 files changed

+7
-12
lines changed

7 files changed

+7
-12
lines changed

docs/cpp2/contracts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Notes:
1919

2020
The order of evaluation is:
2121

22-
- First, if the contract group is `unevaluated` then the contract is ignored; `condition` is never evaluated. This special group is designates conditions intended for use by static analyzers only, and the only requirement is that the condition be grammatically valid.
22+
- First, if the contract group is `unevaluated` then the contract is ignored; `condition` is never evaluated. This special group designates conditions intended for use by static analyzers only, and the only requirement is that the condition be grammatically valid.
2323

2424
- Next, predicates are evaluated in order. If any predicate evaluates to `#!cpp false`, stop.
2525

docs/cpp2/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ A function can return either of the following. The default is `#!cpp -> void`.
8080

8181
(1) **`#!cpp -> X`** to return a single unnamed value of type `X`, which can be `#!cpp void` to signify the function has no return value. If `X` is not `#!cpp void`, the function body must have a `#!cpp return /*value*/;` statement that returns a value of type `X` on every path that exits the function.
8282

83-
To deduce the return type, write `-> _`. A function whose body returns a single expression `expr` can deduce the return type and omit writing `-> _ = { return /*expr*/ ; }`.
83+
To deduce the return type, write `-> _`. A function whose body returns a single expression `expr` can deduce the return type, and omit writing the leading `-> _ = { return` and trailing `; }`.
8484

8585
For example:
8686

docs/cppfront/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Disable mixed-sign comparison safety checks. If not disabled, mixed-sign compari
5959

6060
### `-no-div-zero-checks`, `-no-d`
6161

62-
Disable integer division by zero checks. If not disabled, integer division by zero checks are performed by default.
62+
Disable integer division by zero checks. If not disabled, integer division by zero checks are performed by default when both the numerator and denominator are integer types.
6363

6464
### `-no-null-checks`, `-no-n`
6565

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ We can't make an improvement that large to C++ via gradual evolution to today's
3232

3333
## <a id="what-is-cppfront"></a> What is cppfront?
3434

35-
[**Cppfront**](https://github.com/hsutter/cppfront) is a compiler that compiles Cpp2 syntax to today's Cpp1 syntax. This lets you start trying out Cpp2 syntax in any existing C++ project and build system just by renaming a source file from `.cpp` to `.cpp2` and [adding a build step](#adding-cppfront-in-your-ide-build-system), and the result Just Works with every C++20 or higher compiler and all existing C++ tools (debuggers, build systems, sanitizers, etc.).
35+
[**Cppfront**](https://github.com/hsutter/cppfront) is a compiler that compiles Cpp2 syntax to today's Cpp1 syntax. This lets you start trying out Cpp2 syntax in any existing C++ project and build system just by renaming a source file from `.cpp` to `.cpp2` and [adding a build step](welcome/integration.md), and the result Just Works with every C++20 or higher compiler and all existing C++ tools (debuggers, build systems, sanitizers, etc.).
3636

3737
This deliberately follows Bjarne Stroustrup's wise approach with [**cfront**](https://en.wikipedia.org/wiki/Cfront), the original C++ compiler: In the 1980s and 1990s, Stroustrup created cfront to translate C++ to pure C, and similarly ensured that C++ could be interleaved with C in the same source file, and that C++ could always call any C code with no wrapping/marshaling/thunking. By providing a C++ compiler that emitted pure C, Stroustrup ensured full compatibility with the C ecosystems that already existed, and made it easy for people to start trying out C++ code in any existing C project by adding just another build step to translate the C++ to C first, and the result Just Worked with existing C tools.
3838

regression-tests/test-results/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cppfront compiler v0.7.2 Build 9731:1008
2+
cppfront compiler v0.7.2 Build 9731:1430
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"9731:1008"
1+
"9731:1430"

source/parse.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6030,7 +6030,7 @@ class parser
60306030
//G postfix-expression '(' expression-list? ','? ')'
60316031
//G postfix-expression '.' id-expression
60326032
//G postfix-expression '..' id-expression
6033-
//G postfix-expression '...' primary-expression
6033+
//G postfix-expression '..<' primary-expression
60346034
//G postfix-expression '..=' primary-expression
60356035
//G
60366036
auto postfix_expression()
@@ -6750,11 +6750,6 @@ class parser
67506750
return {};
67516751
}
67526752

6753-
if (curr().type() == lexeme::Multiply) {
6754-
error("'T*' is not a valid Cpp2 type; use '*T' for a pointer instead", false);
6755-
return {};
6756-
}
6757-
67586753
if (
67596754
allow_constraint
67606755
&& n->is_wildcard()

0 commit comments

Comments
 (0)