2017-06-06 Nathan Sidwell <nathan@acm.org>
+ * name-lookup.c (suggest_alternatives_for): Use qualified lookup
+ sans using directives. Don't walk into inline namespaces.
+
PR c++/80979
* name-lookup.c (adl_class_only): Don't add visible friends.
for (unsigned ix = 0; ix != worklist.length (); ix++)
{
tree ns = worklist[ix];
+ name_lookup lookup (name);
- if (tree value = ovl_skip_hidden (find_namespace_value (ns, name)))
- candidates.safe_push (value);
+ if (lookup.search_qualified (ns, false))
+ candidates.safe_push (lookup.value);
if (!limited)
{
for (tree decl = NAMESPACE_LEVEL (ns)->names;
decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == NAMESPACE_DECL
- && !DECL_NAMESPACE_ALIAS (decl))
+ && !DECL_NAMESPACE_ALIAS (decl)
+ && !DECL_NAMESPACE_INLINE_P (decl))
children.safe_push (decl);
while (!limited && !children.is_empty ())
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
// Search std, __cxxabiv1, and global namespaces, plus two more,
// breadth first
namespace B
{
- int foo; // { dg-message "B::foo" "suggested alternative" }
+ inline namespace I
+ {
+ int foo; // { dg-message "B::I::foo" "suggested alternative" }
+ }
}
namespace C