Skip to content

Commit

Permalink
Fix parse error for function declaration
Browse files Browse the repository at this point in the history
- cv qualifiers before inline etc. have been incorrectly parsed, leading
  to several follow-up errors (about 20000 parse errors in Qt6)
  • Loading branch information
mrbean-bremen committed Oct 29, 2023
1 parent 946d381 commit bfa9af6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions generator/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void Parser::tokenRequiredError(int token)
err += token_name(token_stream.lookAhead());
err += "''";


reportError(err);
}

Expand Down Expand Up @@ -1935,7 +1936,7 @@ bool Parser::parseClassSpecifier(TypeSpecifierAST *&node)

NameAST *name = 0;
parseName(name, true);

BaseClauseAST *bases = 0;

if (token_stream.lookAhead() == ':')
Expand Down Expand Up @@ -3165,11 +3166,14 @@ bool Parser::parseDeclarationInternal(DeclarationAST *&node)
WinDeclSpecAST *winDeclSpec = 0;
parseWinDeclSpec(winDeclSpec);

const ListNode<std::size_t>* cv = 0;
parseCvQualify(cv);

const ListNode<std::size_t> *funSpec = 0;
bool hasFunSpec = parseFunctionSpecifier(funSpec);

const ListNode<std::size_t> *cv = 0;
parseCvQualify(cv);
if (!cv)
parseCvQualify(cv);

const ListNode<std::size_t> *storageSpec = 0;
bool hasStorageSpec = parseStorageClassSpecifier(storageSpec);
Expand Down

0 comments on commit bfa9af6

Please sign in to comment.