<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:david.majnemer@gmail.com" title="David Majnemer <david.majnemer@gmail.com>"> <span class="fn">David Majnemer</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Can't assign PTHREAD_MUTEX_INITIALIZER to a class member"
href="http://llvm.org/bugs/show_bug.cgi?id=17320">bug 17320</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>david.majnemer@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Can't assign PTHREAD_MUTEX_INITIALIZER to a class member"
href="http://llvm.org/bugs/show_bug.cgi?id=17320#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Can't assign PTHREAD_MUTEX_INITIALIZER to a class member"
href="http://llvm.org/bugs/show_bug.cgi?id=17320">bug 17320</a>
from <span class="vcard"><a class="email" href="mailto:david.majnemer@gmail.com" title="David Majnemer <david.majnemer@gmail.com>"> <span class="fn">David Majnemer</span></a>
</span></b>
<pre>PTHREAD_MUTEX_INITIALIZER is a macro that expands to { { 0, 0, 0, 0, 0, 0, { 0,
0 } } }
Your test case is actually taking advantage of a C++11 feature, extended
initializer lists. See:
<a href="http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists">http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists</a>
gcc (as of 4.8), as an extension, allows it in c++98 mode with a warning:
"warning: extended initializer lists only available with -std=c++11 or
-std=gnu++11 [enabled by default]"
icc acts in a similar manner.
Compiling your test case with -std=c++11 yields a perfectly cromulent AST:
|-CXXCtorInitializer Field 0x6a8c330 'm' 'pthread_mutex_t':'pthread_mutex_t'
| |-CXXConstructExpr 0x6a8e038 <col:16, col:43>
'pthread_mutex_t':'pthread_mutex_t' 'void (pthread_mutex_t &&) noexcept'
elidable
| | `-MaterializeTemporaryExpr 0x6a8df40 </usr/include/pthread.h:90:3,
col:36> 'pthread_mutex_t' xvalue
| | `-InitListExpr 0x6a8ddb8 <col:3, col:36> 'pthread_mutex_t'
| | `-InitListExpr 0x6a8de00 <col:5, col:34> 'struct
__pthread_mutex_s':'struct pthread_mutex_t::__pthread_mutex_s'
| | |-IntegerLiteral 0x6a8d880 <col:7> 'int' 0
| | |-ImplicitCastExpr 0x6a8de78 <col:10> 'unsigned int' <IntegralCast>
| | | `-IntegerLiteral 0x6a8d8a0 <col:10> 'int' 0
| | |-IntegerLiteral 0x6a8d8c0 <col:13> 'int' 0
| | |-ImplicitCastExpr 0x6a8de90 <col:16> 'unsigned int' <IntegralCast>
| | | `-IntegerLiteral 0x6a8d8e0 <col:16> 'int' 0
| | |-IntegerLiteral 0x6a8d900 <col:19> 'int' 0
| | |-IntegerLiteral 0x6a8d920 <col:22> 'int' 0
| | `-InitListExpr 0x6a8dea8 <col:25, col:32>
'__pthread_list_t':'struct __pthread_internal_list'
| | |-ImplicitCastExpr 0x6a8def8 <col:27> 'struct
__pthread_internal_list *' <NullToPointer>
| | | `-IntegerLiteral 0x6a8d940 <col:27> 'int' 0
| | `-ImplicitCastExpr 0x6a8df10 <col:30> 'struct
__pthread_internal_list *' <NullToPointer>
| | `-IntegerLiteral 0x6a8d960 <col:30> 'int' 0
`-CompoundStmt 0x6a8e0a0 </var/tmp/PR17320.cpp:7:45, col:46>
Marking this as invalid.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>