https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119236
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
With the C front-end we do error out with -pedantic-errors:
```
<source>: In function 'main':
<source>:3:12: error: ISO C does not permit '_Alignof' applied to a function
type [-Wpedantic]
3 | alignof ( void ( void ) ) ;
| ^~~~
```
Likewise with the C++ front-end:
```
<source>: In function 'int main()':
<source>:3:2: error: ISO C++ does not permit 'alignof' applied to a function
type [-Wpedantic]
3 | alignof ( void ( void ) ) ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
```
So you need -pedantic to get a diagnostic.