microsoft / microsoft/STL

`<typeinfo>`: `type_info`'s True Name should be in `std`, but is in the global namespace

Open
#2,205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug vNext
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

Reported by @frederick-vs-ja in https://github.com/microsoft/STL/issues/2195#issuecomment-917427326 :


This issue should belong to vcruntime (but may belong to this repo later).

BTW, in the MSVC implementation, the class type_info is originally defined in the global namespace, which brings some non-conforming result. E.g., the following code should be rejected because range-for does ADL-only lookup, but is accepted by MSVC:

#include <typeinfo>

inline int *begin(std::type_info const&) { return nullptr; }
inline int *end(std::type_info const&) { return nullptr; }

int main()
{
    for (auto i : typeid(void));
}

vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the issue's C++ example and the note that the problem may belong to vcruntime. Review #169 and wait for the vNext branch, since resolving this requires breaking binary compatibility and pull requests are not currently accepted. Done means making std::type_info's true name conform to the standard and rejecting the demonstrated ADL-only range-for case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.