This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libcpp] Issue a pedantic warning for UCNs outside UCS codespace
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Sep 2019 15:54:01 +0000
- Subject: Re: [libcpp] Issue a pedantic warning for UCNs outside UCS codespace
- Ironport-sdr: bjhtvciSay3gZsYf/HsGY9MzAsO5rIqSNO7eCsTkQ9mPaJLR1ffEVZJnPf2pIUenLVe0RsO4pg SvLThocMlllityAW1IBoGglwL9ugJXmuEX+qwauOcZ9NVCXdh9MFKjwRsjzNURXQOGpff9UGKC 17BMu0J/+AHDTM5dNTJT5RRmtG/se8pYBbX5GIVrwpWRADT9HYyNA1QGttMliBXZee8vX0NIea rCX9Y3y5kNFFFwJ36qhJyLHX2jjv5FB1lIQg5XdCur5bXcsBxa8v5mZuC5hV6o53Y8QxLWtt6K Fcw=
- Ironport-sdr: SpkTkC6E7GZw8NOGv98XOwtTa5/pKMzeGhG+okDvXS0hzqCnoxG/xacYG8qCDdHRhW7e57T4yI uYdWEdiNG/BjI+/uze3zvfBAuX7t1tPsKvOxm1XxI6jq6Rw1mfr021B4NXGMNGA461+/sSJDOk YQouK7x5qSr1cFtM01KmuU5YFqjoevH4S5DUTtVutXycZUPenMZn4xwKKZtLLGGEi/qc7owIEG xMNmB1gi767kMJT9ZtHDvezy1Ht1uh+HVTkL5z9MtKdTaVr0iQyREOtueR/XMXIVg6pzF7zl8a LuQ=
- References: <46160747.VyTTuRmQVZ@polaris> <alpine.DEB.2.21.1909252320370.30151@digraph.polyomino.org.uk> <1737453.gslzydGkkN@polaris>
On Thu, 26 Sep 2019, Eric Botcazou wrote:
> > For C, I think such UCNs violate the Semantics but not the Constraints on
> > UCNs, so no diagnostic is actually required in C, although it is permitted
> > as a pedwarn / error.
> >
> > However, while C++ doesn't have that Semantics / Constraints division,
> > it's also the case that before C++2a, C++ only has a dated normative
> > reference to ISO/IEC 10646-1:1993 (C++2a adds an undated reference and
> > says the dated one is only for deprecated features, as well as explicitly
> > making such UCNs outside the ISO 10646 code point range ill-formed). So I
> > think that for C++, this is only correct as an error / pedwarn in the
> > C++2a case.
>
> OK, thanks for the exegesis. ;-) Revision version attached.
Checking "CPP_OPTION (pfile, lang) == CLK_CXX2A" is problematic because
future versions later than C++2a should be handled the same as C++2a.
The only place I see doing something similar (outside of init.c, most
version conditionals are handled via language flags set there) does
"CPP_OPTION (pfile, lang) > CLK_CXX11" (for "In C++14 and up these
suffixes are in the standard library, so treat them as user-defined
literals.", two places doing the same comparison). So I think that
"CPP_OPTION (pfile, lang) > CLK_CXX17" is the right thing to replace the
comparisons against CLK_CXX2A and CLK_GNUCXX2A.
The patch is OK with that change.
--
Joseph S. Myers
joseph@codesourcery.com