[PATCH] D33424: Lexer: allow imaginary constants in GNU mode (only).

Tim Northover via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 10:34:42 PDT 2017


On 24 May 2017 at 17:54, Richard Smith <richard at metafoo.co.uk> wrote:
> Yikes :-( Maybe libc++ *should* have that extension then. It sounds like
> we'll silently get the wrong value for any attempt at std::complex /
> _Complex interop right now:

That sounds like a pretty good idea whatever we decide to do about the literals.

But we do need to sort out what we're going to do here. I quite like
the approach you suggested, and think it's an improvement worth
putting in for gnu++ modes regardless.

So the remaining question is what we should do for the
standards-compliant C++ modes. We seem to have 3 plausible options:

1. Bar it everywhere. It's an extension.
2. Bar it for C++14 onwards, where the standard provides literals.
3. Allow it everywhere.

Although 2 would be the most conservative option (it maintains all
existing behaviour), it's my least favourite for the added complexity
and quirkiness.

My original inclination is to go with Marshall and pick 1, but it's a
very weak preference and I know I tend to be a bit user-hostile in
these situations.

So, how do we resolve this. Does anyone else have opinions?

Tim.


More information about the cfe-commits mailing list