Bug 249538 - Missing C++ header experimental/optional in 12
Summary: Missing C++ header experimental/optional in 12
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 12.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-23 03:25 UTC by Yuri Victorovich
Modified: 2020-10-29 19:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2020-09-23 03:25:32 UTC
The C++ reference website
* https://en.cppreference.com/w/cpp/experimental/optional
* https://en.cppreference.com/w/cpp/utility/optional

says that
1. std::experimental::optional is defined in the header <experimental/optional> before c++17
2, std::optional is defined in the header <optional> since c++17.

The experimental/optional header is missing in 12.2-STABLE r365688 and 
> #include <experimental/optional>
> 
> typedef std::experimental::optional<int> x;

fails to compile with -std=c++14, or any other flags.


This causes the port graphics/py-open3d-python r507372 failure: http://beefy6.nyi.freebsd.org/data/121amd64-default/548931/logs/errors/py37-open3d-python-0.2_4.log
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2020-10-29 19:25:04 UTC
The experimental headers are named "experimental", because they can change, or be removed, at *any* time, and developers are not allowed to rely on them explicitly.

Upstream only provides these temporarily as a way to experiment with new features before they are finalized, but software should never be shipped if it has a hard dependency on them.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2020-10-29 19:55:20 UTC
(In reply to Dimitry Andric from comment #1)

I was under the impression that 'experimental' headers are equally defined in the C++ standard, and on https://en.cppreference.com/, with the difference that they are renamed, removed, or redesigned in later standard revisions. This is why they are documented on https://en.cppreference.com/ like any permanent C++ feature.

And you are saying that 'experimental' are optional altogether and can be missing entirely.


Yuri