aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-17 09:53:01 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-17 09:56:59 -0800
commit2d7a40fa60fb8b9870cfd053a37fc67404353ee2 (patch)
tree69d98660d32bbe90138116b441c1b8d90da806c2 /gcc
parentd1ad55c4e08b827b4d38f763e0427096305d460d (diff)
downloadgcc-2d7a40fa60fb8b9870cfd053a37fc67404353ee2.zip
gcc-2d7a40fa60fb8b9870cfd053a37fc67404353ee2.tar.gz
gcc-2d7a40fa60fb8b9870cfd053a37fc67404353ee2.tar.bz2
c++: Fix clang problem [PR 98340]
Clang didn't like sizeot (uintset::value) in a templated context. Not sure where the problem lies -- ambiguous std, gcc erroneous accept or clang erroneous reject. Anyway, this avoids that construct. PR c++/98340 gcc/cp/ * module.cc (uintset<T>::hash::add): Use uintset (0u).MEMBER, rather than uintset::MEMBER.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/module.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 21d04cc..b2b8190 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -2718,7 +2718,7 @@ uintset<T>::hash::add (typename uintset<T>::hash::key_t key, T value)
{
unsigned n = set->num * 2;
size_t new_size = (offsetof (uintset, values)
- + sizeof (uintset::values) * n);
+ + sizeof (uintset (0u).values) * n);
uintset *new_set = new (::operator new (new_size)) uintset (set);
delete set;
set = new_set;
@@ -2743,7 +2743,7 @@ uintset<T>::hash::create (typename uintset<T>::hash::key_t key, unsigned num,
p2alloc++;
size_t new_size = (offsetof (uintset, values)
- + (sizeof (uintset::values) << p2alloc));
+ + (sizeof (uintset (0u).values) << p2alloc));
uintset *set = new (::operator new (new_size)) uintset (key);
set->allocp2 = p2alloc;
set->num = num;