Skip to content

Commit e162040

Browse files
committed
[sipify] handle scope based enums
1 parent 05756e5 commit e162040

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/sipify.pl

+3-2
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,9 @@ sub detect_non_method_member{
950950
}
951951

952952
# Enum declaration
953-
if ( $LINE =~ m/^\s*enum\s+\w+.*?$/ ){
954-
write_output("ENU1", "$LINE\n");
953+
# For scoped and type based enum, the type has to be removed
954+
if ( $LINE =~ m/^(\s*enum\s+(class\s+)?\w+)(\s*:\s*\w+)?.*$/ ){
955+
write_output("ENU1", "$1\n");
955956
if ($LINE =~ m/\{((\s*\w+)(\s*=\s*[\w\s\d<|]+.*?)?(,?))+\s*\}/){
956957
# one line declaration
957958
$LINE !~ m/=/ or exit_with_error("spify.pl does not handle enum one liners with value assignment. Use multiple lines instead.");

0 commit comments

Comments
 (0)