public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wjl at icecavern dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59873] The value of char32_t U'\u0000' and char16_t u'\u000' is 1, instead of 0.
Date: Sat, 18 Jan 2014 23:33:00 -0000	[thread overview]
Message-ID: <bug-59873-4-Tsm8HPKkaE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59873-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59873

--- Comment #5 from Wesley J. Landaker <wjl at icecavern dot net> ---
(In reply to Marc Glisse from comment #4)
> Seems to be on purpose, see the comment before _cpp_valid_ucn in
> libcpp/charset.c, and the last instruction in that function.
> 
> [lex.charset] is a bit hard to read for me.

If I'm reading that comment right, it sounds like the C++11 standard says that
something like: U'\u0000' should yield a compiler error, like it currently does
with U'\ud800' (a surrogate), instead of silently working in an unexpected
manner.

Assuming this line of reasoning is correct, my second test program (the
char32_literal_test.c++) shows that gcc has a bug in that it does not propertly
*reject* any invalid \uXXXX or \UXXXXXXXX except for surrogates. (As an aside,
if this really does violate the C++11 standard, clang has this same bug -- it
just behaved in the way I naively expected it to.)


  parent reply	other threads:[~2014-01-18 23:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 22:02 [Bug c++/59873] New: " wjl at icecavern dot net
2014-01-18 22:05 ` [Bug c++/59873] " wjl at icecavern dot net
2014-01-18 22:10 ` wjl at icecavern dot net
2014-01-18 23:19 ` wjl at icecavern dot net
2014-01-18 23:21 ` glisse at gcc dot gnu.org
2014-01-18 23:33 ` wjl at icecavern dot net [this message]
2014-01-18 23:40 ` schwab@linux-m68k.org
2014-01-18 23:47 ` wjl at icecavern dot net
2014-01-20  0:16 ` wjl at icecavern dot net
2014-01-20  0:19 ` wjl at icecavern dot net
2014-07-20 20:51 ` [Bug c++/59873] The value of char32_t U'\u0000' and char16_t u'\u0000' " richard-gccbugzilla at metafoo dot co.uk
2015-04-30 10:37 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59873-4-Tsm8HPKkaE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).