[llvm-branch-commits] [clang] 3d39cec - [C++2b] [Modules] Handle HaveModules with C++2b
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Aug 5 01:16:32 PDT 2022
Author: Chuanqi Xu
Date: 2022-08-05T01:15:10-07:00
New Revision: 3d39cecfe183790d67d81577492dbbff78bedc0a
URL: https://github.com/llvm/llvm-project/commit/3d39cecfe183790d67d81577492dbbff78bedc0a
DIFF: https://github.com/llvm/llvm-project/commit/3d39cecfe183790d67d81577492dbbff78bedc0a.diff
LOG: [C++2b] [Modules] Handle HaveModules with C++2b
Closing https://github.com/llvm/llvm-project/issues/56803. The root
cause for this bug is that we lack a good method to detect the language
mdoe when parsing the command line. There is a FIXME too. Dut to we lack
a good solution now, keep the workaround.
(cherry picked from commit 834a878367f549c58313200ce2c3a0da1a29d842)
Added:
clang/test/Driver/modules-fprebuilt-mdoule-path.cpp
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index a97db90518ac7..3587326e0e581 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6588,7 +6588,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// support by default, or just assume that all languages do.
bool HaveModules =
Std && (Std->containsValue("c++2a") || Std->containsValue("c++20") ||
- Std->containsValue("c++latest"));
+ Std->containsValue("c++2b") || Std->containsValue("c++latest"));
RenderModulesOptions(C, D, Args, Input, Output, CmdArgs, HaveModules);
if (Args.hasFlag(options::OPT_fpch_validate_input_files_content,
diff --git a/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp b/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp
new file mode 100644
index 0000000000000..a2c830bfda00b
--- /dev/null
+++ b/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang -std=c++2a -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
+// RUN: %clang -std=c++20 -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
+// RUN: %clang -std=c++2b -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
+// RUN: %clang -std=c++latest -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
+//
+// CHECK-NOT: warning: argument unused during compilation
+// CHECK: -fprebuilt-module-path=.
More information about the llvm-branch-commits
mailing list