compatible with GCC.
- ``-fcoroutines-ts`` has been deprecated. The flag will be removed in Clang 17.
Please use ``-std=c++20`` or higher to use standard C++ coroutines instead.
+- ``-fmodules-ts`` has been deprecated. The flag will be removed in Clang 17.
+ Please use ``-std=c++20`` or higher to use standard C++ modules instead.
Modified Compiler Flags
-----------------------
"the '-fcoroutines-ts' flag is deprecated and it will be removed in Clang 17; "
"use '-std=c++20' or higher to use standard C++ coroutines instead">,
InGroup<DeprecatedExperimentalCoroutine>;
+def warn_deprecated_fmodules_ts_flag : Warning<
+ "the '-fmodules-ts' flag is deprecated and it will be removed in Clang 17; "
+ "use '-std=c++20' or higher to use standard C++ modules instead">,
+ InGroup<DiagGroup<"deprecated-module-ts">>;
def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
HaveModules |= HaveClangModules;
if (Args.hasArg(options::OPT_fmodules_ts)) {
+ D.Diag(diag::warn_deprecated_fmodules_ts_flag);
CmdArgs.push_back("-fmodules-ts");
HaveModules = true;
}
//
// RUN: %clang -fmodules-ts -x c++-module --precompile %s -o %t.pcm -v 2>&1 | FileCheck %s --check-prefix=CHECK-PRECOMPILE
//
+// CHECK-PRECOMPILE: warning: the '-fmodules-ts' flag is deprecated and it will be removed in Clang 17; use '-std=c++20' or higher to use standard C++ modules instead [-Wdeprecated-module-ts]
// CHECK-PRECOMPILE: -cc1 {{.*}} -emit-module-interface
// CHECK-PRECOMPILE-SAME: -o {{.*}}.pcm
// CHECK-PRECOMPILE-SAME: -x c++
// Check compiling a .pcm file to a .o file.
//
-// RUN: %clang -fmodules-ts -fintegrated-as %t.pcm -c -o %t.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE
+// RUN: %clang -fmodules-ts -fintegrated-as %t.pcm -c -o %t.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE --check-prefix=CHECK-WARN
//
+// CHECK-WARN: warning: the '-fmodules-ts' flag is deprecated and it will be removed in Clang 17; use '-std=c++20' or higher to use standard C++ modules instead [-Wdeprecated-module-ts]
// CHECK-COMPILE: -cc1 {{.*}} -emit-obj
// CHECK-COMPILE-SAME: -o {{.*}}.pcm.o
// CHECK-COMPILE-SAME: -x pcm
//
// RUN: %clang -fmodules-ts -fmodule-file=%t.pcm -fintegrated-as -Dexport= %s -c -o %t.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-USE
//
+// CHECK-USE: warning: the '-fmodules-ts' flag is deprecated and it will be removed in Clang 17; use '-std=c++20' or higher to use standard C++ modules instead [-Wdeprecated-module-ts]
// CHECK-USE: -cc1
// CHECK-USE-SAME: -emit-obj
// CHECK-USE-SAME: -fmodule-file={{.*}}.pcm