mirror of
https://github.com/encounter/msvc-demangler-rust.git
synced 2026-07-10 12:18:38 -07:00
demangle references to function types
This case is exactly the same as the P6 special case in `read_var_type`, but for references this time. Fixes #20.
This commit is contained in:
committed by
Jeff Muizelaar
parent
891a684c60
commit
bacdf3a7ba
+13
@@ -773,6 +773,11 @@ impl<'a> ParserState<'a> {
|
||||
return Ok(Type::Enum(name, sc));
|
||||
}
|
||||
|
||||
if self.consume(b"A6") {
|
||||
let func_type = self.read_func_type()?;
|
||||
return Ok(Type::Ref(Box::new(func_type), sc));
|
||||
}
|
||||
|
||||
if self.consume(b"P6") {
|
||||
let func_type = self.read_func_type()?;
|
||||
return Ok(Type::Ptr(Box::new(func_type), sc));
|
||||
@@ -1689,6 +1694,14 @@ mod tests {
|
||||
"??B?$function@$$A6AXXZ@std@@QBE_NXZ",
|
||||
"public: __thiscall std::function<void __cdecl(void)>::operator bool(void)const",
|
||||
);
|
||||
expect(
|
||||
"??$?RA6AXXZ$$V@SkOnce@@QAEXA6AXXZ@Z",
|
||||
"public: void __thiscall SkOnce::operator()<void __cdecl (&)(void)>(void __cdecl (&)(void))",
|
||||
);
|
||||
expect_undname_failure(
|
||||
"??$?RA6AXXZ$$V@SkOnce@@QAEXA6AXXZ@Z",
|
||||
"public: void __thiscall SkOnce::operator()<void (__cdecl&)(void)>(void (__cdecl&)(void))",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user