rsmith marked an inline comment as done.
rsmith added inline comments.

================
Comment at: clang/lib/AST/Decl.cpp:897-898
+    // Fall through.
+    // FIXME: Should GUIDs receive hidden visibility? We give them DSO-local
+    // linkage in CodeGen.
+
----------------
rnk wrote:
> I suppose the answer is yes, it can be hidden. One cannot write a Windows app 
> that expects `&__uuidof(Foo)` to be the same across DSOs. Hopefully we don't 
> have to aim for compatibility to some compiler that targets ELF and supports 
> uuids.
I've not made this change for now. The patch as-is matches our former behavior, 
and it's far from obvious to me whether
```
template<const GUID&> void f() {}
f<__uuidof(x)>();
```
... should create a template instantiation with hidden visibility. For what 
it's worth, the variables we create for these `GUID` objects are `dso_local` 
and `linkonce_odr` but not `hidden`, which seems a little fishy to me. (We 
expose the symbol to other DSOs but never consume the symbol from other DSOs.) 
We could probably argue that that's "morally hidden"?

This is certainly easy to change if we think using default visibility is wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78171



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D78171: R... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D781... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D781... Reid Kleckner via Phabricator via cfe-commits
    • [PATCH] D781... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D781... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to