Support storage classes in function types (#46)

This commit is contained in:
Armin Ronacher
2019-07-15 17:12:38 +02:00
committed by GitHub
parent 619e5e65ed
commit 9f59d0dc92
+9 -1
View File
@@ -849,7 +849,15 @@ impl<'a> ParserState<'a> {
fn read_func_type(&mut self) -> Result<Type<'a>> {
let calling_conv = self.read_calling_conv()?;
let return_type = self.read_var_type(StorageClass::empty())?;
// this might have to be conditional on template context. For now
// this does not cause issues. For more information see
// https://github.com/mstange/msvc-demangler-rust/issues/21
let sc = if self.consume(b"?") {
self.read_storage_class()
} else {
StorageClass::empty()
};
let return_type = self.read_var_type(sc)?;
let params = self.read_func_params()?;
Ok(Type::NonMemberFunction(
calling_conv,