3434#define C11_KEYWORDS \
3535 " _Alignas" , " _Alignof" , " _Atomic" , " _Generic" , " _Noreturn" , " _Static_assert" , " _Thread_local"
3636
37- #ifdef __clang__
38- #pragma clang diagnostic push
39- #pragma clang diagnostic ignored "-Wunused-macros"
40- #endif
41-
4237#define C23_KEYWORDS \
4338 " alignas" , " alignof" , " bool" , " constexpr" , " false" , " nullptr" , " static_assert" , " thread_local" , " true" , " typeof" , " typeof_unqual" , \
4439 " _BitInt" , " _Decimal128" , " _Decimal32" , " _Decimal64"
4540
46- #ifdef __clang__
47- #pragma clang diagnostic pop
48- #endif
49-
5041static const std::unordered_set<std::string> c89_keywords_all = {
5142 C90_KEYWORDS
5243};
5344
54- static const std::unordered_set<std::string> c89_keywords = c89_keywords_all;
45+ static const std::unordered_set<std::string> c89_keywords = {
46+ C90_KEYWORDS
47+ };
5548
5649static const std::unordered_set<std::string> c99_keywords_all = {
5750 C90_KEYWORDS, C99_KEYWORDS
@@ -69,6 +62,13 @@ static const std::unordered_set<std::string> c11_keywords = {
6962 C11_KEYWORDS
7063};
7164
65+ static const std::unordered_set<std::string> c17_keywords_all = {
66+ C90_KEYWORDS, C99_KEYWORDS, C11_KEYWORDS
67+ };
68+
69+ static const std::unordered_set<std::string> c17_keywords = {
70+ };
71+
7272static const std::unordered_set<std::string> c23_keywords_all = {
7373 C90_KEYWORDS, C99_KEYWORDS, C11_KEYWORDS, C23_KEYWORDS
7474};
@@ -118,7 +118,9 @@ static const std::unordered_set<std::string> cpp03_keywords_all = {
118118 CPP03_KEYWORDS
119119};
120120
121- static const std::unordered_set<std::string> cpp03_keywords = cpp03_keywords_all;
121+ static const std::unordered_set<std::string> cpp03_keywords = {
122+ CPP03_KEYWORDS
123+ };
122124
123125static const std::unordered_set<std::string> cpp11_keywords_all = {
124126 CPP03_KEYWORDS, CPP11_KEYWORDS
@@ -128,13 +130,19 @@ static const std::unordered_set<std::string> cpp11_keywords = {
128130 CPP11_KEYWORDS
129131};
130132
131- static const std::unordered_set<std::string> cpp14_keywords_all = cpp11_keywords_all;
133+ static const std::unordered_set<std::string> cpp14_keywords_all = {
134+ CPP03_KEYWORDS, CPP11_KEYWORDS
135+ };
132136
133- static const std::unordered_set<std::string> cpp14_keywords;
137+ static const std::unordered_set<std::string> cpp14_keywords = {
138+ };
134139
135- static const std::unordered_set<std::string> cpp17_keywords_all = cpp11_keywords_all;
140+ static const std::unordered_set<std::string> cpp17_keywords_all = {
141+ CPP03_KEYWORDS, CPP11_KEYWORDS
142+ };
136143
137- static const std::unordered_set<std::string> cpp17_keywords;
144+ static const std::unordered_set<std::string> cpp17_keywords = {
145+ };
138146
139147static const std::unordered_set<std::string> cpp20_keywords_all = {
140148 CPP03_KEYWORDS, CPP11_KEYWORDS, CPP20_KEYWORDS
@@ -144,9 +152,19 @@ static const std::unordered_set<std::string> cpp20_keywords = {
144152 CPP20_KEYWORDS
145153};
146154
147- static const std::unordered_set<std::string> cpp23_keywords;
155+ static const std::unordered_set<std::string> cpp23_keywords = {
156+ };
157+
158+ static const std::unordered_set<std::string> cpp23_keywords_all = {
159+ CPP03_KEYWORDS, CPP11_KEYWORDS, CPP20_KEYWORDS
160+ };
161+
162+ static const std::unordered_set<std::string> cpp26_keywords = {
163+ };
148164
149- static const std::unordered_set<std::string> cpp23_keywords_all = cpp20_keywords_all;
165+ static const std::unordered_set<std::string> cpp26_keywords_all = {
166+ CPP03_KEYWORDS, CPP11_KEYWORDS, CPP20_KEYWORDS
167+ };
150168
151169// cppcheck-suppress unusedFunction
152170const std::unordered_set<std::string>& Keywords::getAll (Standards::cstd_t cStd)
@@ -158,8 +176,9 @@ const std::unordered_set<std::string>& Keywords::getAll(Standards::cstd_t cStd)
158176 case Standards::cstd_t ::C99:
159177 return c99_keywords_all;
160178 case Standards::cstd_t ::C11:
161- case Standards::cstd_t ::C17:
162179 return c11_keywords_all;
180+ case Standards::cstd_t ::C17:
181+ return c17_keywords_all;
163182 case Standards::cstd_t ::C23:
164183 return c23_keywords_all;
165184 }
@@ -182,6 +201,8 @@ const std::unordered_set<std::string>& Keywords::getAll(Standards::cppstd_t cppS
182201 return cpp20_keywords_all;
183202 case Standards::cppstd_t ::CPP23:
184203 return cpp23_keywords_all;
204+ case Standards::cppstd_t ::CPP26:
205+ return cpp26_keywords_all;
185206 }
186207 cppcheck::unreachable ();
187208}
@@ -196,10 +217,11 @@ const std::unordered_set<std::string>& Keywords::getOnly(Standards::cstd_t cStd)
196217 case Standards::cstd_t ::C99:
197218 return c99_keywords;
198219 case Standards::cstd_t ::C11:
199- case Standards::cstd_t ::C17:
200220 return c11_keywords;
221+ case Standards::cstd_t ::C17:
222+ return c17_keywords;
201223 case Standards::cstd_t ::C23:
202- return c23_keywords_all ;
224+ return c23_keywords ;
203225 }
204226 cppcheck::unreachable ();
205227}
@@ -221,6 +243,8 @@ const std::unordered_set<std::string>& Keywords::getOnly(Standards::cppstd_t cpp
221243 return cpp20_keywords;
222244 case Standards::cppstd_t ::CPP23:
223245 return cpp23_keywords;
246+ case Standards::cppstd_t ::CPP26:
247+ return cpp26_keywords;
224248 }
225249 cppcheck::unreachable ();
226250}
0 commit comments