Skip to content

fix(build): include stdexcept in state source#2

Open
Defmc wants to merge 1 commit intoalan-j-hu:masterfrom
Defmc:patch-1
Open

fix(build): include stdexcept in state source#2
Defmc wants to merge 1 commit intoalan-j-hu:masterfrom
Defmc:patch-1

Conversation

@Defmc
Copy link
Copy Markdown

@Defmc Defmc commented Dec 24, 2022

When compiling in Arch Linux with make install, G++ raises an error:

mkdir -p build
g++ -std=c++11 -c -o build/gen_json.o bootstrap/src/gen_json.cpp
g++ -std=c++11 -c -o build/grammar.o grammar/src/grammar.cpp
g++ -std=c++11 -c -o build/nonterminal.o grammar/src/nonterminal.cpp
g++ -std=c++11 -c -o build/token.o grammar/src/token.cpp
g++ -std=c++11 -c -o build/production.o grammar/src/production.cpp
g++ -std=c++11 -c -o build/table.o table/src/table.cpp
g++ -std=c++11 -c -o build/lr_table.o table/src/lr_table.cpp
g++ -std=c++11 -c -o build/lalr_table.o table/src/lalr_table.cpp
g++ -std=c++11 -c -o build/item_set.o table/src/item_set.cpp
g++ -std=c++11 -c -o build/item.o table/src/item.cpp
g++ -std=c++11 -c -o build/state.o table/src/state.cpp
table/src/state.cpp: In member function ‘void asparserations::table::State::add_transition(const asparserations::grammar::Symbol*, const asparserations::table::State*)’:
table/src/state.cpp:25:18: error: ‘runtime_error’ is not a member of ‘std’
   25 |       throw std::runtime_error("Bad cast from const Symbol* to const Token*");
      |                  ^~~~~~~~~~~~~
table/src/state.cpp:31:18: error: ‘runtime_error’ is not a member of ‘std’
   31 |       throw std::runtime_error(
      |                  ^~~~~~~~~~~~~
make: *** [Makefile:94: build/state.o] Error 1

The same occurs with clang++.

When compiling in Arch Linux with `make install`, G++ raises an error:
```
mkdir -p build
g++ -std=c++11 -c -o build/gen_json.o bootstrap/src/gen_json.cpp
g++ -std=c++11 -c -o build/grammar.o grammar/src/grammar.cpp
g++ -std=c++11 -c -o build/nonterminal.o grammar/src/nonterminal.cpp
g++ -std=c++11 -c -o build/token.o grammar/src/token.cpp
g++ -std=c++11 -c -o build/production.o grammar/src/production.cpp
g++ -std=c++11 -c -o build/table.o table/src/table.cpp
g++ -std=c++11 -c -o build/lr_table.o table/src/lr_table.cpp
g++ -std=c++11 -c -o build/lalr_table.o table/src/lalr_table.cpp
g++ -std=c++11 -c -o build/item_set.o table/src/item_set.cpp
g++ -std=c++11 -c -o build/item.o table/src/item.cpp
g++ -std=c++11 -c -o build/state.o table/src/state.cpp
table/src/state.cpp: In member function ‘void asparserations::table::State::add_transition(const asparserations::grammar::Symbol*, const asparserations::table::State*)’:
table/src/state.cpp:25:18: error: ‘runtime_error’ is not a member of ‘std’
   25 |       throw std::runtime_error("Bad cast from const Symbol* to const Token*");
      |                  ^~~~~~~~~~~~~
table/src/state.cpp:31:18: error: ‘runtime_error’ is not a member of ‘std’
   31 |       throw std::runtime_error(
      |                  ^~~~~~~~~~~~~
make: *** [Makefile:94: build/state.o] Error 1
``` 
The same occurs with `clang++`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant