diff --git a/src/Generator/Passes/CleanInvalidDeclNamesPass.cs b/src/Generator/Passes/CleanInvalidDeclNamesPass.cs index 70ecfc9b..9bd526e9 100644 --- a/src/Generator/Passes/CleanInvalidDeclNamesPass.cs +++ b/src/Generator/Passes/CleanInvalidDeclNamesPass.cs @@ -123,6 +123,12 @@ namespace CppSharp.Passes return base.VisitTypedefDecl(typedef); } + public override bool VisitVariableDecl(Variable variable) + { + variable.Name = CheckName(variable.Name); + return base.VisitVariableDecl(variable); + } + private static void CheckEnumName(Enumeration @enum) { // If we still do not have a valid name, then try to guess one diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index 09b0669e..969ea700 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -10,6 +10,8 @@ public: int& operator[](int i); int A; + static int null; + protected: int P; }; @@ -265,4 +267,4 @@ public: void setIgnoredType(const IgnoredType& value); private: IgnoredType _ignoredType; -}; \ No newline at end of file +};