This is an update from the previous patch, D1067, with some-but-not-all support for static data member templates.
Comments from previous reviews have also been incorporated here.
Missing features are documented as FIXMEs and TODOs.
More test cases, including as requested in the reviews, are under development.