<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71405>71405</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Could for have a warning for attribute shadowing in C++?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
abique
</td>
</tr>
</table>
<pre>
Hi,
The following C++ snippet doesn't trigger a single warning when compiled with `-Wall -Wextra -pedantic`:
```C++
struct A
{
int x;
};
struct B : public A
{
int x;
};
```
Do you think it'd be reasonable to offer a warning for detecting it?
Tested with clang 16.0.6.
Thank you very much.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUk1v4yAQ_TX4MorFh-MkBx-aRtb-gJV6Bjy22RLwwtC0_35lN1G7e1vJMsMM897weDpnNwXEju3PbH-pdKE5pk4b97tgZeLw0f1wTD4zfmH86fP_c0YYo_fx5sIEz0yemTxDDm5ZkGCImAOTBwJKbpowgYbswuQRbjqFteU2YwAbr4vzOMDN0Qys5bsX7T3sXvCdkobdgoMO5CxrOVN35jXevjvpZzZTKpbgceZwTwO4QPDO1PlRuHzF3xvPwNQTLMV4Z_8P5THOd9BLhI9YgGYXXsERk4cBDEJCnWPQxiNQhDiOmzAPRcaYYEBCS-vOEVP9XWvM9NDIeh0mEG3N67b--0F0eN1Y3zB9wLXYua6GTg0nddIVdqI9neSxEUJVc4dNI9pWHJVSyjQKj1YfDbbcjprzUY-V6ySXSgjeir0Ue1UftBrRCnHih0ZYM7CG41U7X3v_dq1jmiqXc8HuIBq-r7w26PPmJykD3mArMilXe6Vu7dmZMmXWcO8y5S8UcuSxe47FD5sgs37DfzTSRMmZQgh51sOnAV14eJCpvirJdzPRklfTyJ7JfnI0F1PbeGWyX8nuy25J8RdaYrLfRsxM9tsV_gQAAP__OLTuXA">