Description:
Hi, I hope this is the right place to report a bug in the MySQL X DevAPI extension for PHP available at https://pecl.php.net/package/mysql_xdevapi
It requires C++14, but it fails to compile with some old C++14-compatible versions of Clang, such as those included in Xcode 7.2.1 and 8.2.1 (the latest versions compatible with OS X 10.10 and 10.11, respectively).
Here is a full build log:
https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/104573/steps/install...
But the relevant error is:
mysqlx_collection__modify.cc:343:26: error: default initialization of an object of const type 'const util::string_view' without a user-provided default constructor
const util::string_view Empty_doc_path;
^
{}
This Stack Overflow post explains that this was originally forbidden by the C++ standard. Clang enforced this; gcc did not. Later, the C++ standard was relaxed to allow this, and Clang was later updated.
https://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-con...
So... should this code be changed to respect the original restriction? Or should users be required to use a newer compiler that implements the revised standard?
How to repeat:
Compile on OS X 10.10 with clang from Xcode 6.3 or later up to 7.2.1, or on OS X 10.11 with clang from any supported Xcode version up to 8.2.1.
Suggested fix:
Possibly modify the code so it compiles on any C++14-compatible compiler.
And regardless of whether the code is changed, please document the compiler requirements, whatever they are, in the README; there's currently no mention even of requiring C++14 at all.