Skip to content

Commit 60391cb

Browse files
committed
Fix up C++20 module pseudo-keyword masking variables/members
1 parent 19436e4 commit 60391cb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/code.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale
953953
}
954954
<Body>"module"/{B}*[:;]? { // 'module X' or 'module : private' or 'module;'
955955
if (yyextra->lang!=SrcLangExt::Cpp) REJECT;
956+
if (!yyextra->type.isEmpty() || !yyextra->name.isEmpty()) REJECT;
956957
startFontClass(yyscanner,"keyword");
957958
codifyLines(yyscanner,yytext);
958959
endFontClass(yyscanner);

src/scanner.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ NONLopt [^\n]*
10841084
}
10851085
<FindMembers>{B}*"module"{BN}*";" { // global module section
10861086
if (!yyextra->insideCpp) REJECT;
1087+
if (!yyextra->current->type.isEmpty() || !yyextra->current->name.isEmpty()) REJECT;
10871088
//printf("Implementation module unit\n");
10881089
lineCount(yyscanner);
10891090
BEGIN( FindMembers );

0 commit comments

Comments
 (0)