-
Notifications
You must be signed in to change notification settings - Fork 6
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
Comments
I think these should be removed. Ted, any compelling reason they are there
now?
…On Fri, May 19, 2017 at 2:37 PM, Lucas Kramer ***@***.***> wrote:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#43>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADOhdzcVUqlDElT62uhhgLsMT7hAxbNsks5r7e-LgaJpZM4Ng70N>
.
|
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. |
Hmm, I suppose for error messages it would make sense. The point of
confusion for me is that functionType must always be wrapped in parenType
when writing a function pointer, pointerType(functionType(...)) generates
syntactically invalid C code.
Lucas Kramer
…On Fri, May 19, 2017 at 3:10 PM, Ted Kaminski ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIE1igovjDCNMabjPYubIjHz3L40-KOPks5r7fdNgaJpZM4Ng70N>
.
|
Ah, that's a bug to fix in the pretty printer, then. |
Actually, it looks like I already fixed that bug as well. |
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.
The text was updated successfully, but these errors were encountered: