Sometimes a result variable of some expression can be presented as an elaborated type. In this case the methods IsTypedefType() and GetTypedefedType() of SBType didn't work. This patch fixes that.
I didn't find the test for these API methods, so I added a basic test for this too.
The name of this function is fairly misleading as it only desugars elaborated types (but not e.g. auto, decltypes, typeof expressions, etc).
Do you want to desugar those too? If yes, then you could call RemoveWrappingTypes while passing "typedef" as the thing-to-avoid.