Skip to content

Commit 65fdd00

Browse files
lefticusclaude
andcommitted
Fix \firstlibchapter macro expansion for older C++ standards
The intro pages in n3337/n4140/n4659 were incorrectly linking to [[support]] instead of [[language.support]] because the \firstlibchapter macro was not being properly read from config.tex. Root causes: 1. standard_builder.py creates temp files in /tmp/ for expanded LaTeX, but converter.py calculated source_dir from the temp file path, so cpp-macros.lua couldn't find config.tex 2. Pandoc's default filter traversal processes elements before metadata, so Meta() which loads config.tex ran AFTER \firstlibchapter was already expanded Fixes: - Add source_dir parameter to converter.py convert_file() so callers can explicitly pass the correct source directory - Update standard_builder.py to pass source_dir to convert_file() calls - Add explicit filter return list in cpp-macros.lua to ensure Meta runs first - Include CodeBlock handler in the filter list (was accidentally omitted) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a847aed commit 65fdd00

File tree

14 files changed

+200
-187
lines changed

14 files changed

+200
-187
lines changed

n3337/intro.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ That description includes detailed syntactic specifications in a form
304304
described in  [[syntax]]. For convenience, Annex  [[gram]] repeats all
305305
such syntactic specifications.
306306

307-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] (the
308-
*library clauses*) describe the Standard C++library. That description
309-
includes detailed descriptions of the templates, classes, functions,
310-
constants, and macros that constitute the library, in a form described
311-
in Clause  [[library]].
307+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]]
308+
(the *library clauses*) describe the Standard C++library. That
309+
description includes detailed descriptions of the templates, classes,
310+
functions, constants, and macros that constitute the library, in a form
311+
described in Clause  [[library]].
312312

313313
Annex  [[implimits]] recommends lower bounds on the capacity of
314314
conforming implementations.
@@ -1034,17 +1034,17 @@ All rights in these originals are reserved.
10341034
[intro.refs]: #intro.refs
10351035
[intro.scope]: #intro.scope
10361036
[intro.structure]: #intro.structure
1037+
[language.support]: language.md#language.support
10371038
[lex]: lex.md#lex
10381039
[lex.charset]: lex.md#lex.charset
10391040
[lex.phases]: lex.md#lex.phases
10401041
[library]: library.md#library
1041-
[support]: #support
10421042
[syntax]: #syntax
10431043
[thread]: thread.md#thread
10441044

1045-
[^1]: With the qualifications noted in Clauses  [[support]] through 
1046-
[[thread]] and in  [[diff.library]], the C standard library is a
1047-
subset of the C++standard library.
1045+
[^1]: With the qualifications noted in Clauses  [[language.support]]
1046+
through  [[thread]] and in  [[diff.library]], the C standard library
1047+
is a subset of the C++standard library.
10481048

10491049
[^2]: “Correct execution” can include undefined behavior, depending on
10501050
the data being processed; see  [[intro.defs]] and 

n3337/library.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ implementation may provide the entities in the library.
99
The following subclauses describe the definitions ([[definitions]]),
1010
method of description ([[description]]), and organization (
1111
[[organization]]) of the library. Clause  [[requirements]], Clauses 
12-
[[support]] through  [[thread]], and Annex  [[depr]] specify the
13-
contents of the library, as well as library requirements and constraints
14-
on both well-formed C++programs and conforming implementations.
12+
[[language.support]] through  [[thread]], and Annex  [[depr]] specify
13+
the contents of the library, as well as library requirements and
14+
constraints on both well-formed C++programs and conforming
15+
implementations.
1516

1617
Detailed specifications for each of the components in the library are in
17-
Clauses  [[support]][[thread]], as shown in Table 
18+
Clauses  [[language.support]][[thread]], as shown in Table 
1819
[[tab:library.categories]].
1920

2021
The language support library (Clause  [[language.support]]) provides
@@ -257,8 +258,8 @@ International Standard.
257258

258259
This subclause describes the conventions used to specify the C++standard
259260
library. [[structure]] describes the structure of the normative Clauses 
260-
[[support]] through  [[thread]] and Annex  [[depr]]. [[conventions]]
261-
describes other editorial conventions.
261+
[[language.support]] through  [[thread]] and Annex  [[depr]].
262+
[[conventions]] describes other editorial conventions.
262263

263264
### Structure of each clause <a id="structure">[[structure]]</a>
264265

@@ -448,10 +449,10 @@ this particular enumerated type. All such elements have distinct values.
448449
449450
##### Bitmask types <a id="bitmask.types">[[bitmask.types]]</a>
450451
451-
Several types defined in Clauses  [[support]] through  [[thread]] and
452-
Annex  [[depr]] are *bitmask types*. Each bitmask type can be
453-
implemented as an enumerated type that overloads certain operators, as
454-
an integer type, or as a `bitset` ([[template.bitset]]).
452+
Several types defined in Clauses  [[language.support]] through 
453+
[[thread]] and Annex  [[depr]] are *bitmask types*. Each bitmask type
454+
can be implemented as an enumerated type that overloads certain
455+
operators, as an integer type, or as a `bitset` ([[template.bitset]]).
455456
456457
The bitmask type *bitmask* can be written:
457458
@@ -520,9 +521,9 @@ sequences that follow a few uniform conventions:
520521
functions that convert between a (single-byte) character sequence and
521522
a value of one of the floating-point types. It is used in the
522523
character sequence to denote the beginning of a fractional part. It is
523-
represented in Clauses  [[support]] through  [[thread]] and Annex 
524-
[[depr]] by a period, `'.'`, which is also its value in the `"C"`
525-
locale, but may change during program execution by a call to
524+
represented in Clauses  [[language.support]] through  [[thread]] and
525+
Annex  [[depr]] by a period, `'.'`, which is also its value in the
526+
`"C"` locale, but may change during program execution by a call to
526527
`setlocale(int, const char*)`,[^10] or by a change to a `locale`
527528
object, as described in Clauses  [[locales]] and  [[input.output]].
528529
- A *character sequence* is an array object ([[dcl.array]]) *A* that
@@ -558,24 +559,24 @@ A *static* NTMBS is an NTMBSwith static storage duration.
558559

559560
#### Functions within classes <a id="functions.within.classes">[[functions.within.classes]]</a>
560561

561-
For the sake of exposition, Clauses  [[support]] through  [[thread]] and
562-
Annex  [[depr]] do not describe copy/move constructors, assignment
563-
operators, or (non-virtual) destructors with the same apparent semantics
564-
as those that can be generated by default ([[class.ctor]],
565-
[[class.dtor]], [[class.copy]]).
562+
For the sake of exposition, Clauses  [[language.support]] through 
563+
[[thread]] and Annex  [[depr]] do not describe copy/move constructors,
564+
assignment operators, or (non-virtual) destructors with the same
565+
apparent semantics as those that can be generated by default (
566+
[[class.ctor]], [[class.dtor]], [[class.copy]]).
566567

567568
It is unspecified whether the implementation provides explicit
568569
definitions for such member function signatures, or for virtual
569570
destructors that can be generated by default.
570571

571572
#### Private members <a id="objects.within.classes">[[objects.within.classes]]</a>
572573

573-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] do not
574-
specify the representation of classes, and intentionally omit
574+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]] do
575+
not specify the representation of classes, and intentionally omit
575576
specification of class members ([[class.mem]]). An implementation may
576577
define static or non-static class members, or both, as needed to
577578
implement the semantics of the member functions specified in Clauses 
578-
[[support]] through  [[thread]] and Annex  [[depr]].
579+
[[language.support]] through  [[thread]] and Annex  [[depr]].
579580

580581
Objects of certain classes are sometimes required by the external
581582
specifications of their classes to store data, apparently in member
@@ -596,9 +597,9 @@ external behavior.
596597
## Library-wide requirements <a id="requirements">[[requirements]]</a>
597598

598599
This subclause specifies requirements that apply to the entire
599-
C++standard library. Clauses  [[support]] through  [[thread]] and Annex 
600-
[[depr]] specify the requirements of individual entities within the
601-
library.
600+
C++standard library. Clauses  [[language.support]] through  [[thread]]
601+
and Annex  [[depr]] specify the requirements of individual entities
602+
within the library.
602603

603604
Requirements specified in terms of interactions between threads do not
604605
apply to programs having only a single thread of execution.
@@ -674,16 +675,16 @@ headers, as shown in Table  [[tab:cpp.c.headers]].
674675
| `<cfloat>` | `<csetjmp>` | `<cstdint>` | `<cuchar>` | |
675676

676677

677-
Except as noted in Clauses  [[support]] through  [[thread]] and Annex 
678-
[[depr]], the contents of each header `cname` shall be the same as that
679-
of the corresponding header `name.h`, as specified in the C standard
680-
library ([[intro.refs]]) or the C Unicode TR, as appropriate, as if by
681-
inclusion. In the C++standard library, however, the declarations (except
682-
for names which are defined as macros in C) are within namespace scope (
683-
[[basic.scope.namespace]]) of the namespace `std.` It is unspecified
684-
whether these names are first declared within the global namespace scope
685-
and are then injected into namespace `std` by explicit
686-
*using-declaration*s ([[namespace.udecl]]).
678+
Except as noted in Clauses  [[language.support]] through  [[thread]] and
679+
Annex  [[depr]], the contents of each header `cname` shall be the same
680+
as that of the corresponding header `name.h`, as specified in the C
681+
standard library ([[intro.refs]]) or the C Unicode TR, as appropriate,
682+
as if by inclusion. In the C++standard library, however, the
683+
declarations (except for names which are defined as macros in C) are
684+
within namespace scope ([[basic.scope.namespace]]) of the namespace
685+
`std.` It is unspecified whether these names are first declared within
686+
the global namespace scope and are then injected into namespace `std` by
687+
explicit *using-declaration*s ([[namespace.udecl]]).
687688

688689
Names which are defined as macros in C shall be defined as macros in the
689690
C++ standard library, even if C grants license for implementation as
@@ -1218,9 +1219,9 @@ program ([[class.virtual]]).
12181219

12191220
#### Replacement functions <a id="replacement.functions">[[replacement.functions]]</a>
12201221

1221-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] describe
1222-
the behavior of numerous functions defined by the C++standard library.
1223-
Under some circumstances, however, certain of these function
1222+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]]
1223+
describe the behavior of numerous functions defined by the C++standard
1224+
library. Under some circumstances, however, certain of these function
12241225
descriptions also apply to replacement functions defined in the
12251226
program ([[definitions]]).
12261227

@@ -1398,8 +1399,8 @@ It is unspecified whether any global or non-member functions in the
13981399
C++standard library are defined as `inline` ([[dcl.fct.spec]]).
13991400

14001401
A call to a global or non-member function signature described in
1401-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] shall
1402-
behave as if the implementation declared no additional global or
1402+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]]
1403+
shall behave as if the implementation declared no additional global or
14031404
non-member function signatures.[^27]
14041405

14051406
An implementation shall not declare a global or non-member function
@@ -1511,8 +1512,8 @@ visible side effects.
15111512
#### Protection within classes <a id="protection.within.classes">[[protection.within.classes]]</a>
15121513

15131514
It is unspecified whether any function signature or class described in
1514-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] is a
1515-
`friend` of another class in the C++standard library.
1515+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]] is
1516+
a `friend` of another class in the C++standard library.
15161517

15171518
#### Derived classes <a id="derivation">[[derivation]]</a>
15181519

@@ -1727,7 +1728,6 @@ objects shall be placed in a valid but unspecified state.
17271728
[structure.see.also]: #structure.see.also
17281729
[structure.specifications]: #structure.specifications
17291730
[structure.summary]: #structure.summary
1730-
[support]: #support
17311731
[support.dynamic]: language.md#support.dynamic
17321732
[support.exception]: language.md#support.exception
17331733
[support.initlist]: language.md#support.initlist

n4140/intro.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ That description includes detailed syntactic specifications in a form
290290
described in  [[syntax]]. For convenience, Annex  [[gram]] repeats all
291291
such syntactic specifications.
292292

293-
Clauses  [[support]] through  [[thread]] and Annex  [[depr]] (the
294-
*library clauses*) describe the Standard C++library. That description
295-
includes detailed descriptions of the templates, classes, functions,
296-
constants, and macros that constitute the library, in a form described
297-
in Clause  [[library]].
293+
Clauses  [[language.support]] through  [[thread]] and Annex  [[depr]]
294+
(the *library clauses*) describe the Standard C++library. That
295+
description includes detailed descriptions of the templates, classes,
296+
functions, constants, and macros that constitute the library, in a form
297+
described in Clause  [[library]].
298298

299299
Annex  [[implimits]] recommends lower bounds on the capacity of
300300
conforming implementations.
@@ -1060,17 +1060,17 @@ All rights in these originals are reserved.
10601060
[intro.refs]: #intro.refs
10611061
[intro.scope]: #intro.scope
10621062
[intro.structure]: #intro.structure
1063+
[language.support]: language.md#language.support
10631064
[lex]: lex.md#lex
10641065
[lex.charset]: lex.md#lex.charset
10651066
[lex.phases]: lex.md#lex.phases
10661067
[library]: library.md#library
1067-
[support]: #support
10681068
[syntax]: #syntax
10691069
[thread]: thread.md#thread
10701070

1071-
[^1]: With the qualifications noted in Clauses  [[support]] through 
1072-
[[thread]] and in  [[diff.library]], the C standard library is a
1073-
subset of the C++standard library.
1071+
[^1]: With the qualifications noted in Clauses  [[language.support]]
1072+
through  [[thread]] and in  [[diff.library]], the C standard library
1073+
is a subset of the C++standard library.
10741074

10751075
[^2]: “Correct execution” can include undefined behavior, depending on
10761076
the data being processed; see  [[intro.defs]] and 

0 commit comments

Comments
 (0)