Skip to content

Commit 3d39cec

Browse files
ChuanqiXu9tstellar
authored andcommitted
[C++2b] [Modules] Handle HaveModules with C++2b
Closing #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 834a878)
1 parent bf03788 commit 3d39cec

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6588,7 +6588,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
65886588
// support by default, or just assume that all languages do.
65896589
bool HaveModules =
65906590
Std && (Std->containsValue("c++2a") || Std->containsValue("c++20") ||
6591-
Std->containsValue("c++latest"));
6591+
Std->containsValue("c++2b") || Std->containsValue("c++latest"));
65926592
RenderModulesOptions(C, D, Args, Input, Output, CmdArgs, HaveModules);
65936593

65946594
if (Args.hasFlag(options::OPT_fpch_validate_input_files_content,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %clang -std=c++2a -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
2+
// RUN: %clang -std=c++20 -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
3+
// RUN: %clang -std=c++2b -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
4+
// RUN: %clang -std=c++latest -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s
5+
//
6+
// CHECK-NOT: warning: argument unused during compilation
7+
// CHECK: -fprebuilt-module-path=.

0 commit comments

Comments
 (0)