After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793491 - Enable C++11 and C++14 when available
Enable C++11 and C++14 when available
Product: evolution-data-server
Classification: Platform
Component: general
3.27.x (obsolete)
Other FreeBSD
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Reported: 2018-02-15 18:25 UTC by Ting-Wei Lan
Modified: 2018-02-19 17:18 UTC
See Also:
GNOME target: ---
GNOME version: ---

Bug 793491 - Enable C++11 and C++14 when available (711 bytes, patch)
2018-02-15 18:30 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2018-02-15 18:25:44 UTC
This is not really a problem of evolution-data-server but an issue found after recent update of ICU. It seems that ICU 60 uses C++11 features in its headers, but the default compiler on FreeBSD, Clang 4, still uses C++98 by default. This causes error when compiling evolution-data-server:

[1/541] Building CXX object src/libedataserver/CMakeFiles/edataserver-private.dir/e-alphabet-index-private.cpp.o
FAILED: src/libedataserver/CMakeFiles/edataserver-private.dir/e-alphabet-index-private.cpp.o
/usr/bin/clang++  -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_10 -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_10 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_46 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DG_LOG_DOMAIN=\"e-data-server\" -DLDAP_DEPRECATED -DLIBEDATASERVER_COMPILATION -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_42 -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_42 -I. -Isrc -Isrc/libedataserver -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/home/lantw44/gnome/devinstall/include/libsecret-1 -I/usr/local/include/libxml2 -I/home/lantw44/gnome/devinstall/include/libsoup-2.4 -I/usr/local/include/nspr -I/usr/local/include/nss -I/usr/local/include/nss/nss -march=corei7 -B/home/lantw44/.local/bin -pipe -g3 -O0 -Werror-implicit-function-declaration -Wformat -Wformat-security -Winit-self -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -fno-strict-aliasing -Wno-deprecated-declarations -Wabi -fPIC   -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/home/lantw44/gnome/devinstall/include/libsecret-1 -I/usr/local/include/libxml2 -I/home/lantw44/gnome/devinstall/include/libsoup-2.4 -pthread -I/usr/local/include/nspr -I/usr/local/include/nss -I/usr/local/include/nss/nss -MD -MT src/libedataserver/CMakeFiles/edataserver-private.dir/e-alphabet-index-private.cpp.o -MF src/libedataserver/CMakeFiles/edataserver-private.dir/e-alphabet-index-private.cpp.o.d -o src/libedataserver/CMakeFiles/edataserver-private.dir/e-alphabet-index-private.cpp.o -c /home/lantw44/gnome/source/evolution-data-server/src/libedataserver/e-alphabet-index-private.cpp
In file included from /home/lantw44/gnome/source/evolution-data-server/src/libedataserver/e-alphabet-index-private.cpp:35:
In file included from /usr/local/include/unicode/alphaindex.h:18:
/usr/local/include/unicode/unistr.h:3014:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text)) {}
/usr/local/include/unicode/unistr.h:3076:7: error: delegating constructors are permitted only in C++11
      UnicodeString(ConstChar16Ptr(text), length) {}
/usr/local/include/unicode/unistr.h:3169:7: error: delegating constructors are permitted only in C++11
      UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
3 errors generated.
ninja: build stopped: subcommand failed.

Since evolution-data-server builds and works without problems in C++14 mode, can we ask cmake to enable C++11 or C++14 automatically when the compiler supports it?
Comment 1 Ting-Wei Lan 2018-02-15 18:30:15 UTC
Created attachment 368379 [details] [review]
Bug 793491 - Enable C++11 and C++14 when available
Comment 2 Milan Crha 2018-02-19 17:18:40 UTC
Thanks for a bug report and patch. I'm wondering whether using

   set_property(TARGET tgt PROPERTY CXX_STANDARD 11)

would make more sense, to influence only the library which uses ICU, but as this might not hurt and looks fine too, then lets use the same C++ standard for everything of CXX.

Created commit dbcd2a816 in eds master (3.27.92+)