From bbbd2407cd40be0ddbe924f4888066079ffca761 Mon Sep 17 00:00:00 2001 From: Defmc Date: Sat, 24 Dec 2022 19:46:01 -0300 Subject: [PATCH] fix(build): include `stdexcept` in state source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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++`. --- table/src/state.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/table/src/state.cpp b/table/src/state.cpp index 8483669..d4a9ee2 100644 --- a/table/src/state.cpp +++ b/table/src/state.cpp @@ -4,6 +4,7 @@ #include "../../grammar/include/symbol.hpp" #include "../../grammar/include/token.hpp" #include +#include using namespace asparserations; using namespace grammar;