aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-16 09:44:38 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-16 09:44:38 -0800
commit8379916b167de9bebc32401526b6f53d06dca349 (patch)
tree71591e23374848694ff7974862da5d6efa3ce422 /gcc
parent269e82d49e2d5bf26ab847fa0f29fba0ad6f326a (diff)
downloadgcc-8379916b167de9bebc32401526b6f53d06dca349.zip
gcc-8379916b167de9bebc32401526b6f53d06dca349.tar.gz
gcc-8379916b167de9bebc32401526b6f53d06dca349.tar.bz2
c++: Fix offsetof use [PR 98232]
offsetof is underspecified. GCC happened to accept an unneeded explicit scoping, clang does not. gcc/cp/ * module.cc (dumper::push): Clangify offsetof use.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/module.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index d280696..e9ea186 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -4153,7 +4153,7 @@ dumper::push (module_state *m)
/* Create or extend the dump implementor. */
unsigned current = dumps ? dumps->stack.length () : 0;
unsigned count = current ? current * 2 : EXPERIMENT (1, 20);
- size_t alloc = (offsetof (impl, impl::stack)
+ size_t alloc = (offsetof (impl, stack)
+ impl::stack_t::embedded_size (count));
dumps = XRESIZEVAR (impl, dumps, alloc);
dumps->stack.embedded_init (count, current);