c++: duplicate block-scope extern [PR 97877]
Nathan Sidwell
nathan@acm.org
Tue Nov 17 21:22:40 GMT 2020
We ICED with a duplicated block-scope extern, as duplicate_decls was
dropping the decl_lang_specific of olddecl. Simplys adding
appropriate retrofitting and copying turned out to be insufficient
because you can get a block-scope using decl also matching the extern.
The latter seems a little suspicious and I have asked CWG for advice.
While there robustified the assert about releasing olddecls'
lang-specific -- if it had one, the new decl better have one.
PR c++/97877
gcc/cp/
* decl.c (duplicate_decls): Deal with duplicated DECL_LOCAL_DECL_P
decls. Extend decl_lang_specific checking assert.
gcc/testsuite/
* g++.dg/lookup/pr97877.C: New.
pushing to trunk
--
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr97877.diff
Type: text/x-patch
Size: 1319 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201117/c76c50f1/attachment.bin>
More information about the Gcc-patches
mailing list