<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Lvalue reference types appear in the signature of __builtin_va_start when compiled as C and targeting Windows"
href="https://bugs.llvm.org/show_bug.cgi?id=37122">37122</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Lvalue reference types appear in the signature of __builtin_va_start when compiled as C and targeting Windows
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>thonerma@synopsys.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>It seems that the signature of __builtin_va_start contains a C++ lvalue
reference type when targeting Windows, even when compiling as C:
$ cat t.c
void f(int n, ...) {
__builtin_va_list v;
__builtin_va_start(v, n);
}
$ clang --version
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
...
$ clang -c -Xclang -ast-dump -target x86_64-pc-windows-gnu t.c
...
`-FunctionDecl 0x4c89578 <col:3> col:3 implicit used __builtin_va_start 'void
(__builtin_va_list &, ...)' extern
|-ParmVarDecl 0x4c89618 <<invalid sloc>> <invalid sloc> '__builtin_va_list &'
`-NoThrowAttr 0x4c89680 <col:3> Implicit
Note the presence of '__builtin_va_list &' as a parameter type.
The lvalue reference is a surprise for AST consumers that do not expect to
encounter C++ reference types in code compiled as C.</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>