aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2019-02-28 12:29:48 -0500
committerJason Merrill <jason@gcc.gnu.org>2019-02-28 12:29:48 -0500
commit80f52b400e1fc770c96d5e28ac7343aac3733df9 (patch)
tree29c6373f0d1eb663d8269220c8ec7be9aec8213e /gcc/lto
parent6b7e4afbdc6f9584483c79aa7662c64d9a561e5e (diff)
downloadgcc-80f52b400e1fc770c96d5e28ac7343aac3733df9.zip
gcc-80f52b400e1fc770c96d5e28ac7343aac3733df9.tar.gz
gcc-80f52b400e1fc770c96d5e28ac7343aac3733df9.tar.bz2
PR c++/88049 - ICE with undefined destructor and anon namespace.
A type in an anonymous namespace can never be merged with one from another translation unit, so a member of such a type is always its own prevailing decl. * lto-symtab.c (lto_symtab_prevailing_virtual_decl): Return early for a type in an anonymous namespace. From-SVN: r269283
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-symtab.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 6b183df..f8a1bbe 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/88049 - ICE with undefined destructor and anon namespace.
+ * lto-symtab.c (lto_symtab_prevailing_virtual_decl): Return early
+ for a type in an anonymous namespace.
+
2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
PR other/16615
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 22da4c7..343915c 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -1085,8 +1085,12 @@ lto_symtab_prevailing_virtual_decl (tree decl)
{
if (DECL_ABSTRACT_P (decl))
return decl;
- gcc_checking_assert (!type_in_anonymous_namespace_p (DECL_CONTEXT (decl))
- && DECL_ASSEMBLER_NAME_SET_P (decl));
+
+ if (type_in_anonymous_namespace_p (DECL_CONTEXT (decl)))
+ /* There can't be any other declarations. */
+ return decl;
+
+ gcc_checking_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
symtab_node *n = symtab_node::get_for_asmname
(DECL_ASSEMBLER_NAME (decl));