public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "TrevorJamesHickey at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67777] New: unsigned wchar_t and signed wchar_t should cause compiler errors but do not.
Date: Wed, 30 Sep 2015 02:33:00 -0000	[thread overview]
Message-ID: <bug-67777-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67777

            Bug ID: 67777
           Summary: unsigned wchar_t and signed wchar_t should cause
                    compiler errors but do not.
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: TrevorJamesHickey at gmail dot com
  Target Milestone: ---

Is the following program valid C++?

void f(unsigned wchar_t){}
int main(){}

It compiles without errors.   

The standard specifies that:  
"signed or unsigned can be combined with char, long, short, or int."

wchar_t is a distinct type, but the standard makes no mention of it being able
to be qualified with signed or unsigned.

"Type wchar_t shall have the same size, signedness, and alignment requirements
(3.11) as one of the other integral types, called its underlying type."  

Why can we add signed/unsigned qualifiers to wchar_t?  
Is this by design?  Can I get a warning about this?


             reply	other threads:[~2015-09-30  2:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30  2:33 TrevorJamesHickey at gmail dot com [this message]
2021-08-04 21:52 ` [Bug c++/67777] " pinskia at gcc dot gnu.org
2021-08-05 11:24 ` redi at gcc dot gnu.org

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-67777-4@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).