From 4f260c5e98def6bd1b3498d4085de5080cca7641 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 17 Jul 2026 17:36:59 +0200 Subject: Disallow "[n] const T" --- include/elna/boot/name_analysis.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/elna/boot/name_analysis.h b/include/elna/boot/name_analysis.h index 4498d0c..feef3bf 100644 --- a/include/elna/boot/name_analysis.h +++ b/include/elna/boot/name_analysis.h @@ -40,16 +40,14 @@ namespace elna::boot local_export }; - private: - std::string identifier; - kind error_kind; - - public: - declaration_error(const kind error_kind, const boot::identifier& identifier); std::string what() const override; + + private: + std::string identifier; + kind error_kind; }; /** @@ -70,6 +68,18 @@ namespace elna::boot std::optional> note() const override; }; + /** + * Array size before \c const is not valid — only \c const [n]T is + * accepted, not \c [n]const T. + */ + class const_array_error : public error + { + public: + explicit const_array_error(const source_position position); + + std::string what() const override; + }; + /** * Origin of a field in a composite type. */ -- cgit v1.2.3