<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 12, 2015 at 9:14 PM, Richard Smith via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rsmith<br>
Date: Thu Nov 12 23:14:45 2015<br>
New Revision: 253012<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=253012&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=253012&view=rev</a><br>
Log:<br>
[modules] When a declaration has non-trivial visibility, check whether it's<br></blockquote><div><br></div><div>What is "non-trivial visibility"? Is this "visibility" something that exists in the present C++ language? (e.g. `using namespace std` etc.) or is this a different notion?</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
actually hidden before we check its linkage. This avoids computing the linkage<br>
"too early" for an anonymous struct with a typedef name for linkage.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Sema/Lookup.h<br>
    cfe/trunk/test/Modules/submodule-visibility.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Lookup.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=253012&r1=253011&r2=253012&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=253012&r1=253011&r2=253012&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Lookup.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Lookup.h Thu Nov 12 23:14:45 2015<br>
@@ -303,8 +303,7 @@ public:<br>
     if (!D->isInIdentifierNamespace(IDNS))<br>
       return nullptr;<br>
<br>
-    if (!D->isHidden() || isHiddenDeclarationVisible(D) ||<br>
-        isVisibleSlow(getSema(), D))<br>
+    if (isVisible(getSema(), D) || isHiddenDeclarationVisible(D))<br>
       return D;<br>
<br>
     return getAcceptableDeclSlow(D);<br>
<br>
Modified: cfe/trunk/test/Modules/submodule-visibility.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/submodule-visibility.cpp?rev=253012&r1=253011&r2=253012&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/submodule-visibility.cpp?rev=253012&r1=253011&r2=253012&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Modules/submodule-visibility.cpp (original)<br>
+++ cfe/trunk/test/Modules/submodule-visibility.cpp Thu Nov 12 23:14:45 2015<br>
@@ -28,3 +28,10 @@ int k = n + m; // OK, a and b are visibl<br>
 #ifndef B<br>
 #error B is not defined<br>
 #endif<br>
+<br>
+// Ensure we don't compute the linkage of this struct before we find it has a<br>
+// typedef name for linkage purposes.<br>
+typedef struct {<br>
+  int p;<br>
+  void (*f)(int p);<br>
+} name_for_linkage;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>