2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-26 19:55:08 +00:00

Mark parser_t::principal as const

This commit is contained in:
ridiculousfish 2021-09-24 21:09:28 -07:00
parent 4f466cb916
commit 0c06ca3c3f
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ parser_t::parser_t() : parser_t(env_stack_t::principal_ref()) {}
// Out of line destructor to enable forward declaration of parse_execution_context_t // Out of line destructor to enable forward declaration of parse_execution_context_t
parser_t::~parser_t() = default; parser_t::~parser_t() = default;
std::shared_ptr<parser_t> parser_t::principal{new parser_t()}; const std::shared_ptr<parser_t> parser_t::principal{new parser_t()};
parser_t &parser_t::principal_parser() { parser_t &parser_t::principal_parser() {
ASSERT_IS_MAIN_THREAD(); ASSERT_IS_MAIN_THREAD();

View file

@ -283,7 +283,7 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
parser_t(std::shared_ptr<env_stack_t> vars); parser_t(std::shared_ptr<env_stack_t> vars);
/// The main parser. /// The main parser.
static std::shared_ptr<parser_t> principal; static const std::shared_ptr<parser_t> principal;
public: public:
// No copying allowed. // No copying allowed.