Fix gcc-7 build

The existing test for gcc pr #82541 was insufficient, and allowed using
-Wduplicated-branches with gcc-7 in some cases it should not.  Extend
the test to cover these cases.
This commit is contained in:
Kp 2020-05-02 21:18:42 +00:00
parent f0a47c358b
commit e4323bf192

View file

@ -2756,7 +2756,12 @@ unsigned u2(bool b)
Compile = self.Compile
Link = self.Link
f, desc = (Link, 'linker') if ldopts else (Compile, 'compiler')
if f(context, text=_text, main='', msg='whether %s accepts preferred options' % desc, successflags={'CXXFLAGS' : ccopts, 'LINKFLAGS' : ldopts}, calling_function='preferred_%s_options' % desc):
if f(context, text=_text, main='''
using gcc_pr82541::u2;
u2(false);
u2(true);
u2(argc > 2);
''', msg='whether %s accepts preferred options' % desc, successflags={'CXXFLAGS' : ccopts, 'LINKFLAGS' : ldopts}, calling_function='preferred_%s_options' % desc):
# Everything is supported. Skip individual tests.
return
# Compiler+linker together failed. Check if compiler alone will work.