2017-04-19 Jakub Jelinek <jakub@redhat.com>
+ PR debug/80461
+ * dwarf2out.c (modified_type_die, gen_type_die_with_usage):
+ Check for t with zero TYPE_QUALS_NO_ADDR_SPACE.
+
PR debug/80436
* tree-ssa-loop-manip.c (find_uses_to_rename_def): Ignore debug uses.
but try to canonicalize. */
tree main = TYPE_MAIN_VARIANT (type);
for (tree t = main; t; t = TYPE_NEXT_VARIANT (t))
- if (check_base_type (t, main) && check_lang_type (t, type))
+ if (TYPE_QUALS_NO_ADDR_SPACE (t) == 0
+ && check_base_type (t, main)
+ && check_lang_type (t, type))
return lookup_type_die (t);
return lookup_type_die (type);
}
but try to canonicalize. */
tree main = TYPE_MAIN_VARIANT (type);
for (tree t = main; t; t = TYPE_NEXT_VARIANT (t))
- {
- if (check_base_type (t, main) && check_lang_type (t, type))
- {
- type = t;
- break;
- }
- }
+ if (TYPE_QUALS_NO_ADDR_SPACE (t) == 0
+ && check_base_type (t, main)
+ && check_lang_type (t, type))
+ {
+ type = t;
+ break;
+ }
}
else if (TREE_CODE (type) != VECTOR_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)
--- /dev/null
+// PR debug/80461
+// { dg-do compile }
+// { dg-options "-g -O" }
+
+template <typename> class A;
+struct B
+{
+ template <typename T, typename U>
+ static bool foo (U T::*) {}
+};
+template <typename, typename> class J;
+template <typename T, typename U, typename V, typename... W>
+class J<V (W...), U T::*> : public J<void(), U T::*> {};
+template <typename T, typename U, typename... W>
+class J<void(W...), U T::*> : public B {};
+template <typename V, typename... W> struct A<V (W...)>
+{
+ template <typename, typename> using K = int;
+ template <typename L, typename = K<int, void>, typename = K<int, void>> A (L);
+};
+template <typename V, typename... W>
+template <typename L, typename, typename>
+A<V (W...)>::A (L x) { J<V (), L>::foo (x); }
+struct N;
+volatile int v;
+
+template <class O, class P>
+void
+bar ()
+{
+ O q;
+ A<P> f = q;
+ v++;
+}
+
+void
+baz ()
+{
+ bar<int (N::*) (...) &, int()> ();
+ bar<int (N::*) (...) const &, int()> ();
+ bar<int (N::*) (...) volatile &, int()> ();
+}