Skip to content

error: ‘reverse’ is not a member of ‘std’ #377

@hangingman

Description

@hangingman

On C++ backend, generated codes should add #include <algorithm>

This is my output logs during building bnfc generated C++ code

make
g++ -g --ansi -W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unneeded-internal-declaration -c Absyn.C
g++ -g --ansi -W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unneeded-internal-declaration -c Parser.C
Nask.y: In function ‘int nask_parse(yyscan_t, YYSTYPE*)’:
Nask.y:440:27: error: ‘reverse’ is not a member of ‘std’
  440 | Program : ListStmt { std::reverse($1->begin(),$1->end()) ;$$ = new Prog($1); result->program_ = $$; }

Metadata

Metadata

Assignees

Labels

C++parserIssues concerning parser generatingregression in 2.9.2Regression that first appeared in BNFC 2.9.2

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions