Improve adapt_adt test to check more case with type deduction.
Fix dependents scopes and typedefs with typename keywords.