<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 - -Wshadow-field triggered in static member functions"
href="https://bugs.llvm.org/show_bug.cgi?id=43329">43329</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wshadow-field triggered in static member functions
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>normal
</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>dan.raviv@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>-Wshadow-field is triggered in static member functions for inherited,
non-static data members. Is this actually helpful? Since static member
functions don't have access to a this pointer anyway (and no implicit access to
its data members when "this->" is omitted), there can be no ambiguity.
See <a href="https://wandbox.org/permlink/Fsdh6hvPhoCurwo5">https://wandbox.org/permlink/Fsdh6hvPhoCurwo5</a>
class C {
public:
int x;
};
class D : public C {
public:
static int f (int x) { return x; }
};
int main() {}
Results in warning: parameter 'x' shadows member inherited from type 'C'
[-Wshadow-field]</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>