-
- Downloads
c: Add __typeof_unqual__ and __typeof_unqual support
As I mentioned in my stdckdint.h mail, I think having __ prefixed keywords for the typeof_unqual keyword which can be used in earlier language modes can be useful, not all code can be switched to C23 right away. The following patch implements that. It keeps the non-C23 behavior for it for the _Noreturn functions to stay compatible with how __typeof__ behaves. I think we don't need it for C++, in C++ we have standard traits to remove qualifiers etc. 2023-08-11 Jakub Jelinek <jakub@redhat.com> gcc/ * doc/extend.texi (Typeof): Document typeof_unqual and __typeof_unqual__. gcc/c-family/ * c-common.cc (c_common_reswords): Add __typeof_unqual and __typeof_unqual__ spellings of typeof_unqual. gcc/c/ * c-parser.cc (c_parser_typeof_specifier): Handle __typeof_unqual and __typeof_unqual__ as !is_std. gcc/testsuite/ * gcc.dg/c11-typeof-2.c: New test. * gcc.dg/c11-typeof-3.c: New test. * gcc.dg/gnu11-typeof-3.c: New test. * gcc.dg/gnu11-typeof-4.c: New test.
Showing
- gcc/c-family/c-common.cc 2 additions, 0 deletionsgcc/c-family/c-common.cc
- gcc/c/c-parser.cc 2 additions, 1 deletiongcc/c/c-parser.cc
- gcc/doc/extend.texi 7 additions, 0 deletionsgcc/doc/extend.texi
- gcc/testsuite/gcc.dg/c11-typeof-2.c 177 additions, 0 deletionsgcc/testsuite/gcc.dg/c11-typeof-2.c
- gcc/testsuite/gcc.dg/c11-typeof-3.c 58 additions, 0 deletionsgcc/testsuite/gcc.dg/c11-typeof-3.c
- gcc/testsuite/gcc.dg/gnu11-typeof-3.c 177 additions, 0 deletionsgcc/testsuite/gcc.dg/gnu11-typeof-3.c
- gcc/testsuite/gcc.dg/gnu11-typeof-4.c 58 additions, 0 deletionsgcc/testsuite/gcc.dg/gnu11-typeof-4.c
Loading
Please register or sign in to comment