Matheus Izvekov

Google Summer of Code Contributor 2022


Education: Computer Science

Complete project: Preserve type sugar for member access on template specializations
In C++, it’s often useful to write wrappers that abstract or extend some underlying type passed as a template argument. But templates are only instantated taking into account the ‘fundamental’ types of the arguments, discarding ‘type sugar’, such as any aliases, attributes or other cosmetic metadata such as how the name of the type was qualified and such. While this ends up in practice being brittle to rely on, attributes on the type itself or a typedef thereof can have many interesting non-cosmetic effects, like changing data alignment, calling conventions, and other custom / domain specific functionality. We refer to such ‘fundamental’ types as ‘canonical’ types here. Without any further engineering to work around this limitation, member accesses on template specializations will only reflect these canonical types, with the simplest example being the loss of any sugar on the argument when acessing a member alias to the argument itself. For this project, we will improve Clang’s type system so that any type sugar on the arguments of a template specialization are pushed into those member accesses.

Project Proposal: URL

Project Reports: Final Report|Blog post

Mentors: Vassil Vassilev, Richard Smith


Clang Template Specialization Resugaring - Roadmap Part 2, Slides, Team Meeting, 31 August 2022
Clang Template Specialization Resugaring - Roadmap Part 1, Slides, Team Meeting, 1 June 2022