public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "d.v.a at ngs dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49894] New: Uniform initialization in constructor (C++0x)
Date: Fri, 29 Jul 2011 06:17:00 -0000	[thread overview]
Message-ID: <bug-49894-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: Uniform initialization in constructor (C++0x)
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.v.a@ngs.ru


#include<pthread.h>

class cond_variable
{
    ::pthread_cond_t cond;
public:
    constexpr cond_variable() : cond(PTHREAD_COND_INITIALIZER) {}
};
int main() {}

test.cpp: In constructor 'constexpr cond_variable::cond_variable()':
test.cpp:7:84: error: could not convert '{{0, 0}, 0, "", 0}' from
'<brace-enclosed initializer list>' to 'pthread_cond_t'

Variant
constexpr cond_variable() : cond((::pthread_cond_t)PTHREAD_COND_INITIALIZER) {}
is Ok.


             reply	other threads:[~2011-07-29  6:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  6:17 d.v.a at ngs dot ru [this message]
2011-07-29  6:29 ` [Bug c++/49894] " d.v.a at ngs dot ru
2011-07-29 10:08 ` rguenth at gcc dot gnu.org
2011-07-29 10:13 ` d.v.a at ngs dot ru
2011-07-29 10:17 ` d.v.a at ngs dot ru
2011-10-14 19:29 ` [Bug libstdc++/49894] [C++0x] Uniform initialization in constructor jason at gcc dot gnu.org
2011-10-14 23:05 ` paolo.carlini at oracle dot com
2011-10-15 12:26 ` redi at gcc dot gnu.org
2011-10-15 12:54 ` redi at gcc dot gnu.org
2011-10-15 19:54 ` paolo.carlini at oracle dot com
2011-10-24 23:27 ` redi at gcc dot gnu.org
2011-10-24 23:30 ` redi at gcc dot gnu.org
2011-11-05 13:34 ` redi at gcc dot gnu.org
2012-06-15  8:51 ` d.v.a at ngs dot ru

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-49894-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).