GabrielDosReis / ipr

Compiler-neutral Internal Program Representation for C++
BSD 3-Clause "New" or "Revised" License
219 stars 23 forks source link

Remove `Base_type` #265

Closed GabrielDosReis closed 2 years ago

GabrielDosReis commented 2 years ago

One of the early semantic design decisions of the IPR was to view base-class types as declaring anonymous fields of the derived classes, as documented in the C++ ARM (original C++ semantics documentation). Over the years, that approach has felt at odd with other semantic aspect of the declarative model of the IPR. This patch removes Base_type as a Decl, and instead replaces it with just a specifier for base class layout indicator for semantic interpretations in later interpretations (e,g. object layout, object initialization, etc).

Fixes #65

GorNishanov commented 2 years ago

How to represent pack expansion of the base specifier? B<T>... in the example below:

template <typename T>
struct B{};

template <typename... T>
struct S : B<T>...
{
};