Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping to unelaborated types. UnelaboratedTypeOf(Decl) #26

Open
GorNishanov opened this issue May 8, 2020 · 1 comment
Open

Add mapping to unelaborated types. UnelaboratedTypeOf(Decl) #26

GorNishanov opened this issue May 8, 2020 · 1 comment
Assignees

Comments

@GorNishanov
Copy link
Contributor

typedef int MyInt;
MyInt* x;

The IPR declaration of x knows it is type int*, information about MyInt is discarded.
We would like to have a mapping that allows to discover what user has written to declare x.
Maybe something like:

Optional<Type> UnelaboratedTypeOf(const Decl&);

If an alias/typedef was involved, the UnelaboratedTypeOf(Decl) will give As_type(MyInt)* type.

@GabrielDosReis GabrielDosReis self-assigned this Jun 21, 2020
@GabrielDosReis
Copy link
Owner

I agree that declarations, being generative, are places where additional declarative semantics fluff can be added. However the type asked for here is still elaborated -- imagine uses of template aliases (one still wants elaboration). There is a delicate balance to strike here between syntax and semantics. Ideally there should be a separate syntax tree that is mapped to the semantics (IPR), and there should be (ideally) a way to query the original alias type used to declare a name in the IPR decl node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants