From e4323bf1923fd9ecbb609449d3fa15f2128c5eb2 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 2 May 2020 21:18:42 +0000 Subject: [PATCH] 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. --- SConstruct | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 16ce259f7..2704c2be7 100644 --- a/SConstruct +++ b/SConstruct @@ -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.