#1133608 protobuf: ftbfs with GCC-16

#1133608#5
Date:
2026-04-13 13:09:55 UTC
From:
To:
Hi,

protobuf fails to build in a test rebuild on at least amd64 and arm64 with
gcc-16/g++-16, but builds properly with gcc-15/g++-15. The severity of this
report will be raised before the forky release.

The full build log can be found at:
https://people.debian.org/~ema/gcc-16-rebuilds/output-1/protobuf_arm64.build.xz

The last lines of the build log are at the end of this report.

To build with GCC 16, either set CC=gcc-16 CXX=g++-16 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++

Common build failures include unused (but set) variables, array subscripts
partly outside array bounds, and new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-16/porting_to.html

Please only close this issue after double-checking that the package can be
built correctly with GCC 16.

Please do not reassign this bug to another package. If a fix in another package
is required, then file a bug for the other package (or clone), and mark this
bug as blocked by the bug in the other package.

[...]


/usr/include/gmock/gmock-matchers.h:3979:35: error: template argument 1 is invalid [-Wtemplate-body]
 3979 |   std::vector<std::remove_const_t<T>> matchers_;
      |                                   ^
/usr/include/gmock/gmock-matchers.h:3979:35: error: template argument 2 is invalid [-Wtemplate-body]
/usr/include/gmock/gmock-matchers.h:3979:36: error: expected unqualified-id before ‘>’ token [-Wtemplate-body]
 3979 |   std::vector<std::remove_const_t<T>> matchers_;
      |                                    ^~
/usr/include/gmock/gmock-matchers.h: In constructor ‘testing::internal::UnorderedElementsAreArrayMatcher<T>::UnorderedElementsAreArrayMatcher(testing::internal::UnorderedMatcherRequire::Flags, Iter, Iter)’:
/usr/include/gmock/gmock-matchers.h:3968:36: error: class ‘testing::internal::UnorderedElementsAreArrayMatcher<T>’ does not have any field named ‘matchers_’ [-Wtemplate-body]
 3968 |       : match_flags_(match_flags), matchers_(first, last) {}
      |                                    ^~~~~~~~~
/usr/include/gmock/gmock-matchers.h: In member function ‘testing::internal::UnorderedElementsAreArrayMatcher<T>::operator testing::Matcher<T>() const’:
/usr/include/gmock/gmock-matchers.h:3974:27: error: ‘matchers_’ was not declared in this scope; did you mean ‘Matcher’? [-Wtemplate-body]
 3974 |             match_flags_, matchers_.begin(), matchers_.end()));
      |                           ^~~~~~~~~
      |                           Matcher
/usr/include/gmock/gmock-matchers.h: At global scope:
/usr/include/gmock/gmock-matchers.h:4000:26: error: ‘remove_const_t’ is not a member of ‘std’; did you mean ‘remove_const’? [-Wtemplate-body]
 4000 |   const std::vector<std::remove_const_t<T>> matchers_;
      |                          ^~~~~~~~~~~~~~
      |                          remove_const
/usr/include/gmock/gmock-matchers.h:4000:26: error: ‘remove_const_t’ is not a member of ‘std’; did you mean ‘remove_const’? [-Wtemplate-body]
 4000 |   const std::vector<std::remove_const_t<T>> matchers_;
      |                          ^~~~~~~~~~~~~~
      |                          remove_const
/usr/include/gmock/gmock-matchers.h:4000:41: error: template argument 1 is invalid [-Wtemplate-body]
 4000 |   const std::vector<std::remove_const_t<T>> matchers_;
      |                                         ^
/usr/include/gmock/gmock-matchers.h:4000:41: error: template argument 2 is invalid [-Wtemplate-body]
/usr/include/gmock/gmock-matchers.h:4000:42: error: expected unqualified-id before ‘>’ token [-Wtemplate-body]
 4000 |   const std::vector<std::remove_const_t<T>> matchers_;
      |                                          ^~
/usr/include/gmock/gmock-matchers.h: In constructor ‘testing::internal::ElementsAreArrayMatcher<T>::ElementsAreArrayMatcher(Iter, Iter)’:
/usr/include/gmock/gmock-matchers.h:3987:52: error: class ‘testing::internal::ElementsAreArrayMatcher<T>’ does not have any field named ‘matchers_’ [-Wtemplate-body]
 3987 |   ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
      |                                                    ^~~~~~~~~
/usr/include/gmock/gmock-matchers.h: In member function ‘testing::internal::ElementsAreArrayMatcher<T>::operator testing::Matcher<T>() const’:
/usr/include/gmock/gmock-matchers.h:3996:9: error: ‘matchers_’ was not declared in this scope; did you mean ‘Matcher’? [-Wtemplate-body]
 3996 |         matchers_.begin(), matchers_.end()));
      |         ^~~~~~~~~
      |         Matcher
/usr/include/gmock/gmock-matchers.h: At global scope:
/usr/include/gmock/gmock-matchers.h:5012:52: error: ‘remove_const_t’ is not a member of ‘std’; did you mean ‘remove_const’?
 5012 |                                   std::vector<std::remove_const_t<T>>>
      |                                                    ^~~~~~~~~~~~~~
      |                                                    remove_const
/usr/include/gmock/gmock-matchers.h:5012:52: error: ‘remove_const_t’ is not a member of ‘std’; did you mean ‘remove_const’?
 5012 |                                   std::vector<std::remove_const_t<T>>>
      |                                                    ^~~~~~~~~~~~~~
      |                                                    remove_const
/usr/include/gmock/gmock-matchers.h:5012:67: error: template argument 1 is invalid
 5012 |                                   std::vector<std::remove_const_t<T>>>
      |                                                                   ^
/usr/include/gmock/gmock-matchers.h:5012:67: error: template argument 2 is invalid
/usr/include/gmock/gmock-matchers.h:5012:68: error: template argument 2 is invalid
 5012 |                                   std::vector<std::remove_const_t<T>>>
      |                                                                    ^~
/usr/include/gmock/gmock-matchers.h:5012:70: error: expected unqualified-id before ‘>’ token
 5012 |                                   std::vector<std::remove_const_t<T>>>
      |                                                                      ^
make[4]: *** [Makefile:6478: google/protobuf/compiler/cpp/protobuf_test-unittest.o] Error 1
make[4]: Leaving directory '/build/reproducible-path/protobuf-3.21.12/src'
make[3]: *** [Makefile:8466: check-am] Error 2
make[3]: Leaving directory '/build/reproducible-path/protobuf-3.21.12/src'
make[2]: *** [Makefile:1762: check-recursive] Error 1
make[2]: Leaving directory '/build/reproducible-path/protobuf-3.21.12'
dh_auto_test: error: make -j128 check TESTSUITEFLAGS="-j128 --verbose" VERBOSE=1 returned exit code 2
make[1]: *** [debian/rules:104: override_dh_auto_test-arch] Error 25
make[1]: Leaving directory '/build/reproducible-path/protobuf-3.21.12'
make: *** [debian/rules:26: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2