gcc diagnostic bug ?

François Dumont frs.dumont@gmail.com
Thu Jan 4 21:12:00 GMT 2018


On 15/12/2017 03:20, Jonathan Wakely wrote:
> FAIL: 23_containers/vector/cons/destructible_neg.cc  (test for errors, line 35)
> FAIL: 23_containers/vector/cons/destructible_neg.cc  (test for errors, line 41)

I had a look at this remaining issue. The compilation result is:

In file included from 
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_tempbuf.h:60,
                  from 
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:62,
                  from 
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/algorithm:62,
                  from 
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/stdc++.h:65,
                  from <command-line>:0:
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_construct.h: 
In instantiation of 'void std::_Destroy(_ForwardIterator, 
_ForwardIterator) [with _ForwardIterator = DeletedDtor*]':
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_construct.h:206: 
required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, 
std::allocator<_T2>&) [with _ForwardIterator = DeletedDtor*; _Tp = 
DeletedDtor]'
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_vector.h:612: 
required from 'std::__cxx1998::vector<_Tp, _Alloc>::~vector() [with _Tp 
= DeletedDtor; _Alloc = std::allocator<DeletedDtor>]'
/home/fdt/dev/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/debug/vector:155: 
required from here

The code at debug/vector:155 is:

       vector() = default;

So no trace of a call to the ~std::__cxx1998::vector<> at that point.

I guess gcc tries to instantiate the destructor when generating the 
default vector constructor but IMO it shouldn't be visible in the 
compilation error message.

Should we report this as a gcc bug ?

François



More information about the Gcc mailing list