Should this not cover `enum struct` as well (an alias of `enum class`)? On Wed, 7 Oct 2026 at 22:06, Arthur Cohen <[email protected]> wrote:
> Thanks Andrea! Pushed to trunk. > > Best, > > Arthur > > On 10/7/26 11:36 PM, Andrea Pinski wrote: > > On Wed, Oct 7, 2026 at 4:36 AM <[email protected]> wrote: > >> > >> From: Arthur Cohen <[email protected]> > >> > >> Hi, > >> > >> When a changelog is generated for an enum class, the entry only lists > >> it as `(enum class)` instead of `(enum class Foo)`, which defeats the > >> point. We use enum classes a *lot* in the Rust frontend, and always > >> have to modify that part of the generated Changelog skeleton manually > >> when creating or modifying such a class, which sucks. > >> > >> Note that my regex-fu is very weak and there's probably a better way to > >> do this, which I'd be happy to use instead. Please let me know. > > > > Ok. > > > >> > >> Best, > >> > >> Arthur > >> > >> This avoids `enum class Foo` showing up as `enum class` in the > generated Changelog and instead > >> properly recognizes the start of the type. > >> > >> contrib/ChangeLog: > >> > >> * mklog.py: Add "enum class" as a type starter to the struct > regex. > >> --- > >> contrib/mklog.py | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/contrib/mklog.py b/contrib/mklog.py > >> index 557ab42e7ff..fa0b1273863 100755 > >> --- a/contrib/mklog.py > >> +++ b/contrib/mklog.py > >> @@ -77,7 +77,7 @@ dg_regex = re.compile(r'{\s+dg-(error|warning)') > >> pr_filename_regex = re.compile(r'(^|[\W_])[Pp][Rr](?P<pr>\d{4,})') > >> identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)') > >> comment_regex = re.compile(r'^\/\*') > >> -struct_regex = re.compile(r'^(class|struct|union|enum)\s+' > >> +struct_regex = re.compile(r'^(class|struct|union|enum class|enum)\s+' > >> r'(GTY\(.*\)\s+)?([a-zA-Z0-9_]+)') > >> macro_regex = re.compile(r'#\s*(define|undef)\s+([a-zA-Z0-9_]+)') > >> super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)') > >> -- > >> 2.50.1 > >> > >
