Files
clang-p2996/clang/test/CXX/module/module.unit/p7/t1.cpp
Chuanqi Xu e587372f85 [C++20] [Module] Support extern C/C++ semantics
According to [module.unit]p7.2.3, a declaration within a linkage-specification
should be attached to the global module.
This let user to forward declare types across modules.

Reviewed by: rsmith, aaron.ballman

Differential Revision: https://reviews.llvm.org/D110215
2021-12-08 13:29:16 +08:00

36 lines
381 B
C++

// RUN: %clang_cc1 -std=c++20 %s -verify
// expected-no-diagnostics
module;
#include "Inputs/h1.h"
export module x;
extern "C" void foo() {
return;
}
extern "C" {
void bar() {
return;
}
int baz() {
return 3;
}
double double_func() {
return 5.0;
}
}
extern "C++" {
void bar_cpp() {
return;
}
int baz_cpp() {
return 3;
}
double double_func_cpp() {
return 5.0;
}
}