This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/78656] Fix-it suggestion for std::alocator doesn't include std::allocator


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78656

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-12-13
     Ever confirmed|0                           |1

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Confirmed.

Error is emitted here:

3767      else if (scope != global_namespace)
3768        {
3769          error_at (location, "%qD is not a member of %qD", name, scope);
3770          suggest_alternatives_for (location, name);
3771        }

(gdb) p scope
$1 = <namespace_decl 0x7ffff18c7098 std>
(gdb) p name
$2 = <identifier_node 0x7ffff1a54790 allocate>

Note that suggest_alternatives_for doesn't receive "scope" as a parameter.

"suggest_alternatives_for" looks through namespaces, starting in global
namespace and reports on any exact matches.
It only uses the near-match code if no exact matches are found, and even then,
it only looks in the global namespace.

Presumably if the namespace was given explicitly, then we want to look for near
matches in that namespace.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]