Closed micahcc closed 4 years ago
Interesting. I wonder what would be the proper condition to use sized delete (because it works for me with clang version 9.0.1).
Before https://github.com/google/riegeli/commit/99f5a184a7f77655fef0d5c638cd8dded0ce1edf#diff-b84fe4b731725eecafb89bdc9a8646e7 (which started requiring C++14) sized delete was conditioned on #if __cpp_sized_deallocation || __GXX_DELETE_WITH_SIZE__
. Do you think this condition should be restored here?
So this fixes it:
diff --git a/.bazelrc b/.bazelrc
index 111ddba..2f5e3d6 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -4,6 +4,9 @@ build --cxxopt=-std=c++14
# Use old C++ ABI, required by TensorFlow dependency.
build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
+# clang-10 doesn't seem to enable this for c++14, so enable it
+build --cxxopt=-D__cpp_sized_deallocation=1
+
# Make Python protos faster by backing them with C++ protos.
build --define=use_fast_cpp_protos=true
But according to this, it should be enabled for -std=c++14
: https://en.cppreference.com/w/cpp/feature_test
https://reviews.llvm.org/D8467 suggests that sized deallocation might be disabled in C++14 mode.
https://github.com/cms-sw/cmsdist/pull/5113 suggests that an application might explicitly enable it with -fsized-deallocation
, but of course that is unwise to require in a library, especially as this is just an optimization.
I will make using sized deallocation conditional again, with the same guard as before.
Getting the following build error:
With clang-10
I'm getting the following error.
Probably because you specify the
--cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0