Skip to content

Commit 1394723

Browse files
committed
Add hint for sizeof too, see #418
Add similar hints for `sizeof` as in 6644bd4 Also, add diagnostics for attempts to use `co_await` and `co_yield` which aren't supported yet (and almost certainly won't be spelled that way)
1 parent 6644bd4 commit 1394723

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

regression-tests/test-results/version

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

2-
cppfront compiler v0.2.1 Build 8520:1228
2+
cppfront compiler v0.2.1 Build 8520:1316
33
Copyright(c) Herb Sutter All rights reserved
44

55
SPDX-License-Identifier: CC-BY-NC-ND-4.0
66
No commercial use
77
No forks/derivatives
8-
(At this time, while this is a personal experiment)
8+
Note: This license emphasizes that this is a personal
9+
experiment; it will be upgraded if that changes
910

1011
Absolutely no warranty - try at your own risk

source/build.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"8520:1228"
1+
"8520:1316"

source/parse.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4474,6 +4474,14 @@ class parser
44744474
error( "use 'new<" + curr().to_string(true) + ">', not 'new " + curr().to_string(true) + "'", false);
44754475
return {};
44764476
}
4477+
if (*n->identifier == "sizeof") {
4478+
error( "use 'sizeof(" + curr().to_string(true) + ")', not 'sizeof " + curr().to_string(true) + "'", false);
4479+
return {};
4480+
}
4481+
if (*n->identifier == "co_await" || *n->identifier == "co_yield") {
4482+
error( "(temporary alpha limitation) coroutines are not yet supported in Cpp2", false);
4483+
return {};
4484+
}
44774485
}
44784486

44794487
return n;

0 commit comments

Comments
 (0)