[RFC] Supporting __typeof_unqual__ in the C++ front end
Richard
richard.qin.x@gmail.com
Thu Nov 26 10:26:08 GMT 2026
Hello,
GCC 14 added support for C23 typeof_unqual and __typeof_unqual__ in the
C front end, while g++ currently only accepts __typeof__ and rejects
__typeof_unqual__.
In contrast, Clang exposes __typeof_unqual__ across both C and C++ modes.
Because shared C/C++ headers (such as kernel, system,
and low-level utility macros) increasingly use __typeof_unqual__ to strip
top-level cvr-qualifiers when declaring temporary variables, C++ code
including those headers compiles cleanly under Clang but fails under g++.
Would there be interest in supporting __typeof_unqual__ as a GNU extension
in the C++ front end as well, keeping unprefixed typeof_unqual restricted
to C23 so C++ identifiers are unaffected? If there are known semantic or
mangling caveats on the C++ side, or if anyone has already looked into this,
I would appreciate any pointers.
Best regards,
Richard Qin
More information about the Gcc
mailing list