From 0c06ca3c3fb9ab609fcd94cd7a56f9838e034cae Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 24 Sep 2021 21:09:28 -0700 Subject: [PATCH] Mark parser_t::principal as const --- src/parser.cpp | 2 +- src/parser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index ff94fb581..078046cac 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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 parser_t::~parser_t() = default; -std::shared_ptr parser_t::principal{new parser_t()}; +const std::shared_ptr parser_t::principal{new parser_t()}; parser_t &parser_t::principal_parser() { ASSERT_IS_MAIN_THREAD(); diff --git a/src/parser.h b/src/parser.h index 2e87a404d..46811cf67 100644 --- a/src/parser.h +++ b/src/parser.h @@ -283,7 +283,7 @@ class parser_t : public std::enable_shared_from_this { parser_t(std::shared_ptr vars); /// The main parser. - static std::shared_ptr principal; + static const std::shared_ptr principal; public: // No copying allowed.