[clang] [C++20] [Modules] Introduce -fskip-odr-check-in-gmf (PR #79959)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 10:52:38 PST 2024


================
@@ -3940,6 +3940,14 @@ static bool RenderModulesOptions(Compilation &C, const Driver &D,
     Args.ClaimAllArgs(options::OPT_fmodules_disable_diagnostic_validation);
   }
 
+  // Don't check ODR violations for decls in the global module fragment.
+  // 1. To keep consistent behavior with MSVC, which don't check ODR violations
+  //    in the global module fragment too.
+  // 2. Give users better using experience since most issue reports complains
+  //    the false positive ODR violations diagnostic and the true positive ODR
+  //    violations are rarely reported.
+  CmdArgs.push_back("-fskip-odr-check-in-gmf");
----------------
mizvekov wrote:

```suggestion
  // FIXME: We provisionally don't check ODR violations for decls in the global module fragment.
  CmdArgs.push_back("-fskip-odr-check-in-gmf");
```

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


More information about the cfe-commits mailing list