public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "schaub.johannes at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
Date: Thu, 12 May 2011 05:57:00 -0000	[thread overview]
Message-ID: <bug-47453-4-SoPeTbYsy2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47453-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-05-12 05:23:15 UTC ---
I think we have the FDIS clear about these cases now. To update:

    // invalid
    struct A { int a[2]; A():a({1, 2}) { } };

    // invalid
    int a({0});

    // invalid
    int const &b({0});

    struct A { explicit A(int, int); A(int, long); };

    // invalid
    A c({1, 2});

    // valid (by copy constructor).
    A d({1, 2L});

    // valid
    A e{1, 2};

    struct B { 
      template<typename ...T>
      B(initializer_list<int>, T ...); 
    };

    // invalid (the first phase only considers init-list ctors)
    // (for the second phase, no constructor is viable)
    B f{1, 2, 3};

    // valid (T deduced to <>).
    B g({1, 2, 3});


  parent reply	other threads:[~2011-05-12  5:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25  4:12 [Bug c++/47453] New: " schaub.johannes at googlemail dot com
2011-01-25  4:16 ` [Bug c++/47453] " schaub.johannes at googlemail dot com
2011-01-25  5:21 ` schaub.johannes at googlemail dot com
2011-05-12  5:57 ` schaub.johannes at googlemail dot com [this message]
2011-07-29  6:09 ` d.v.a at ngs dot ru
2011-07-29 12:24 ` schaub.johannes at googlemail dot com
2011-08-02  3:26 ` d.v.a at ngs dot ru
2011-08-03 18:53 ` [Bug c++/47453] [DR 1214] " jason at gcc dot gnu.org
2011-08-03 19:17 ` schaub.johannes at googlemail dot com
2011-08-05 19:16 ` jason at gcc dot gnu.org
2011-08-05 19:38 ` 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-47453-4-SoPeTbYsy2@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).