[all-commits] [llvm/llvm-project] e0d66c: [C++20] [Modules] Allow export redeclarations with...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Thu Jul 11 22:58:24 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0d66c242462d63d99a5324f9799ae5f84f2d84f
      https://github.com/llvm/llvm-project/commit/e0d66c242462d63d99a5324f9799ae5f84f2d84f
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2024-07-12 (Fri, 12 Jul 2024)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/Modules/export-redecl-in-language-linkage.cppm

  Log Message:
  -----------
  [C++20] [Modules] Allow export redeclarations within language linkage

Close https://github.com/llvm/llvm-project/issues/98583

Currently, clang will reject the following code:

```
export module mod;
extern "C++" void func();
export extern "C++" {
    void func();
}
```

while both MSVC and GCC accept it. Although clang's behavior matches the
current wording, from the discussion, the consensus is that we should
accept the above example from the intention. Since the intention to not
allow export redeclaration which is not exported is to make the linkage
clear. But it doesn't matter with the declarations within global module.



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