[libcxx-commits] [PATCH] D147560: [libc++] Fix std::optional-related type deduction

Ian McKellar via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 4 16:40:31 PDT 2023


ianloic marked 2 inline comments as done.
ianloic added a comment.

In D147560#4244469 <https://reviews.llvm.org/D147560#4244469>, @philnik wrote:

> This changes behaviour, in a not necessarily conforming way. I don't know why other standard library implementations accept your construct while libc++ doesn't, but this is definitely not the right fix. Interestingly, implementing the constructor yourself works with one standard but not the other: https://godbolt.org/z/GKKGP46fs, and both bug reports use `std::string`. Maybe there lies the real issue? You should probably reduce the reproducer further to find out where the problem actually is.

I can make a test-case without `std::string`: https://godbolt.org/z/Edr58onYP
but I'm still working on understanding more deeply what's going on with it. I'm trying to reduce the std::optional implementation to find where it's really going wrong.



================
Comment at: libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ambigous_constructor.pass.cpp:19-20
+
+using std::optional;
+using std::string;
+
----------------
philnik wrote:
> Please don't use `using` in the tests.
No worries, I was copying the style of a neighboring test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147560



More information about the libcxx-commits mailing list