Skip to content

Commit caa1860

Browse files
committed
New issue from Jiang An: "Undesired status for some functions in <cmath>"
1 parent ebc9fba commit caa1860

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

xml/issue4488.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4488" status="New">
5+
<title>Undesired status for some functions in <tt>&lt;cmath&gt;</tt></title>
6+
<section><sref ref="[headers]"/></section>
7+
<submitter>Jiang An</submitter>
8+
<date>08 Dec 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
Originally reported in <a href="https://github.com/cplusplus/draft/issues/8579">cplusplus/draft#8579</a>.
14+
<p/>
15+
Currently, <sref ref="[headers]"/> p5 specially mentions "except for names which are defined as macros in C",
16+
which covers `std::fpclassify` and its friends. Perhaps we don't want to require them to be initially declared
17+
in namespace `std`. Moreover, <sref ref="[headers]"/> p6 seemingly requires them to be also defined as macros
18+
in C++, which doesn't seem intentional.
19+
<p/>
20+
Perhaps we want to exactly specify whether a name denotes a function (overload set) or a macro in C++,
21+
while no name should denote both a function and a macro, and to allow a function name from C initially declared
22+
in the global namespace.
23+
</p>
24+
</discussion>
25+
26+
<resolution>
27+
<p>
28+
This wording is relative to <paper num="N5032"/>.
29+
</p>
30+
31+
<ol>
32+
<li><p>Modify <sref ref="[headers]"/> as indicated:</p>
33+
34+
<blockquote>
35+
<p>
36+
[&hellip;]
37+
<p/>
38+
-5- Except as noted in <sref ref="[library]"/> through <sref ref="[exec]"/> and <sref ref="[depr]"/>,
39+
the contents of each header <tt>c<i>name</i></tt> is the same as that of the corresponding header
40+
<tt><i>name</i>.h</tt> as specified in the C standard library (<sref ref="[intro.refs]"/>). In the
41+
C++ standard library, however, the declarations (except for names which are defined as macros
42+
in C<ins>++</ins>) are within namespace scope (<sref ref="[basic.scope.namespace]"/>) of the namespace
43+
`std`. It is unspecified whether these names (including any overloads added in <sref ref="[support]"/>
44+
through <sref ref="[exec]"/> and <sref ref="[depr]"/>) are first declared within the global namespace
45+
scope and are then injected into namespace `std` by explicit <i>using-declarations</i>
46+
(<sref ref="[namespace.udecl]"/>).
47+
<p/>
48+
-6- Names which are defined as macros in <del>C shall be defined as macros in the C++ standard
49+
library</del><ins>the C++ standard library shall not be defined as functions</ins>, even if C
50+
grants license for implementation as functions.
51+
[<i>Note 2</i>: The names defined as macros in C include the following: `assert`, `offsetof`, `setjmp`,
52+
`va_arg`, `va_end`, and `va_start`. &mdash; <i>end note</i>]
53+
<p/>
54+
-7- Names that are defined as functions in <del>C shall be defined as functions in the C++ standard
55+
library</del><ins>the C++ standard library shall not be defined as macros</ins>.(138)
56+
</p>
57+
</blockquote>
58+
</li>
59+
</ol>
60+
61+
</resolution>
62+
63+
</issue>

0 commit comments

Comments
 (0)