<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/134955>134955</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Incorrect diagnostic wording for out-of-line enum declarations
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++,
            clang:diagnostics,
            confirmed
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Endilll
      </td>
    </tr>
</table>

<pre>
    Consider the following (https://godbolt.org/z/cj1hMqbof):
```cpp
struct A {
  enum E : int;
};

namespace N {
enum A::E : int { e1 };
}
```
Clang rejects this with `error: cannot define or redeclare 'E' here because namespace 'N' does not enclose namespace 'A'`, but `A` is a struct and not a namespace.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcUtuO2yAQ_ZrxyygRBjs4D37wJmupD91_4DKxWRFIAe-q_fqKbNRUKyHZMHPOmctRObslEI3Qv0B_btRW1pjG12Cd977R0f4eTzFkZylhWQkv0fv46cKCwIe1lFsGMQGfgc9LtDr6so9pAT7_AT6b93b9-UvHC_BjTWMTHNjXMbcbsCmXtJmCE4J8ATYhUtiu-IogJnShgKivIM-PHzYFdaV8U4bw7YG5I6bKLqZ_wBpDavEJlef_1YFNJ6_CgoneyZSMZXUZP11ZEQ6MUoqpMhkVQixo6eICYUyYyJLxKhECl6_AJa6UCDUZtWXCZ3XA5VsN20gZKwcF4-P3lAm4rNXwE-qtVOlaIrqMCh-jUcHe8eqJ3Dd2FPYojqqhsZVd1_bDYZDNOlot-p4dhl502ioauKC209r0XA6ylbJxI2e8Zx07MiZaLvdkSQ5S2ONBmKEfJHSMrsr5vfcf17rJxuW80diK7tj3jVeafL6bhXMD_OV-OPBTvdeJgpisU0uIuTiTn7EYLi5dydaX_tyksQrs9LZk6Jh3ueSnZHHF0_gjmJgSmYJPQvyMyVbzXWLCuJVdvOx83c3dBV-7UcXFkJst-fGbP11ZN7038Qp8rmKPz-6WYnUB8PnebAY-P_r9GPnfAAAA__9jg_c9">