[PATCH] D29550: Diagnose when "future_error(error_code)" constructor is called by user code

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 4 14:44:33 PST 2017


EricWF created this revision.

The constructor `future_error(error_code)` isn't part of the C++ standard, but libc++ provides it in order to construct `future_error`'s before C++17.
However since it's non-standard we probably shouldn't be providing it all. We could make the constructor private but I suspect users already depend
on this extension. Instead this patch does the following:

1. Make it explicit so it doesn't cause weird implicit conversion bugs.
2. Generate a warning when the constructor is called from user code.
3. Cleanup tests that depend on the constructor.

@mclow.lists thoughts on handling this?


https://reviews.llvm.org/D29550

Files:
  docs/UsingLibcxx.rst
  include/__config
  include/future
  test/libcxx/thread/futures/futures.future_error/diagnose_extended_constructor.fail.cpp
  test/libcxx/thread/futures/futures.future_error/extended_constructor.pass.cpp
  test/std/thread/futures/futures.future_error/code.pass.cpp
  test/std/thread/futures/futures.future_error/what.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29550.87115.patch
Type: text/x-patch
Size: 7726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170204/3f7d0106/attachment.bin>


More information about the cfe-commits mailing list