https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120585
Bug ID: 120585
Summary: "error: ‘signed’ specified with ‘typeof’" in code with
no typeof
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: olly at survex dot com
Target Milestone: ---
$ echo 'typedef signed wchar_t x;' | g++-15 -c -xc++ -
<stdin>:1:9: error: ‘signed’ specified with ‘typeof’
However there's no `typeof` in the code. Perhaps there's a `typeof` involved
somehow behind the scenes, but from a user viewpoint I'd expect the error to be
something like:
<stdin>:1:9: error: ‘signed’ specified with ‘wchar_t’
Reproducible with with the debian g++15 package version 15-20250319-1:
g++-15 (Debian 15-20250319-1) 15.0.1 20250319 (experimental) [master
r15-8284-gd0110185eb7]
Also reproducible on godbolt.org:
g++
(Compiler-Explorer-Build-gcc-e1719c3c20bee7caac0f6cc1a6e2deda9820e030-binutils-2.42)
16.0.0 20250607 (experimental)
AIUI this code isn't valid ISO C++ but older GCC (e.g. 8.4.0) and clang (e.g.
8.0.1) both accepted it so instances likely exist in the wild.