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: unassig...@gcc.gnu.org
        ReportedBy: d....@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 via email to