]> gcc.gnu.org Git - gcc.git/commit
c++: don't ICE on NAMESPACE_DECL inside FUNCTION_DECL
authorMatthias Kretz <m.kretz@gsi.de>
Wed, 15 Dec 2021 08:45:06 +0000 (09:45 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 21 Apr 2022 09:09:53 +0000 (11:09 +0200)
commit1eee4e08a64f6e931b0c5dd1bb854a2b7ad3d58f
treeaf45adf7c8b4a4866b007dbe4fba067c60d1db38
parent2509b7bdabbc9ec4edaf6dc49c051c6c5f72a355
c++: don't ICE on NAMESPACE_DECL inside FUNCTION_DECL

Code like
  void swap() {
    namespace __variant = __detail::__variant;
    ...
  }
create a NAMESPACE_DECL where the CP_DECL_CONTEXT is a FUNCTION_DECL.
DECL_TEMPLATE_INFO fails on NAMESPACE_DECL and therefore must be handled
first in the assertion.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
gcc/cp/ChangeLog:

* module.cc (trees_out::get_merge_kind): NAMESPACE_DECLs also
cannot have a DECL_TEMPLATE_INFO.

(cherry picked from commit 6bcb6ed5a44b6f271891246ef7ae568bfdc14e9c)
gcc/cp/module.cc
This page took 0.057117 seconds and 5 git commands to generate.