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

Get rid of parenType, parenTypeExpr #43

Closed
krame505 opened this issue May 19, 2017 · 5 comments
Closed

Get rid of parenType, parenTypeExpr #43

krame505 opened this issue May 19, 2017 · 5 comments

Comments

@krame505
Copy link
Member

These productions are used to preserve parentheses written as part of a type expression, and don't have any semantic meaning. As far as I can tell, parens are only needed in type expressions for function pointers? Is there a reason we can't just add these parens when needed while pretty-printing the type expression, getting rid of these productions? This was a point of confusion for me in trying to get function pointers working.

@ericvanwyk
Copy link
Contributor

ericvanwyk commented May 19, 2017 via email

@tedinski
Copy link
Member

Including things like this was one of the major innovations that made clang a better compiler than all the others when it comes to error messages. It reports back the type the user wrote, including how they parenthesized it, so it's comprehensible.

How is it getting in the way? The point of non-canonical type is that you should be able to ignore them.

@krame505
Copy link
Member Author

krame505 commented May 19, 2017 via email

@tedinski
Copy link
Member

Ah, that's a bug to fix in the pretty printer, then.

@krame505
Copy link
Member Author

Actually, it looks like I already fixed that bug as well.

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

3 participants