Bugzilla – Bug 1225536
latest ICU headers fails when compiling against them:
Last modified: 2024-05-28 21:05:00 UTC
https://build.opensuse.org/package/live_build_log/home:darix:apps/rubygem-charlock_holmes/openSUSE_Tumbleweed/x86_64 ``` compiling transliterator.cpp cc1plus: warning: command-line option ‘-std=gnu99’ is valid for C/ObjC but not for C++ In file included from /usr/include/unicode/unistr.h:39, from /usr/include/unicode/translit.h:27, from transliterator.cpp:5: /usr/include/unicode/stringpiece.h:133:29: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type 133 | typename = std::enable_if_t< | ^~~~~~~~~~~ /usr/include/unicode/stringpiece.h:133:24: note: ‘std::enable_if_t’ is only available from C++14 onwards 133 | typename = std::enable_if_t< | ^~~ /usr/include/unicode/stringpiece.h:133:40: error: expected ‘>’ before ‘<’ token 133 | typename = std::enable_if_t< | ^ In file included from /usr/include/unicode/uenum.h:25, from /usr/include/unicode/utrans.h:22, from /usr/include/unicode/translit.h:29: /usr/include/unicode/localpointer.h:561:26: error: parameter declared ‘auto’ 561 | template <typename Type, auto closeFunction> | ^~~~ /usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid 573 | explicit LocalOpenPointer(std::unique_ptr<Type, decltype(closeFunction)> &&p) | ^ /usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid 583 | LocalOpenPointer &operator=(std::unique_ptr<Type, decltype(closeFunction)> &&p) { | ^ /usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid 599 | operator std::unique_ptr<Type, decltype(closeFunction)> () && { | ^ /usr/include/unicode/uenum.h:69:1: note: invalid template non-type parameter 69 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/unicode/uset.h:358:1: note: invalid template non-type parameter 358 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/unicode/utrans.h:258:1: note: invalid template non-type parameter 258 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close); ```
I guess the problem is here that the build process sets -std=c99?
even with -std=c++14 it fails: ``` g++ -I. -I/usr/include/ruby-3.3.0/x86_64-linux-gnu -I/usr/include/ruby-3.3.0/ruby/backward -I/usr/include/ruby-3.3.0 -I. -DHAVE_UNICODE_UCNV_H -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -fPIC -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -std=c++14 -o transliterator.o -c transliterator.cpp In file included from /usr/include/unicode/unistr.h:39, from /usr/include/unicode/translit.h:27, from transliterator.cpp:5: /usr/include/unicode/stringpiece.h:134:23: error: 'is_same_v' is not a member of 'std'; did you mean 'is_same'? 134 | (std::is_same_v<decltype(T().data()), const char*> | ^~~~~~~~~ | is_same /usr/include/unicode/stringpiece.h:134:66: error: template argument 1 is invalid 134 | (std::is_same_v<decltype(T().data()), const char*> | ^ /usr/include/unicode/stringpiece.h:138:17: error: expected '>' before ')' token 138 | ) && | ^ /usr/include/unicode/stringpiece.h:138:17: error: expected unqualified-id before ')' token In file included from /usr/include/unicode/uenum.h:25, from /usr/include/unicode/utrans.h:22, from /usr/include/unicode/translit.h:29: /usr/include/unicode/localpointer.h:561:26: error: 'auto' parameter not permitted in this context 561 | template <typename Type, auto closeFunction> | ^~~~ /usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid 573 | explicit LocalOpenPointer(std::unique_ptr<Type, decltype(closeFunction)> &&p) | ^ /usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid 583 | LocalOpenPointer &operator=(std::unique_ptr<Type, decltype(closeFunction)> &&p) { | ^ /usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid 599 | operator std::unique_ptr<Type, decltype(closeFunction)> () && { | ^ /usr/include/unicode/uenum.h:69:1: note: invalid template non-type parameter 69 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/unicode/uset.h:358:1: note: invalid template non-type parameter 358 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUSetPointer, USet, uset_close); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/unicode/utrans.h:258:1: note: invalid template non-type parameter 258 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUTransliteratorPointer, UTransliterator, utrans_close); ```
it builds with -std=gnu++17 or =c++17
need to work a bit on the mkmf pkg_config function