public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "zweije at xs4all dot nl" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/41779] Spurious integral promotion Date: Thu, 31 Dec 2009 11:02:00 -0000 [thread overview] Message-ID: <20091231110147.14705.qmail@sourceware.org> (raw) In-Reply-To: <bug-41779-15299@http.gcc.gnu.org/bugzilla/> ------- Comment #2 from zweije at xs4all dot nl 2009-12-31 11:01 ------- I beg to differ. I cannot find where the standard says that unsigned short *always* promotes to int in rvalue contexts. My reading in more detail is: 1. The value of y is an lvalue of type unsigned short (5.1/7). 2. 13.3.1.2/7 mentions (effectively) promoting the operands (because built-in candidates (13.6/12) have promoted arguments), but it applies only when the built-in multiplication has been selected by overload resolution. This is not the case, because there are no class or enum arguments. 3. Therefore, clause 5 applies directly (13.3.1.2/1). 4. Clause 5 in itself does not require promoted operands (5.6/2), and does not distinguish lvalues from rvalues. Therefore the value of y is promoted directly to an lvalue of type float, through the usual arithmetic conversion (5/9). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41779
next prev parent reply other threads:[~2009-12-31 11:02 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-10-21 9:16 [Bug c++/41779] New: " zweije at xs4all dot nl 2009-12-29 18:02 ` [Bug c++/41779] " foo at mailinator dot com 2009-12-31 11:02 ` zweije at xs4all dot nl [this message] 2010-02-14 20:28 ` [Bug c++/41779] Wconversion cannot see throught real*integer promotions manu at gcc dot gnu dot org 2010-02-19 21:12 ` manu at gcc dot gnu dot org 2010-02-19 21:14 ` manu at gcc dot gnu dot org 2010-02-23 13:59 ` hjl dot tools at gmail 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=20091231110147.14705.qmail@sourceware.org \ --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: linkBe 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).