llvm-capstone/clang/test/Modules/use-extern-language-linkage.cppm
Chuanqi Xu 5828692f70 [C++20] [Modules] Make TheImplicitGlobalModuleFragment and TheExportedImplicitGlobalModuleFragment to be useable modules
The unexported language linkage become unvisible to the current module
unit after the previous commit bf52ead24ca4. This patch fixes the issue.
2023-03-03 11:15:29 +08:00

26 lines
456 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -fsyntax-only -verify
//--- foo.h
extern "C++" void c_func();
//--- a.cppm
// expected-no-diagnostics
module;
#include "foo.h"
export module a;
export extern "C++" void foo() {}
extern "C++" void bar() {}
export extern "C" void foo_c() {}
extern "C" void bar_c() {}
export void a() {
foo();
bar();
foo_c();
bar_c();
c_func();
}