This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
- From: "d.v.a at ngs dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Jul 2011 06:09:02 +0000
- Subject: [Bug c++/47453] Various non-conforming behaviors with braced-init-list initialization
- Auto-submitted: auto-generated
- References: <bug-47453-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47453
__vic <d.v.a at ngs dot ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |d.v.a at ngs dot ru
--- Comment #4 from __vic <d.v.a at ngs dot ru> 2011-07-29 06:08:29 UTC ---
struct A { int a[2]; A():a({1, 2}) { } };
Should be valid. Example:
class cond_variable
{
::pthread_cond_t cond;
public:
constexpr cond_variable() : cond(PTHREAD_COND_INITIALIZER) {}
};
What is pthread_cond_t? Struct? Array? Scalar? How I can be sure this code is
accepted in any case? Uniform initialization initially address this issue.
Out of constructor one can use "=":
::pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
In constructor init-list "=" is prohibited therefore "()" must play a same
role.