Skip to content

Commit 2c3ecc0

Browse files
committed
reserve virtual keyword in C++
1 parent 95c0686 commit 2c3ecc0

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 6.2.0
2+
- Made `virtual` a reserved keyword in C++
3+
14
Version 6.1.6
25
- Added ability to double quote to include quotes in literal BASIC strings
36
- Allowed BASIC string constants to initialize other consts

frontends/c/cgram.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ ConstructDefaultValue(AST *decl, AST *val)
10251025
%token C_THROW "throw"
10261026
%token C_THROWIF "__throwifcaught"
10271027
%token C_TRY "try"
1028+
%token C_VIRTUAL "virtual"
10281029

10291030
// asm only tokens
10301031
%token C_ALIGNL "alignl"

frontends/lexer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,6 +2449,7 @@ struct reservedword c_keywords[] = {
24492449
{ "__throw", C_THROW },
24502450
{ "__throwifcaught", C_THROWIF },
24512451
{ "__try", C_TRY },
2452+
{ "__virtual", C_VIRTUAL },
24522453
{ "typedef", C_TYPEDEF },
24532454
{ "__typeof__", C_TYPEOF },
24542455
{ "union", C_UNION },
@@ -2473,6 +2474,7 @@ struct reservedword cpp_keywords[] = {
24732474
{ "true", C_TRUE },
24742475
{ "try", C_TRY },
24752476
{ "typeof", C_TYPEOF },
2477+
{ "virtual", C_VIRTUAL },
24762478
};
24772479

24782480
// keywords reserved in BASIC only in asm blocks

0 commit comments

Comments
 (0)