[all-commits] [llvm/llvm-project] 980938: [clang][modules] -Wmodule-import-in-extern-c shoul...

Ian Anderson via All-commits all-commits at lists.llvm.org
Thu Mar 5 15:54:48 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9809384aa7acb41ef6a3e001f15a15b2c8e1fc13
      https://github.com/llvm/llvm-project/commit/9809384aa7acb41ef6a3e001f15a15b2c8e1fc13
  Author: Ian Anderson <iana at apple.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/test/Modules/auto-module-import.m
    M clang/test/Modules/extern_c.cpp

  Log Message:
  -----------
  [clang][modules] -Wmodule-import-in-extern-c should not be an error by default (#184530)

Importing a module inside of an `extern "C" {...}` section doesn't have
any effect, i.e. the imported module is not treated as `extern "C"`,
it's built independent of the includer state. The warning is akin to
`-Wconfig-macros`, it's trying to say that the behavior will be
different (and unexpected) when compiling with modules. That doesn't
need to be an error, a warning is enough. As an error, it makes it
difficult to support and test modules in C++ mode while dependencies
still have includes in `extern "C" {...}`.

 rdar://171677028



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list