[PATCH][RFC] Add quotes for constexpr keyword.

Jonathan Wakely jwakely@redhat.com
Wed Nov 15 16:59:00 GMT 2017


On 15/11/17 09:30 -0700, Martin Sebor wrote:
>On 11/15/2017 05:45 AM, Martin Liška wrote:
>>On 11/06/2017 07:29 PM, Martin Sebor wrote:
>>>Sorry for being late with my comment.  I just spotted this minor
>>>formatting issue.  Even though GCC isn't (yet) consistent about
>>>it the keyword "constexpr" should be quoted in the error message
>>>below (and, eventually, in all diagnostic messages).  Since the
>>>patch has been committed by now this is just a reminder for us
>>>to try to keep this in mind in the future.
>>
>>Hi.
>>
>>I've prepared patch for that. If it's desired, I can fix test-suite follow-up.
>>Do we want to change it also for error messages like:
>>"call to non-constexpr function"
>>"constexpr call flows off the end of the function"
>
>If GCC had support for italics for defined terms of the language
>or the grammar /constexpr function/ would be italicized because
>it's a defined term.  Absent that, I think I would quote them all
>for consistency.
>
>Martin
>
>PS I checked the C++ standard to see how it used the term and
>the choices it makes seem pretty arbitrary.  There are even
>sentences with two instances of two word, one in fixed width
>font and the other in proportional.  So I don't think we can
>use the spec as an example to follow.

Did you check the latest draft? That should have been fixed.

Defined terms should only be italicized when introduced, not when
used, e.g. in [dcl.constexpr] p2 "constexpr function" and "constexpr
constructor" are italicized, but are in normal font elsewhere. When
referring specifically to the keyword `constexpr` it should be in code
font.

Grammar productions are always italicized, but "constexpr function" is
not a grammar production.



More information about the Gcc-patches mailing list