Fix DMD Issue 10425 - Link error with templates.

Merged dmdfe changes in typeinf.c
Update struct type info generation to reflect changes in dmd frontend
Remove redundant FuncDeclaration::nestedVars.

The change not only makes the code cleaner but also fixes compilation of multiple files at once.
Previously, fd->nestedVars may have been filled twice if fd was a template function instantiated in two modules simultaneously.
Implement cast to void
Implement ClassReferenceExp::toElem
Fix DMD Issue 10451 - Array of pointers to opaque struct gives forward reference errors.
 Fix DMD Issue 11238 - Codegen error when this is a ref parameter to the method
Fix DMD Issue 8360 - Destruction of uninitialized temporary struct with assert