[PATCH] D128328: [C++20][Modules] Improve handing of Private Module Fragment diagnostics.

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 21 19:17:43 PDT 2022


ChuanqiXu added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:1262
+        if (auto *FDD = FD->getDefinition()) {
+          DefInPMF = FDD->getOwningModule()->isPrivateModule();
+          if (!DefInPMF)
----------------
iains wrote:
> ChuanqiXu wrote:
> > nit:
> (I added this one)
> I wonder if we could try to reduce the number of asserts included by considering making a test-case to cover the condition that is of concern - since most devs build with assertions enabled, we should ensure that they are only covering some case we really cannot test directly.
> 
I think the test cases and assertion are not conflicted with each other. For example, when I made a change and a test case fails, I may spent a lot of time to locate the problem. But if the assertion fails, I will get the problem more quickly. And for the specific case, it looks like not easy to construct a test case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128328/new/

https://reviews.llvm.org/D128328



More information about the cfe-commits mailing list