Looking at clang-5.0 release notes it says that "C++ coroutines TS has landed", and suggests to check out this example to get started. I obviously can run the example online, so I decided to try on my Ubuntu Server 16.04 Xenial machine.
From a clean installation, I just tried
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
sudo apt-get update
sudo apt-get install -y clang-5.0 libc++-dev
And went straight for
clang++-5.0 -Wall -Wextra -std=gnu++2a "-fcoroutines-ts" "-stdlib=libc++" -o test.out test.cpp
(test.cpp
being a copy-and-paste of the aforementioned example)
However, I just get
coroutines.cpp:2:10: fatal error: 'experimental/coroutine' file not found
#include <experimental/coroutine>
So I can imagine I am missing something, either to install or in the compilation flags. I tried to look online but I couldn't find anything useful.
What am I doing wrong?