https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69113
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like this fixes it...
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 9a07e1e..a7212ca0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1820,7 +1820,8 @@ comdat_linkage (tree decl)
}
}
- DECL_COMDAT (decl) = 1;
+ if (TREE_PUBLIC (decl))
+ DECL_COMDAT (decl) = 1;
}
/* For win32 we also want to put explicit instantiations in
