<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 - clang-format can introduce */ outside of comment, rejected by some compilers"
href="https://bugs.llvm.org/show_bug.cgi?id=52527">52527</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format can introduce */ outside of comment, rejected by some compilers
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>12.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>peterd@fb.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When I use clang-format-diff.py on this:
void Foo(void (* /*fn*/)()) {}
I get this:
void Foo(void (*/*fn*/)()) {}
Which is rejected by MSVC at least under some configurations and versions.
Context:
<a href="https://app.circleci.com/pipelines/github/facebook/rocksdb/10051/workflows/cef8bc6a-faa4-45bd-9821-7fdc483985fb/jobs/241183">https://app.circleci.com/pipelines/github/facebook/rocksdb/10051/workflows/cef8bc6a-faa4-45bd-9821-7fdc483985fb/jobs/241183</a>
c:\users\circleci\project\db\db_block_cache_test.cc(395): warning C4138: '*/'
found outside of comment
c:\users\circleci\project\db\db_block_cache_test.cc(395): error C2220: warning
treated as error - no 'object' file generated
My work-around:
<a href="https://github.com/pdillinger/rocksdb/commit/c9885d2614d664f331cd998038e8e8f94a847d92">https://github.com/pdillinger/rocksdb/commit/c9885d2614d664f331cd998038e8e8f94a847d92</a></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>