[PATCH] Introducing initial UseAuto transform

Edwin Vane edwin.vane at intel.com
Tue Feb 12 08:46:11 PST 2013


  I'm not sure sugar really matters. If the user wants to use some sugared type that's fine. To a compiler's view, with all sugar stripped away, when the LHS type is the same as the RHS type auto is safe to use. But safety is really only one aspect to the transform: we also care about readability. I realize that using 'auto' will replace whatever sugar the user used but I would argue that the readability of the program is not impacted and is probably improved.

  That said, one could foresee an improvement to this transform that tests for unusual sugar and then prompts the user. Such a test would be really fragile since we'd be resorting to string comparisons on type names.

http://llvm-reviews.chandlerc.com/D392



More information about the cfe-commits mailing list