diff options
author | Jason Merrill <jason@redhat.com> | 2023-04-18 17:12:17 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-04-19 11:23:11 -0400 |
commit | ed32ec26697cc77492d094b31a0d2eebc0535644 (patch) | |
tree | c7b143ad5b3946bfd2dc7ccfaee8e506190e0c09 /gcc/cp | |
parent | 9fdea28d6ace8c8e5ac64a55685d310ba8dfa3cf (diff) | |
download | gcc-ed32ec26697cc77492d094b31a0d2eebc0535644.zip gcc-ed32ec26697cc77492d094b31a0d2eebc0535644.tar.gz gcc-ed32ec26697cc77492d094b31a0d2eebc0535644.tar.bz2 |
c++: fix 'unsigned __int128_t' semantics [PR108099]
My earlier patch for 108099 made us accept this non-standard pattern but
messed up the semantics, so that e.g. unsigned __int128_t was not a 128-bit
type.
PR c++/108099
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator): Keep typedef_decl for __int128_t.
gcc/testsuite/ChangeLog:
* g++.dg/ext/int128-8.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/decl.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 772c059..ab5cb69 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -12482,12 +12482,14 @@ grokdeclarator (const cp_declarator *declarator, key, typedef_decl); ok = !flag_pedantic_errors; if (is_typedef_decl (typedef_decl)) - type = DECL_ORIGINAL_TYPE (typedef_decl); + { + type = DECL_ORIGINAL_TYPE (typedef_decl); + typedef_decl = NULL_TREE; + } else /* PR108099: __int128_t comes from c_common_nodes_and_builtins, and is not built as a typedef. */ type = TREE_TYPE (typedef_decl); - typedef_decl = NULL_TREE; } else if (declspecs->decltype_p) error_at (loc, "%qs specified with %<decltype%>", key); |