aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-17 17:36:59 +0200
committerEugen Wissner <belka@caraus.de>2026-07-17 17:36:59 +0200
commit4f260c5e98def6bd1b3498d4085de5080cca7641 (patch)
tree89f80e6ffba1aa7a89702e40a3010a43b4639c08 /include
parente676e74efbbbf62887b9442326399eebccc4d108 (diff)
downloadelna-4f260c5e98def6bd1b3498d4085de5080cca7641.tar.gz
Disallow "[n] const T"
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/name_analysis.h22
1 files changed, 16 insertions, 6 deletions
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;
};
/**
@@ -71,6 +69,18 @@ namespace elna::boot
};
/**
+ * 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.
*/
struct field_origin