Users of pushdecl assume that the returned decl will be a possibly
updated decl matching the one that was passed in. My r15-3910 change
broke this since in some cases we would now return USING_DECLs; this
patch fixes the situation.
PR c++/116913
gcc/cp/ChangeLog:
* name-lookup.cc (update_binding): Return the strip_using'd old
decl rather than the binding.
gcc/testsuite/ChangeLog:
* g++.dg/lookup/using70.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
{
if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
/* Two type decls to the same type. Do nothing. */
- return old_bval;
+ return old;
else
goto conflict;
}
/* The new one must be an alias at this point. */
gcc_assert (DECL_NAMESPACE_ALIAS (decl));
- return old_bval;
+ return old;
}
else if (TREE_CODE (old) == VAR_DECL)
{
--- /dev/null
+// PR c++/116913
+// { dg-do compile { target c++11 } }
+
+namespace ns {
+ struct c {};
+ using d = int;
+}
+
+using ns::c;
+using ns::d;
+
+using c = ns::c;
+using d = ns::d;