<p dir="ltr">On 17 Jul 2014 11:13, "Mark Heffernan" <<a href="mailto:meheff@google.com">meheff@google.com</a>> wrote:<br>
><br>
> On Wed, Jul 16, 2014 at 4:57 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
>><br>
>> How about modeling the two options as either an IntegerLiteral or an IntegerLiteral within a ParenExpr?<br>
><br>
><br>
> Assuming I understand what you're suggesting, using a parenexpr would clean up the passing of the loophint information from parsing to sema. However, there would still be the ugliness of tracking the parens everywhere else, such as in the loop hint attr. This tracking would be for the sole purpose of pretty printing the same syntax as the code. From what Eli and Aaron have suggested about pretty printing, it seems that a better tradeoff is to just drop keeping track of parentheses and always pretty print with parens as this results in a cleaner implementation. Reasonable?</p>
<p dir="ltr">LoopHintAttr should track an Expr*, in order to provide source fidelity and to support arbitrary constant expressions and template instantiation. Keeping parens there should then not require any extra effort - but I think this is fairly low-value so I'm happy either way.</p>