@@ -317,8 +317,11 @@ ipa_comdats (void)
&& !symbol->alias
&& symbol->real_symbol_p ())
{
- tree group = *map.get (symbol);
+ tree *val = map.get (symbol);
+ if (!val)
+ continue;
+ group = *val;
if (group == error_mark_node)
continue;
if (dump_file)
new file mode 100644
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -std=c++11" } */
+struct A
+{
+ typedef void Func ();
+ A () = default;
+ void *_base;
+};
+class B
+{
+ struct
+ {
+ void m_fn1 (A::Func);
+ } static b;
+};
+template <typename> class C : B
+{
+public:
+ C ();
+ static void
+ m_fn2 ()
+ {
+ }
+};
+
+A c;
+__attribute__ ((init_priority (0xfffe))) C<int> a;
+template <typename T> C<T>::C () { b.m_fn1 (m_fn2); }