@@ -166,15 +166,22 @@ def note_constexpr_heap_alloc_limit_exceeded : Note<
166
166
def note_constexpr_this : Note<
167
167
"%select{|implicit }0use of 'this' pointer is only allowed within the "
168
168
"evaluation of a call to a 'constexpr' member function">;
169
- def note_constexpr_lifetime_ended : Note <
169
+ def access_kind : TextSubstitution <
170
170
"%select{read of|read of|assignment to|increment of|decrement of|"
171
171
"member call on|dynamic_cast of|typeid applied to|construction of|"
172
- "destruction of}0 %select{temporary|variable}1 whose "
173
- "%plural{8:storage duration|:lifetime}0 has ended">;
174
- def note_constexpr_access_uninit : Note<
172
+ "destruction of}0">;
173
+ def access_kind_subobject : TextSubstitution<
175
174
"%select{read of|read of|assignment to|increment of|decrement of|"
176
175
"member call on|dynamic_cast of|typeid applied to|"
177
- "construction of subobject of|destruction of}0 "
176
+ "construction of subobject of|destruction of}0">;
177
+ def access_kind_volatile : TextSubstitution<
178
+ "%select{read of|read of|assignment to|increment of|decrement of|"
179
+ "<ERROR>|<ERROR>|<ERROR>|<ERROR>|<ERROR>}0">;
180
+ def note_constexpr_lifetime_ended : Note<
181
+ "%sub{access_kind}0 %select{temporary|variable}1 whose "
182
+ "%plural{8:storage duration|:lifetime}0 has ended">;
183
+ def note_constexpr_access_uninit : Note<
184
+ "%sub{access_kind_subobject}0 "
178
185
"%select{object outside its lifetime|uninitialized object}1 "
179
186
"is not allowed in a constant expression">;
180
187
def note_constexpr_use_uninit_reference : Note<
@@ -184,20 +191,16 @@ def note_constexpr_modify_const_type : Note<
184
191
"modification of object of const-qualified type %0 is not allowed "
185
192
"in a constant expression">;
186
193
def note_constexpr_access_volatile_type : Note<
187
- "%select{read of|read of|assignment to|increment of|decrement of|"
188
- "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
194
+ "%sub{access_kind_volatile}0 "
189
195
"volatile-qualified type %1 is not allowed in a constant expression">;
190
196
def note_constexpr_access_volatile_obj : Note<
191
- "%select{read of|read of|assignment to|increment of|decrement of|"
192
- "<ERROR>|<ERROR>|<ERROR>|<ERROR>}0 "
197
+ "%sub{access_kind_volatile}0 "
193
198
"volatile %select{temporary|object %2|member %2}1 is not allowed in "
194
199
"a constant expression">;
195
200
def note_constexpr_volatile_here : Note<
196
201
"volatile %select{temporary created|object declared|member declared}0 here">;
197
202
def note_constexpr_access_mutable : Note<
198
- "%select{read of|read of|assignment to|increment of|decrement of|"
199
- "member call on|dynamic_cast of|typeid applied to|construction of|"
200
- "destruction of}0 "
203
+ "%sub{access_kind}0 "
201
204
"mutable member %1 is not allowed in a constant expression">;
202
205
def note_constexpr_ltor_non_const_int : Note<
203
206
"read of non-const variable %0 is not allowed in a constant expression">;
@@ -209,47 +212,28 @@ def note_constexpr_ltor_non_constexpr : Note<
209
212
def note_constexpr_ltor_incomplete_type : Note<
210
213
"read of incomplete type %0 is not allowed in a constant expression">;
211
214
def note_constexpr_access_null : Note<
212
- "%select{read of|read of|assignment to|increment of|decrement of|"
213
- "member call on|dynamic_cast of|typeid applied to|construction of|"
214
- "destruction of}0 "
215
+ "%sub{access_kind}0 "
215
216
"dereferenced null pointer is not allowed in a constant expression">;
216
217
def note_constexpr_access_past_end : Note<
217
- "%select{read of|read of|assignment to|increment of|decrement of|"
218
- "member call on|dynamic_cast of|typeid applied to|construction of|"
219
- "destruction of}0 "
220
- "dereferenced one-past-the-end pointer is not allowed "
221
- "in a constant expression">;
218
+ "%sub{access_kind}0 dereferenced one-past-the-end pointer "
219
+ "is not allowed in a constant expression">;
222
220
def note_constexpr_access_unsized_array : Note<
223
- "%select{read of|read of|assignment to|increment of|decrement of|"
224
- "member call on|dynamic_cast of|typeid applied to|construction of|"
225
- "destruction of}0 "
226
- "element of array without known bound "
221
+ "%sub{access_kind}0 element of array without known bound "
227
222
"is not allowed in a constant expression">;
228
223
def note_constexpr_access_inactive_union_member : Note<
229
- "%select{read of|read of|assignment to|increment of|decrement of|"
230
- "member call on|dynamic_cast of|typeid applied to|"
231
- "construction of subobject of|destruction of}0 "
224
+ "%sub{access_kind_subobject}0 "
232
225
"member %1 of union with %select{active member %3|no active member}2 "
233
226
"is not allowed in a constant expression">;
234
227
def note_constexpr_union_member_change_during_init : Note<
235
228
"assignment would change active union member during the initialization of "
236
229
"a different member of the same union">;
237
230
def note_constexpr_access_static_temporary : Note<
238
- "%select{read of|read of|assignment to|increment of|decrement of|"
239
- "member call on|dynamic_cast of|typeid applied to|reconstruction of|"
240
- "destruction of}0 temporary "
241
- "is not allowed in a constant expression outside the expression that "
242
- "created the temporary">;
231
+ "%sub{access_kind}0 temporary is not allowed in a constant expression "
232
+ "outside the expression that created the temporary">;
243
233
def note_constexpr_access_unreadable_object : Note<
244
- "%select{read of|read of|assignment to|increment of|decrement of|"
245
- "member call on|dynamic_cast of|typeid applied to|construction of|"
246
- "destruction of}0 "
247
- "object '%1' whose value is not known">;
234
+ "%sub{access_kind}0 object '%1' whose value is not known">;
248
235
def note_constexpr_access_deleted_object : Note<
249
- "%select{read of|read of|assignment to|increment of|decrement of|"
250
- "member call on|dynamic_cast of|typeid applied to|construction of|"
251
- "destruction of}0 "
252
- "heap allocated object that has been deleted">;
236
+ "%sub{access_kind}0 heap allocated object that has been deleted">;
253
237
def note_constexpr_modify_global : Note<
254
238
"a constant expression cannot modify an object that is visible outside "
255
239
"that expression">;
0 commit comments