+2017-10-06 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/82424
+ * name-lookup.c (check_local_shadow): Don't try and convert
+ dependent types.
+
2017-10-06 Jakub Jelinek <jakub@redhat.com>
PR c++/82299
else if (warn_shadow_local)
warning_code = OPT_Wshadow_local;
else if (warn_shadow_compatible_local
- && can_convert (TREE_TYPE (old), TREE_TYPE (decl), tf_none))
+ && (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))
+ || (!dependent_type_p (TREE_TYPE (decl))
+ && !dependent_type_p (TREE_TYPE (old))
+ && can_convert (TREE_TYPE (old), TREE_TYPE (decl),
+ tf_none))))
warning_code = OPT_Wshadow_compatible_local;
else
return;
+2017-10-06 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/82424
+ * g++.dg/warn/pr82424.C: New.
+
2017-10-06 Jakub Jelinek <jakub@redhat.com>
PR c++/82299
--- /dev/null
+// { dg-additional-options "-Wshadow=compatible-local" }
+
+// pr c++/82424 we were trying to convert between dependent types.
+template <typename T> class a
+{
+ struct b;
+ template <typename, typename> void c ();
+};
+template <typename T>
+template <typename, typename>
+void
+a<T>::c ()
+{
+ typedef typename T::b b; // Don't go looking inside the typename
+ T thing;
+ {
+ T thing; // { dg-warning "shadows a previous local" }
+ }
+}
+