[PATCH] D128921: [Sema] Merge C++20 concept definitions from different modules in same TU

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 08:24:25 PDT 2022


ilya-biryukov created this revision.
ilya-biryukov added a reviewer: erichkeane.
Herald added a project: All.
ilya-biryukov requested review of this revision.
Herald added a project: clang.

Currently the C++20 concepts are only merged in `ASTReader`, i.e. when
coming from different TU. This can causes ambiguious reference errors when
trying to access the same concept that should otherwise be merged.

Please see the added test for an example.

Note that we currently use `ASTContext::isSameEntity` to check for ODR
violations. However, it will not check that concept requirements match.
The same issue holds for mering concepts from different TUs, I added a
FIXME and filed a GH issue to track this:
https://github.com/llvm/llvm-project/issues/56310


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128921

Files:
  clang/lib/AST/ASTContext.cpp
  clang/lib/Sema/SemaTemplate.cpp
  clang/test/Modules/Inputs/merge-concepts/concepts.h
  clang/test/Modules/Inputs/merge-concepts/format.h
  clang/test/Modules/Inputs/merge-concepts/modules.map
  clang/test/Modules/Inputs/merge-concepts/same_as.h
  clang/test/Modules/merge-concepts.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128921.441407.patch
Type: text/x-patch
Size: 4009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220630/883c1329/attachment.bin>


More information about the cfe-commits mailing list