Skip to content

Commit 0451bf3

Browse files
authored
Fix build with Clang 19
``` mfast315128adcd459/p/include/mfast/ext_ref.h:131:40: error: no member named 'optional' in 'ext_cref<mfast::decimal_cref, tuple<type-parameter-0-0, type-parameter-0-1>, type-parameter-0-2>' 131 | bool present() const { return !this->optional() || base_.present(); } | ~~~~ ^ 1 error generated. ```
1 parent d8036e0 commit 0451bf3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/mfast/ext_ref.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ext_cref : public ext_ref_properties<OpType, Properties> {
101101
explicit ext_cref(const field_cref &base) : base_(base) {}
102102
explicit ext_cref(const aggregate_cref &base) : base_(base) {}
103103
cref_type get() const { return base_; }
104-
bool present() const { return !this->optional() || base_.present(); }
104+
bool present() const { return !static_cast<cref_type*>(this)->optional() || base_.present(); }
105105

106106
private:
107107
cref_type base_;
@@ -128,7 +128,7 @@ class ext_cref<decimal_cref, std::tuple<ExponentOp, MantissaOp>, Properties> {
128128
exponent_type get_exponent() const {
129129
return exponent_type(base_.get_exponent());
130130
}
131-
bool present() const { return !this->optional() || base_.present(); }
131+
bool present() const { return !static_cast<cref_type*>(this)->optional() || base_.present(); }
132132

133133
private:
134134
decimal_cref base_;
@@ -193,7 +193,7 @@ class ext_cref<nested_message_cref, group_type_tag, Properties>
193193

194194
explicit ext_cref(const field_cref &other) : base_(other) {}
195195
cref_type get() const { return cref_type(aggregate_cref(base_)[0]); }
196-
bool present() const { return !this->optional() || base_.present(); }
196+
bool present() const { return !static_cast<cref_type*>(this)->optional() || base_.present(); }
197197

198198
private:
199199
field_cref base_;
@@ -211,7 +211,7 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
211211

212212
ext_mref(field_mref other) : base_(std::move(other)) {}
213213
mref_type set() const {
214-
if (this->optional()) {
214+
if (static_cast<mref_type*>(this)->optional()) {
215215
value_storage *storage = field_mref_core_access::storage_of(this->base_);
216216
storage->present(true);
217217
}
@@ -224,9 +224,9 @@ class ext_mref : public ext_ref_properties<OpType, Properties> {
224224
;
225225
}
226226

227-
bool present() const { return !this->optional() || base_.present(); }
227+
bool present() const { return !static_cast<mref_type*>(this)->optional() || base_.present(); }
228228
void omit() const {
229-
if (this->optional())
229+
if (static_cast<mref_type*>(this)->optional())
230230
base_.omit();
231231
}
232232

@@ -341,16 +341,16 @@ class ext_mref<nested_message_mref, group_type_tag, Properties>
341341
explicit ext_mref(field_mref other) : base_(std::move(other)) {}
342342
cref_type get() const { return cref_type(aggregate_cref(base_)[0]); }
343343
mref_type set() const {
344-
if (this->optional()) {
344+
if (static_cast<mref_type*>(this)->optional()) {
345345
value_storage *storage = field_mref_core_access::storage_of(this->base_);
346346
storage->present(true);
347347
}
348348
return mref_type(aggregate_mref(base_)[0]);
349349
}
350350

351-
bool present() const { return !this->optional() || base_.present(); }
351+
bool present() const { return !static_cast<mref_type*>(this)->optional() || base_.present(); }
352352
void omit() const {
353-
if (this->optional())
353+
if (static_cast<mref_type*>(this)->optional())
354354
base_.omit();
355355
}
356356

0 commit comments

Comments
 (0)