On 10/1/24 5:41 AM, Jonathan Wakely wrote:
On Tue, 1 Oct 2024 at 07:53, Thomas Schwinge <[email protected]> wrote:

Hi!

When building libstdc++-v3 with '--enable-werror', the build currently fails:

     [...]
     In file included from 
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/functional:42,
                      from 
../../../../../source-gcc/libstdc++-v3/src/c++98/hash_tr1.cc:27:
     [...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/tuple:426:21: 
error: ‘std::tr1::{anonymous}::ignore’ defined but not used 
[-Werror=unused-variable]
       426 |     _Swallow_assign ignore;
           |                     ^~~~~~
     cc1plus: all warnings being treated as errors
     make[5]: *** [Makefile:658: hash_tr1.lo] Error 1
     [...]
     In file included from 
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/functional:42,
                      from 
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/rope:61,
                      from 
../../../../../source-gcc/libstdc++-v3/src/c++98/ext-inst.cc:29:
     [...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/tuple:426:21: 
error: ‘std::tr1::{anonymous}::ignore’ defined but not used 
[-Werror=unused-variable]
       426 |     _Swallow_assign ignore;
           |                     ^~~~~~
     cc1plus: all warnings being treated as errors
     make[5]: *** [Makefile:658: ext-inst.lo] Error 1
     make[5]: Target 'all' not remade because of errors.
     make[5]: Leaving directory 
'[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/src/c++98'
     [...]
     In file included from 
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/functional:42,
                      from 
../../../../../source-gcc/libstdc++-v3/src/c++11/cxx11-hash_tr1.cc:32:
     [...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/tr1/tuple:426:21: 
error: ‘std::tr1::{anonymous}::ignore’ defined but not used 
[-Werror=unused-variable]
       426 |     _Swallow_assign ignore;
           |                     ^~~~~~
     cc1plus: all warnings being treated as errors
     make[5]: *** [Makefile:681: cxx11-hash_tr1.lo] Error 1
     make[5]: Target 'all' not remade because of errors.
     make[5]: Leaving directory 
'[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11'
     [...]

Should we just mute this specific '-Wunused-variable', or (if that makes
any sense) apply to 'tr1/tuple' changes similar to the 'std/tuple' onces
of commit 1489e281b549af8a76a415556c07e147df933a44
'libstdc++: Implement P2968R2 "Making std::ignore a first-class object"'?
Doing just:

     -  // TODO: Put this in some kind of shared file.
     -  namespace
     -  {
     -    _Swallow_assign ignore;
     -  } // anonymous namespace
      }

      _GLIBCXX_END_NAMESPACE_VERSION

... is not sufficient:

     
[...]/source-gcc/libstdc++-v3/testsuite/tr1/6_containers/headers/tuple/types_std_tr1.cc:24:
 error: 'ignore' has not been declared in 'std::tr1'

Right, removing it isn't an option, it's a required API defined in the ISO TR.

Would it make sense to replace it with

using std::ignore;

?

Jason

Reply via email to