abseil/abseil-cpp

VolatilePtrLogFormatTest fails under C++23

Opened this issue · 1 comments

Describe the issue

$ bin/Release/absl_log_format_test --gtest_filter=VolatilePtrLogFormatTest/0.NonNull
Running main() from googletest/src/gtest_main.cc
Note: Google Test filter = VolatilePtrLogFormatTest/0.NonNull
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from VolatilePtrLogFormatTest/0, where TypeParam = void volatile*
[ RUN      ] VolatilePtrLogFormatTest/0.NonNull
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1699920227.656907 3611696 log_format_test.cc:709] 0xdeadbeef
absl/log/scoped_mock_log.cc:39: Failure
Mock function called more times than expected - returning directly.
    Function call: Log(INFO, @0x7ffd462f56f0 "absl/log/log_format_test.cc", @0x7ffd462f5710 "0xdeadbeef")
         Expected: to be never called
           Actual: called once - over-saturated and active
absl/log/log_format_test.cc:701: Failure
Actual function call count doesn't match EXPECT_CALL(test_sink, Send(AllOf(TextMessage(MatchesOstream(comparison_stream)), TextMessage(Eq("true")), ::testing::_)))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
[  FAILED  ] VolatilePtrLogFormatTest/0.NonNull, where TypeParam = void volatile* (0 ms)
[----------] 1 test from VolatilePtrLogFormatTest/0 (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] VolatilePtrLogFormatTest/0.NonNull, where TypeParam = void volatile*

 1 FAILED TEST

Steps to reproduce the problem

  set(CMAKE_CXX_STANDARD 23)

What version of Abseil are you using?

v20230802.1

What operating system and version are you using?

Linux cctrd270-01 5.15.0-82-generic #91-Ubuntu SMP Mon Aug 14 14:14:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

What compiler and version are you using?

g++ (GCC) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What build system are you using?

cmake version 3.27.7

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Additional context

Compare: https://gcc.godbolt.org/z/ETb6Wzj7E

This is https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html - I don't think there is a feature test macro for this, so a fix will have to check __cplusplus. However, e.g. gcc 11.2 has -std=c++23 but does not implement p1147r1, and both gcc 11.2 and gcc 11.3 set __cplusplus to 202100, so I suppose both possibilities will need to be supported.

clang 17.0.6 has the same problem.