From e26e0af78695227422a202ee9aebbc6f589e3a6b Mon Sep 17 00:00:00 2001 From: iridinite Date: Wed, 7 Aug 2024 16:00:46 +0200 Subject: [PATCH] Fix Natvis not resolving for template args with negative constant Given a class `template class Foo {};`, negative constants can be expected in the type name. The regex used to look for constants was missing support for the sign, and hence the above example would fail to parse. --- src/MIDebugEngine/Natvis.Impl/NatvisNames.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MIDebugEngine/Natvis.Impl/NatvisNames.cs b/src/MIDebugEngine/Natvis.Impl/NatvisNames.cs index 85972bdd8..ad8df5021 100644 --- a/src/MIDebugEngine/Natvis.Impl/NatvisNames.cs +++ b/src/MIDebugEngine/Natvis.Impl/NatvisNames.cs @@ -34,7 +34,7 @@ private void SetArraySize(int[] Dims) } private static Regex s_identifier = new Regex("^[a-zA-Z$_][a-zA-Z$_0-9]*"); - private static Regex s_numeric = new Regex("^[0-9]+(u|l|ul)*"); // only decimal constants + private static Regex s_numeric = new Regex("^[-]?[0-9]+(u|l|ul)*"); // only decimal constants private static Regex s_simpleType = new Regex( @"^(signed\s+char|unsigned\s+char|char16_t|char32_t|wchar_t|char|" + @"signed\s+short\s+int|signed\s+short|unsigned\s+short\s+int|unsigned\s+short|short\s+int|short|"