<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Clang fails to parse function calls when one argument is a structure containing an _Atomic type"
href="http://llvm.org/bugs/show_bug.cgi?id=16931">16931</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang fails to parse function calls when one argument is a structure containing an _Atomic type
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>csdavec@swan.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Simple test case:
typedef struct { _Atomic(_Bool) flag; } flag;
_Bool f(flag*);
int
main(int argc, char *argv[])
{
flag flag = { 0 };
f(&flag);
return 0;
}
The call to f does not appear in the AST:
$ ~/llvm/Debug/bin/clang test.c -fsyntax-only -Xclang -ast-dump
TranslationUnitDecl 0x806cb02d0 <<invalid sloc>>
|-TypedefDecl 0x806cb0810 <<invalid sloc>> __int128_t '__int128'
|-TypedefDecl 0x806cb0870 <<invalid sloc>> __uint128_t 'unsigned __int128'
|-TypedefDecl 0x806cb0bc0 <<invalid sloc>> __builtin_va_list '__va_list_tag
[1]'
|-RecordDecl 0x806cb0c10 <ed.c:1:9, col:39> struct
| `-FieldDecl 0x806cb0d00 <col:18, col:33> flag '_Atomic(_Bool)'
|-TypedefDecl 0x806cb0da0 <col:1, col:41> flag 'struct flag':'flag'
|-FunctionDecl 0x806cf5010 <line:2:1, col:14> f '_Bool (flag *)'
| `-ParmVarDecl 0x806cb0ea0 <col:9, col:14> 'flag *'
`-FunctionDecl 0x806cf5320 <line:4:1, line:10:1> main 'int (int, char **)'
|-ParmVarDecl 0x806cf50d0 <line:5:6, col:10> argc 'int'
|-ParmVarDecl 0x806cf5210 <col:16, col:27> argv 'char **':'char **'
`-CompoundStmt 0x806cf5598 <line:6:1, line:10:1>
|-DeclStmt 0x806cf5518 <line:7:4, col:21>
| `-VarDecl 0x806cf53e0 <col:4, col:9> flag 'flag':'flag'
`-ReturnStmt 0x806cf5578 <line:9:4, col:11>
`-IntegerLiteral 0x806cf5558 <col:11> 'int' 0
This currently breaks stdatomic.h on FreeBSD. No errors are emitted, and no
asserts are hit...</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>