Skip to content

Commit 7fd8727

Browse files
authored
Fix incorrect tag generation for enum classes (#1900)
1 parent 4250c0e commit 7fd8727

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Generator/Generators/C/CppTypePrinter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ public string PrintTag(Class @class)
790790
{
791791
return string.Empty;
792792
}
793+
793794
switch (@class.TagKind)
794795
{
795796
case TagKind.Struct:
@@ -801,7 +802,7 @@ public string PrintTag(Class @class)
801802
case TagKind.Class:
802803
return "class ";
803804
case TagKind.Enum:
804-
return "enum ";
805+
return @class.Enums.First().IsScoped ? "enum class" : "enum ";
805806
default:
806807
throw new ArgumentOutOfRangeException(nameof(@class.TagKind));
807808
}

0 commit comments

Comments
 (0)