Comments (14)
Sorry for the silence on this. I'm slightly wary about this because a couple reasons
First, some of the people working on migrating google3 to c++17 have expressed some slight misgivings about it. Second, because, even though we don't really support it, this is potentially a break for use of abseil functions with ADL for a change which is, ideally otherwise invisible to the user and adds a corner case to the story of Abseil's handling of c++ versions. I agree with your sentiment that this is more an extension than some kind of non-conforming break, but seeing that string_view is a fairly simple type, I'm not sure the small risk is worth the payoff for this. But I'm definitely open to being convinced.
from abseil-cpp.
@mclow @derekmauro @rogeeff Should be careful about __has_include
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433
https://bugs.chromium.org/p/chromium/issues/detail?id=759349&desc=2
from abseil-cpp.
@atkawa7 IIRC, the bug is about using libstdc++ with -std=<version older than c++17>. Since we are also checking __cplusplus >= 201703L, the bug should NOT be a concern.
from abseil-cpp.
@zhangxy988 See google/crc32c@d0f929a
from abseil-cpp.
@atkawa7 The commit seems strange to me: the bug in the original code is in #if !defined(_MSC_VER) || __cplusplus >= 201703L
which is ignoring the __cplusplus >= 201703L
check on any non MSVC compiler (GCC, Clang), and this should be fixed as #if !defined(_MSC_VER) && __cpluscplus >= 201703L
(or simply #if __cplusplus >= 201703L
since _MSC_VER set __cpluscplus to 199711).
So, I don't think this has anything to do with the GCC bug.
from abseil-cpp.
@zhangxy988 They are two different bugs but similar. So should be careful
from abseil-cpp.
This is really about libc++, yes? So really we just want to check for libc++, and handle the msvc and libstdc++ cases separately.
According to this stackoverflow we can do this by something like
#include <ciso646>
// ...
#ifdef _LIBCPP_VERSION
#define ABSL_HAVE_STD_STRING_VIEW 1
#else
// ...
@mclow is this a reasonable idea?
from abseil-cpp.
Almost - you still have to check for the existence of the <string_view> header. Old versions of libc++ didn't have this. but if the header is there, then you have string_view
from abseil-cpp.
@mclow @JonathanDCohen Alternatively (if you don't have __has_include
, but you should), you could probably check that _LIBCPP_VERSION >= 4000
.
from abseil-cpp.
Maybe if you don't have __has_include
maybe you should just fail (and say "no std::string_view
)
from abseil-cpp.
Sorry for the silence here. I've had this sitting around internally for a bit, and there's some concern that libc++ backporting string_view is technically non-conforming, and could be surprising w.r.t. ADL. We also have to take a look at our FDO profiles before landing this as this would potentially change the mangled symbol names for anything taking a string_view
from abseil-cpp.
I think that "non-conforming" is a bit harsh. It's an extension, like marking the default constructor of vector
as noexcept
.
from abseil-cpp.
After some more discussions on this, I'm going to close this issue. It's tempting but there are other internal migration factors which this seems to complicate, and the payoff for it is fairly low. Thank you for the idea, though :) Please feel free to re-open if you feel this is a poor decision.
from abseil-cpp.
but there are other internal migration factors which this seems to complicate, and the payoff for it is fairly low.
Those are pretty hard for me to comment on (not being internal).
Please feel free to re-open if you feel this is a poor decision.
I'm not going to contest.
from abseil-cpp.
Related Issues (20)
- [Bug]: inlined_vector implicitly assumes Pointer<A> is a native pointer type
- [Bug]: missing Mutex::Dtor on linux? HOT 17
- [Bug]: Parameter pack workaround fails with nvcc HOT 17
- [Bug]: Missing constructor for `absl::synchronization_internal::KernelTimeout` in shared builds HOT 5
- [Bug]: Constexpr expansion compilation error with GCC's UndefinedBehaviorSanitizer HOT 5
- [Bug]: internal/hash.h failed to compile in C++17 on GCC 7 HOT 1
- [Bug]: -Wmaybe-uninitialized warnings in InlinedVector
- [Bug]: Proto_library fails to build with abseil-cpp version = "20240116.0" HOT 2
- [Bug]: Unusable for installable projects whose other dependencies also define a `check` target HOT 3
- Resolving linking order is a nightmare on alpine HOT 4
- mismatched types โabsl::lts_2020_09_23::FormatSpec<Args ...>โ and โconst char [34]โ HOT 1
- [Bug]: Compilation error on mac: xcode command line interface 15.3
- [Bug]: Make absl::InitializeLog safe to be called multiple times
- [Bug]: Cant compile app on windows with MinGW that use Absl::Flags target.
- [Bug]: Can't build on macOS: `'linux/futex.h' file not found`
- [Bug]: new flat_hash_map to empty string could cause memory corruption in c++20 HOT 7
- GCC 14: abseil-src/absl/numeric/internal/bits.h:309:24: error: '__builtin_ctzs' needs isa option -mbmi HOT 1
- [Bug]: arm_neon.h inclusion causing issues HOT 2
- [CMake]: Could not find a configuration file for package "absl" that is compatible with requested version ""
- [Bug]: clang-analyzer-optin.core.EnumCastOutOfRange for static_cast<ctrl_t>(0) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abseil-cpp.