https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107178

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang diagnostic is way worse in my mind. It does not even point to the : .
GCC is assuming if you don't have a constructor you have a type and that type
here would be T (S::)()

Take:
```
struct S {
    int (*foo)() : 
    int t;
};

```
Trying to define a pointer to function field foo but used : instead of ;.
GCC diagonstic seems reasonable.
because GCC assumes you started to define a bitfield which is reasonable
assumention really.
clang diagnostic here is never even close to helpful.

At least GCC points out the colon and even suggest you started a bitfield which
is what a colon normally does here ....

Reply via email to