-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STL: Non-standard non-reserved identifiers available via standard headers #2206
Labels
bug
Something isn't working
Comments
|
As an aside, the Standard Library Modules are the first way to avoid this problem. |
Klaim
added a commit
to Klaim/megastructures-prototypes
that referenced
this issue
Apr 14, 2023
Klaim
added a commit
to Klaim/megastructures-prototypes
that referenced
this issue
Apr 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The C++ standard allows user-defined macros to have non-reserved names. However, MSVC STL introduces some non-standard non-reserved via standard headers, which makes user-defined macros with such names able to paralyze the MSVC STL implementation.
The list of names may be incomplete:
stdext
related:<xhash>
,<iterator>
(also used in<yvals_core.h>
):stdext
<unordered_map>
,<unordered_set>
(ultimately,<xhash>
):hash_compare
<iterator>
:checked_array_iterator
,unchecked_array_iterator
,make_checked_array_iterator
,make_unchecked_array_iterator
(related: <iterator>: Consider deprecating and removing stdext::checked_array_iterator/unchecked_array_iterator #951)<random>
: Still provides theuniform_int
anduniform_real
class templates #1002):<random>
:linear_congruential
,subtract_with_carry
,mersenne_twister
,discard_block
,uniform_int
,uniform_real
<typeinfo>
(ultimately,<vcruntime_typeinfo.h>
):raw_name
(<typeinfo>
: non-Standard extensiontype_info::raw_name
#2195)(related: <xtimec.h>: Stop exporting internal-only functions #274) this is fixed except for the symbol name<chrono>
(ultimately,<xtimec.h>
):xtime_get
,xtime
,sec
,nsec
xtime_get
May be all of them shoud be either removed or have their names changed to reseved identifiers in vNext.
The namespace
tr1
and some non-standard names inside it are not counted as they are guarded by_HAS_TR1_NAMESPACE
. Can we handle somestdext
components liketr1
before vNext arrives?Command-line test case
Expected behavior
This program should compile.
STL version
Microsoft Visual Studio Community 2019
版本 16.11.2
Additional context
The MS CRT also provides some non-standard non-reserved names (e.g.
fread_s
). I don't know whether such issue has been reported or how to report it.The text was updated successfully, but these errors were encountered: