Description of problem: Compiling a C++ program that includes <optional> yields a compile error with clang++. Version-Release number of selected component (if applicable): clang-4.0.0-3.fc26.x86_64 How reproducible: always Steps to Reproduce: 1. $ cat > test_optional.cc #include <optional> int main() { return 0; } 2. clang++ -std=c++1z test_optional.cc 3. Actual results: In file included from test_optional.cc:1: /usr/bin/../lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/optional:1032:27: error: use of class template 'optional' requires template arguments template <typename _Tp> optional(_Tp) -> optional<_Tp>; ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/optional:451:11: note: template is declared here class optional ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/optional:1032:40: error: expected ';' at end of declaration template <typename _Tp> optional(_Tp) -> optional<_Tp>; ^ /usr/bin/../lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/optional:1032:41: error: cannot use arrow operator on a type template <typename _Tp> optional(_Tp) -> optional<_Tp>; ^ 3 errors generated. Expected results: No compile errors, successful compilation. Additional info: It works with g++ as expected: $ g++ -std=c++1z test_optional.cc Apparently, the libstdc++ which is also used by Fedora's clang++ implements std::optional in a way that is not (yet) supported by clang. See also: https://bugs.archlinux.org/index.php?do=details&task_id=54276
Fedora 27 is also affected. clang-5 should fix the issue.
The issue is resolved in Fedora 27 by clang-5.0.0-1.fc27.x86_64 I don't see a clang 5 update for Fedora 26 at this time: https://koji.fedoraproject.org/koji/packageinfo?packageID=21848 So I'm afraid it's WONTFIX for Fedora 26.
Fixed in 5.0.0-1.fc27.