+2018-09-18 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/86881
+ * name-lookup.c (check_local_shadow): Ignore auto types.
+
2018-09-17 David Malcolm <dmalcolm@redhat.com>
* error.c (range_label_for_type_mismatch::get_text): Update for
&& (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))
|| (!dependent_type_p (TREE_TYPE (decl))
&& !dependent_type_p (TREE_TYPE (old))
+ /* If the new decl uses auto, we don't yet know
+ its type (the old type cannot be using auto
+ at this point, without also being
+ dependent). This is an indication we're
+ (now) doing the shadow checking too
+ early. */
+ && !type_uses_auto (TREE_TYPE (decl))
&& can_convert (TREE_TYPE (old), TREE_TYPE (decl),
tf_none))))
warning_code = OPT_Wshadow_compatible_local;
+2018-09-18 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/86881
+ * g++.dg/warn/pr86881.C: New.
+
2018-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/spellcheck_1.c:
--- /dev/null
+// PR c++/86881 ICE with shadow warning
+// { dg-do compile { c++11 } }
+// { dg-additional-options { -Wshadow-compatible-local } }}
+
+void a() {
+ auto b([] {});
+ {
+ auto b = 0;
+ }
+}
+
+struct Proxy { };
+
+void Two ()
+{
+ auto my = Proxy ();
+ {
+ auto my = Proxy (); // { dg-warning "shadows" "" { xfail *-*-* } }
+ };
+}