public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bisqwit at iki dot fi" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/50276] [C++0x] Wrong "used uninitialized in this function" warning
Date: Tue, 03 Jan 2012 23:16:00 -0000	[thread overview]
Message-ID: <bug-50276-4-NWbX5b81m6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50276-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Joel Yliluoma <bisqwit at iki dot fi> 2012-01-03 23:16:07 UTC ---
It also accepts this code without complaints, which is another error:

template<int i>
bool test()
{
  if (bool value = this_identifier_has_not_been_declared( []() {} ))
    return value;

  __builtin_abort();

  return false;
}

int main()
{
  test<0>();
}

The wrong-code problem occurs also with this code:

template<int i>
bool test()
{
  if (bool value = []() { return 1; } )
    return value;

  __builtin_abort();

  return false;
}

int main()
{
  test<0>();
}


  parent reply	other threads:[~2012-01-03 23:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 12:45 [Bug c++/50276] New: Wrong "used uninitialized in this function" warning [C++0x] bisqwit at iki dot fi
2011-09-02 13:05 ` [Bug c++/50276] " bisqwit at iki dot fi
2011-09-14 21:11 ` [Bug c++/50276] [C++0x] Wrong "used uninitialized in this function" warning paolo.carlini at oracle dot com
2012-01-03 22:46 ` paolo.carlini at oracle dot com
2012-01-03 23:02 ` paolo.carlini at oracle dot com
2012-01-03 23:16 ` bisqwit at iki dot fi [this message]
2013-03-05 17:42 ` jason at gcc dot gnu.org
2013-03-05 18:59 ` jason 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-50276-4-NWbX5b81m6@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).