[clang] [clang][driver] Fix unused argument warning for `/std:c++20` for precompiled module inputs to `clang-cl` (PR #99300)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 03:19:02 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-driver

Author: Sharadh Rajaraman (sharadhr)

<details>
<summary>Changes</summary>

Relates to #<!-- -->98761: `-fmodule-file` requires `/std:c++20` or greater, but passing that option results in an unused argument warning. This resolves that.

---
Full diff: https://github.com/llvm/llvm-project/pull/99300.diff


1 Files Affected:

- (modified) clang/lib/Driver/Types.cpp (+3-1) 


``````````diff
diff --git a/clang/lib/Driver/Types.cpp b/clang/lib/Driver/Types.cpp
index a7b6b9000e1d2..842eb59b7382d 100644
--- a/clang/lib/Driver/Types.cpp
+++ b/clang/lib/Driver/Types.cpp
@@ -242,7 +242,9 @@ bool types::isCXX(ID Id) {
   case TY_CXXHUHeader:
   case TY_PP_CXXHeaderUnit:
   case TY_ObjCXXHeader: case TY_PP_ObjCXXHeader:
-  case TY_CXXModule: case TY_PP_CXXModule:
+  case TY_CXXModule: 
+  case TY_PP_CXXModule:
+  case TY_ModuleFile:
   case TY_PP_CLCXX:
   case TY_CUDA: case TY_PP_CUDA: case TY_CUDA_DEVICE:
   case TY_HIP:

``````````

</details>


https://github.com/llvm/llvm-project/pull/99300


More information about the cfe-commits mailing list