From 7fd87271efdd5dc0ea2101578b1616f2217dfeac Mon Sep 17 00:00:00 2001 From: Jelle Date: Sat, 8 Feb 2025 09:43:31 +0000 Subject: [PATCH] Fix incorrect tag generation for enum classes (#1900) --- src/Generator/Generators/C/CppTypePrinter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/C/CppTypePrinter.cs b/src/Generator/Generators/C/CppTypePrinter.cs index a8ea5caf..82ccdb8e 100644 --- a/src/Generator/Generators/C/CppTypePrinter.cs +++ b/src/Generator/Generators/C/CppTypePrinter.cs @@ -790,6 +790,7 @@ namespace CppSharp.Generators.C { return string.Empty; } + switch (@class.TagKind) { case TagKind.Struct: @@ -801,7 +802,7 @@ namespace CppSharp.Generators.C case TagKind.Class: return "class "; case TagKind.Enum: - return "enum "; + return @class.Enums.First().IsScoped ? "enum class" : "enum "; default: throw new ArgumentOutOfRangeException(nameof(@class.TagKind)); }