diff options
author | Jason Merrill <jason@redhat.com> | 2022-04-14 17:49:47 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-04-14 21:55:08 -0400 |
commit | e580f81d22d61153564959f08d9a6d3bcc7fd386 (patch) | |
tree | 5bf77da86a01b4989520ba1cc78f91bd07dbdb73 /gcc/cp/decl.cc | |
parent | 6364a39907bd68624a30df0c8e380c40d2a646c4 (diff) | |
download | gcc-e580f81d22d61153564959f08d9a6d3bcc7fd386.zip gcc-e580f81d22d61153564959f08d9a6d3bcc7fd386.tar.gz gcc-e580f81d22d61153564959f08d9a6d3bcc7fd386.tar.bz2 |
c++: unsigned int32_t enum promotion [PR102804]
There's been an extension for a long time to allow applying 'unsigned' to an
int typedef, but that was confusing the integer promotion code. Fixed by
forgetting about the typedef in that case.
I'm going to make this an unconditional pedwarn in stage 1.
PR c++/102804
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
gcc/testsuite/ChangeLog:
* g++.dg/ext/unsigned-typedef1.C: New test.
Diffstat (limited to 'gcc/cp/decl.cc')
-rw-r--r-- | gcc/cp/decl.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index d51fd75..2852093 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -12243,6 +12243,8 @@ grokdeclarator (const cp_declarator *declarator, pedwarn (loc, OPT_Wpedantic, "%qs specified with %qT", key, type); ok = !flag_pedantic_errors; + type = DECL_ORIGINAL_TYPE (typedef_decl); + typedef_decl = NULL_TREE; } else if (declspecs->decltype_p) error_at (loc, "%qs specified with %<decltype%>", key); |