Skip to content

Commit 4b99af3

Browse files
committed
[docs] Update doc for C++20 Modules after dc4e85b
After dc4e85b, we need to update the examples in the documents. This patch also fix some other places where is no longer relevant.
1 parent 1833e3f commit 4b99af3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/docs/StandardCPlusPlusModules.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Then we type:
143143
.. code-block:: console
144144
145145
$ clang++ -std=c++20 Hello.cppm --precompile -o Hello.pcm
146-
$ clang++ -std=c++20 use.cpp -fprebuilt-module-path=. Hello.pcm -o Hello.out
146+
$ clang++ -std=c++20 use.cpp -fmodule-file=Hello=Hello.pcm Hello.pcm -o Hello.out
147147
$ ./Hello.out
148148
Hello World!
149149
@@ -200,15 +200,15 @@ Then we are able to compile the example by the following command:
200200
$ clang++ -std=c++20 interface_part.cppm --precompile -o M-interface_part.pcm
201201
$ clang++ -std=c++20 impl_part.cppm --precompile -fprebuilt-module-path=. -o M-impl_part.pcm
202202
$ clang++ -std=c++20 M.cppm --precompile -fprebuilt-module-path=. -o M.pcm
203-
$ clang++ -std=c++20 Impl.cpp -fmodule-file=M=M.pcm -c -o Impl.o
203+
$ clang++ -std=c++20 Impl.cpp -fprebuilt-module-path=. -c -o Impl.o
204204
205205
# Compiling the user
206206
$ clang++ -std=c++20 User.cpp -fprebuilt-module-path=. -c -o User.o
207207
208208
# Compiling the module and linking it together
209-
$ clang++ -std=c++20 M-interface_part.pcm -c -o M-interface_part.o
210-
$ clang++ -std=c++20 M-impl_part.pcm -c -o M-impl_part.o
211-
$ clang++ -std=c++20 M.pcm -c -o M.o
209+
$ clang++ -std=c++20 M-interface_part.pcm -fprebuilt-module-path=. -c -o M-interface_part.o
210+
$ clang++ -std=c++20 M-impl_part.pcm -fprebuilt-module-path=. -c -o M-impl_part.o
211+
$ clang++ -std=c++20 M.pcm -fprebuilt-module-path=. -c -o M.o
212212
$ clang++ User.o M-interface_part.o M-impl_part.o M.o Impl.o -o a.out
213213
214214
We explain the options in the following sections.
@@ -218,7 +218,6 @@ How to enable standard C++ modules
218218

219219
Currently, standard C++ modules are enabled automatically
220220
if the language standard is ``-std=c++20`` or newer.
221-
The ``-fmodules-ts`` option is deprecated and is planned to be removed.
222221

223222
How to produce a BMI
224223
~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)