<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 - -Wmissing-variable-declarations warnings trigger on inline variables and variable temples"
href="https://bugs.llvm.org/show_bug.cgi?id=35862">35862</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wmissing-variable-declarations warnings trigger on inline variables and variable temples
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>metaprogrammingtheworld@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When using -Wmissing-variable-declarations, the warning incorrectly triggers
for both inline variable definitions and for variable templates. Example
warning trigger:
//////////
template< class >
int variable_template = 5;
inline constexpr int inline_variable = 5;
//////////
When compiling the above code, the following warnings are produced:
//////////
2 : <source>:2:5: warning: no previous extern declaration for non-static
variable 'variable_template' [-Wmissing-variable-declarations]
int variable_template = 5;
^
4 : <source>:4:22: warning: no previous extern declaration for non-static
variable 'inline_variable' [-Wmissing-variable-declarations]
inline constexpr int inline_variable = 5;
//////////
I suggest that such definitions should be ignored in the context of that
warning.</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>