Fix some C++11 identifiers with special meaning parsing problems

Fix parsing of C++11 identifiers with special meaning (final and override) when
they are used as part of the scope name of an identifier, such as a namespace name.

Closes #1679
This commit is contained in:
William S Fulton 2019-12-10 19:26:05 +00:00
commit aa47b4c438
3 changed files with 38 additions and 2 deletions

View file

@ -873,10 +873,14 @@ int yylex(void) {
return (USING);
if (strcmp(yytext, "namespace") == 0)
return (NAMESPACE);
if (strcmp(yytext, "override") == 0)
if (strcmp(yytext, "override") == 0) {
last_id = 1;
return (OVERRIDE);
if (strcmp(yytext, "final") == 0)
}
if (strcmp(yytext, "final") == 0) {
last_id = 1;
return (FINAL);
}
} else {
if (strcmp(yytext, "class") == 0) {
Swig_warning(WARN_PARSE_CLASS_KEYWORD, cparse_file, cparse_line, "class keyword used, but not in C++ mode.\n");