From 65db45693ed6460478108f7c86605200df095179 Mon Sep 17 00:00:00 2001 From: Ajay Brahmakshatriya Date: Thu, 15 Feb 2024 12:44:04 -0500 Subject: [PATCH] Moved with_name to forward decls so builder_context can see it --- include/builder/dyn_var.h | 11 ----------- include/builder/forward_declarations.h | 14 +++++++++++++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/builder/dyn_var.h b/include/builder/dyn_var.h index d3ff0f5..6bc34e0 100644 --- a/include/builder/dyn_var.h +++ b/include/builder/dyn_var.h @@ -79,17 +79,6 @@ struct as_compound_expr { }; using cast = as_compound_expr; -struct as_global { - std::string name; - as_global(const std::string &n) : name(n) {} -}; -// With name is just like as_global but can be used locally -struct with_name { - std::string name; - bool with_decl; - with_name(const std::string &n, bool wd = false) : name(n), with_decl(wd) {} -}; - template class dyn_var_impl : public var { public: diff --git a/include/builder/forward_declarations.h b/include/builder/forward_declarations.h index 06de387..6d04413 100644 --- a/include/builder/forward_declarations.h +++ b/include/builder/forward_declarations.h @@ -47,7 +47,19 @@ struct defer_init { // No members }; -struct with_name; + +// Constructor helpers for dyn_var +struct as_global { + std::string name; + as_global(const std::string &n) : name(n) {} +}; +// With name is just like as_global but can be used locally +struct with_name { + std::string name; + bool with_decl; + with_name(const std::string &n, bool wd = false) : name(n), with_decl(wd) {} +}; + } // namespace builder #endif