On 17/09/18 21:55 +0300, Ville Voutilainen wrote:
On Mon, 17 Sep 2018 at 21:50, Jonathan Wakely <jwak...@redhat.com> wrote:
>"I used C++11 syntax because I find it nicer, and the compiler accepts
>it in C++98 mode with just a warning, suppressed in a standard
>header."

Oh sorry, I just looked at the patch and replied without reading the
top bit.

>Even with -Wsystem-headers I don't get a warning, I have to precompile
>with -P -E then compile the result to get "warning: extended
>initializer lists only available with -std=c++11 or -std=gnu++11".

OK for trunk then.

Do other compilers besides gcc suppress the same way?

No, clang doesn't:

In file included from bv.cc:1:
In file included from 
/home/jwakely/gcc/latest/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../include/c++/9.0.0/vector:65:
/home/jwakely/gcc/latest/lib/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_bvector.h:812:16:
 error: non-aggregate type 'std::vector<bool, type-parameter-0-0>::iterator' 
(aka 'std::_Bit_iterator') cannot be initialized with an initializer list
     { return { this->_M_impl._M_start, 0 }; }
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bv.cc:6:5: note: in instantiation of member function 'std::vector<bool, 
std::allocator<bool> >::begin' requested here
 b.begin();
   ^
1 error generated.

So I do think we should stick to C++98 syntax.

Reply via email to