[Driver] Enable to use C++20 standalne by -fcxx-modules
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 30 May 2022 02:08:39 +0000 (10:08 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 30 May 2022 02:24:09 +0000 (10:24 +0800)
commit99eca8353808f63670c647aeae03e0ce66eb21e0
treeaca8ffa9e602dedc75fedbf05270be1fae800f67
parentef256ed58ebf4689ec8d8fffaee529063f0b8729
[Driver] Enable to use C++20 standalne by -fcxx-modules

This patch allows user to use C++20 module by -fcxx-modules. Previously,
we could only use it under -std=c++20. Given that user could use C++20
coroutine standalonel by -fcoroutines-ts. It makes sense to offer an
option to use C++20 modules without enabling C++20.

Reviewed By: iains, MaskRay

Differential Revision: https://reviews.llvm.org/D120540
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/modules.cpp
clang/test/Modules/cxx-modules.cppm [new file with mode: 0644]