[C++20] [Module] Support extern C/C++ semantics
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 8 Dec 2021 03:34:18 +0000 (11:34 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 8 Dec 2021 05:29:16 +0000 (13:29 +0800)
commite587372f85105b85ae790fbe129b5d609d6dfb76
tree3a8a7e0d25cbf5d75423dbba1c7a8b054c5221db
parentec64d10340daacb066ab1bbf6356727062a8236f
[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
19 files changed:
clang/include/clang/Basic/Module.h
clang/include/clang/Lex/ModuleMap.h
clang/include/clang/Sema/Sema.h
clang/lib/Lex/ModuleMap.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaModule.cpp
clang/test/CXX/module/module.unit/p7/Inputs/CPP.cppm [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/Inputs/h1.h [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/Inputs/h2.h [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/Inputs/h4.h [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/Inputs/h5.h [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t1.cpp [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t2.cpp [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t3.cpp [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t4.cpp [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t5.cpp [new file with mode: 0644]
clang/test/CXX/module/module.unit/p7/t6.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/Inputs/module-extern-C.h [new file with mode: 0644]
clang/test/CodeGenCXX/module-extern-C.cpp [new file with mode: 0644]