From bcae0304a3903573ecd0a72e26e65e9b5ecf490e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 19 Jan 2022 10:50:52 +0100 Subject: [PATCH] Set line info on class properties This will allow to generate error messages that point to the right line if there is something wrong or not supported in a class property declaration. Signed-off-by: Lars-Peter Clausen --- pform_pclass.cc | 1 + pform_types.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pform_pclass.cc b/pform_pclass.cc index a129e19be..f922b9df9 100644 --- a/pform_pclass.cc +++ b/pform_pclass.cc @@ -86,6 +86,7 @@ void pform_class_property(const struct vlltype&loc, pform_cur_class->type->properties[curp->name] = class_type_t::prop_info_t(property_qual,use_type); + FILE_NAME(&pform_cur_class->type->properties[curp->name], loc); if (PExpr*rval = curp->expr.release()) { PExpr*lval = new PEIdent(curp->name); diff --git a/pform_types.h b/pform_types.h index dc4bb8da4..45e312e6f 100644 --- a/pform_types.h +++ b/pform_types.h @@ -336,7 +336,7 @@ struct class_type_t : public data_type_t { std::listbase_args; // This is a map of the properties. Map the name to the type. - struct prop_info_t { + struct prop_info_t : public LineInfo { inline prop_info_t() : qual(property_qualifier_t::make_none()), type(0) { } inline prop_info_t(property_qualifier_t q, data_type_t*t) : qual(q), type(t) { } property_qualifier_t qual;