<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks, that matches our observations.<div><br></div><div>Ken</div><div><br><div><div>On 2020-06-09, at 11:40 AM, Louis Dionne wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks for the heads up. I think the availability markup was too stringent.<div class=""><br class=""></div><div class=""><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">commit 7fb40e1569dd66292b647f4501b85517e9247953</span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">Author: Louis Dionne <<a href="mailto:ldionne@apple.com" class="">ldionne@apple.com</a>></span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">Date:   Tue Jun 9 14:08:55 2020 -0400</span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">    [libc++] Fix too stringent availability markup for bad_optional_access</span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">    The availability markup for bad_optional_access marked it as being added</span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">    in MacOS 10.14 and aligned releases, however it appears to have been added</span></font></div><div class=""><font face="Monaco" class=""><span style="font-style: normal;" class="">    in Mac OS 10.13 and aligned releases.</span></font></div><div class=""><br class=""></div><div class="">LMK if that fixes your issue.</div><div class=""><br class=""></div><div class="">Louis</div><div><br class=""><blockquote type="cite" class=""><div class="">On May 31, 2020, at 01:53, Ken Cunningham via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">On MacPorts we have users with 10.13 systems who want to build c++17-requiring  software like mkvtoolnix, and others.</div><div class=""><br class=""></div><div class="">This presently fails on these systems due std:optional::value being listed as unavailable in their libcxx:</div><div class=""><br class=""></div><div class=""><br class=""></div>currently std::optional::value is marked as unavailable on 10.13 by the __config settings in the libc++ headers:<div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.899999618530273px; margin-top: 0px; margin-bottom: 16px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46);" class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class="">#  define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS                             \
     __attribute__((availability(macosx,strict,introduced=10.14)))             \
     __attribute__((availability(ios,strict,introduced=12.0)))                 \
     __attribute__((availability(tvos,strict,introduced=12.0)))                \
     __attribute__((availability(watchos,strict,introduced=5.0)))</code></pre><div class="">however, the symbol seems to have been added to the libc++.dylib on 10.13</div></div><div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.899999618530273px; margin-top: 0px; margin-bottom: 16px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46);" class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class="">$ nm /usr/lib/libc++.1.dylib | grep optional
0000000000014fc6 T __ZNKSt19bad_optional_access4whatEv
0000000000014fe8 T __ZNSt12experimental19bad_optional_accessD0Ev
0000000000014fde T __ZNSt12experimental19bad_optional_accessD1Ev
0000000000014fd4 T __ZNSt12experimental19bad_optional_accessD2Ev
0000000000014faa T __ZNSt19bad_optional_accessD0Ev
0000000000014fa0 T __ZNSt19bad_optional_accessD1Ev
0000000000014f96 T __ZNSt19bad_optional_accessD2Ev
0000000000057750 S __ZTINSt12experimental19bad_optional_accessE
0000000000057790 S __ZTISt19bad_optional_access
0000000000051850 S __ZTSNSt12experimental19bad_optional_accessE
0000000000051880 S __ZTSSt19bad_optional_access
0000000000057720 S __ZTVNSt12experimental19bad_optional_accessE
0000000000057768 S __ZTVSt19bad_optional_access

$ c++filt  __ZNSt19bad_optional_accessD0Ev
std::bad_optional_access::~bad_optional_access()
</code></pre></div><div class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class=""><br class=""></code></div><div class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class="">and simple test apps do link and run (when built with clang-7.0, that is not so rigorous about excluding std::optional::value</code></div><div class=""><code style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class=""><br class=""></code></div><div class=""><code style="box-sizing: border-box; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class=""><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class=""><br class=""></font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">#include <optional></font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">#include <iostream></font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class=""><br class=""></font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">struct Foo { int bar; };</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class=""><br class=""></font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">int main() {</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">    Foo foo;</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">    std::optional<Foo> opt = foo;</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">    opt.value().bar = 42;</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">    std::cout << opt.value().bar << std::endl;</font></div><div class=""><font face="SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace" class="">}</font></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class=""><br class=""></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class=""><br class=""></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class="">I assume this change in libc++.dylib on 10.13 was recently added in some update and just hadn’t percolated through to the llvm source tree, and I was planning to patch the __config headers we install from libcxx-8.0 and libcxx-9.0 with clang-8.0 and clang-9.0 to allow this.</div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class=""><br class=""></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class="">Is there some other aspect to this issue I might be overlooking?</div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class=""><br class=""></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class="">Best,</div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class=""><br class=""></div><div style="font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;" class="">Ken</div></code></div></div>_______________________________________________<br class="">libcxx-dev mailing list<br class=""><a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a><br class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br></div></body></html>