public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: apbianco@redhat.com To: gcc-gnats@gcc.gnu.org Cc: mjr@anarcast.net Subject: java/4022: ?: precedence is wrong. Date: Tue, 14 Aug 2001 12:46:00 -0000 [thread overview] Message-ID: <20010814193918.19096.qmail@sourceware.cygnus.com> (raw) >Number: 4022 >Category: java >Synopsis: ?: precedence is wrong. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Aug 14 12:46:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Alex Petit-Bianco >Release: 3.0 and trunk. >Organization: >Environment: Most likely all. x86/linux definitively. >Description: Consider this test case: public class Test { public static void main(String[] args) { String s = null; System.out.println("foo" + s != null ? s : ""); } } $ ./test null When enclosed in parentheses, it behaves normally: System.out.println("foo" + (s != null ? s : "")); $ ./test foo A core dump happens when this is done in a toString method: public class Test { public static void main(String[] args) { System.out.println(new Test()); } public String toString() { String s = null; return "foo" + s != null ? s : ""; } } >How-To-Repeat: Build the examples above. >Fix: Not yet. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="null" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="null"
next reply other threads:[~2001-08-14 12:46 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-08-14 12:46 apbianco [this message] 2001-08-15 19:36 Tom Tromey 2001-08-15 23:56 Daniel Jacobowitz 2001-08-16 10:32 tromey
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=20010814193918.19096.qmail@sourceware.cygnus.com \ --to=apbianco@redhat.com \ --cc=gcc-gnats@gcc.gnu.org \ --cc=mjr@anarcast.net \ /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).