aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2025-07-25 15:57:53 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2025-07-28 09:58:38 +0800
commit1b4db78d2eaa070b3f364a2d2b2b826a5439b892 (patch)
tree4f88ee6f4fc03158f58bc9a44bf71807198e96f7 /clang/lib/Frontend/TestModuleFileExtension.cpp
parenteb04b699e9df89c493da2986c29aa6f553cc85b6 (diff)
downloadllvm-1b4db78d2eaa070b3f364a2d2b2b826a5439b892.zip
llvm-1b4db78d2eaa070b3f364a2d2b2b826a5439b892.tar.gz
llvm-1b4db78d2eaa070b3f364a2d2b2b826a5439b892.tar.bz2
[C++20] [Modules] Implement diagnose for exposured partially
Tracked at https://github.com/llvm/llvm-project/issues/112294 This patch implements from [basic.link]p14 to [basic.link]p18 partially. The explicitly missing parts are: - Anything related to specializations. - Decide if a pointer is associated with a TU-local value at compile time. - [basic.link]p15.1.2 to decide if a type is TU-local. - Diagnose if TU-local functions from other TU are collected to the overload set. See [basic.link]p19, the call to 'h(N::A{});' in translation unit #2 There should be other implicitly missing parts as the wording uses "names" briefly several times. But to implement this precisely, we have to visit the whole AST, including Decls, Expression and Types, which may be harder to implement and be more time-consuming for compilation time. So I choose to implement the common parts. It won't be too bad to miss some cases since we DIDN'T do any such checks in the past 3 years. Any new check is an improvement. Given modules have been basically available since clang15 without such checks, it will be user unfriendly if we give a hard error now. And there are a lot of cases which violating the rule actually just fine. So I decide to emit it as warnings instead of hard errors.
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions