rsmith added inline comments.

================
Comment at: lib/Sema/SemaExprCXX.cpp:2661-2669
+    // If we're in local visibility mode, we reuse this allocation function
+    // in all submodules of the current module. To make sure that the other
+    // submodules can lookup this function, we unhide it and make sure it's
+    // not owned by the current submodule.
+    if (getLangOpts().ModulesLocalVisibility &&
+        !getLangOpts().CurrentModule.empty()) {
+      Alloc->setLocalOwningModule(nullptr);
----------------
Let's just unconditionally `setHidden(false)` and leave the owning module alone.

(On reflection, changing the owning module is problematic because we'll assert 
if the declaration is not already marked as hidden, which the above checks are 
not sufficient to ensure, and it doesn't seem necessary, since the owning 
module doesn't have any visibility impact if the declaration is not hidden.)

I'd also prefer to not restrict this to local visibility mode / to the case 
where we have a current module if we don't need to (and as far as I can tell, 
we shouldn't need to do so).


https://reviews.llvm.org/D33366



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to