The bug is originally observed by andy on keyutils-1.6.3 at https://bugs.gentoo.org/764371. There build system checks own headers for valid syntax. The minimal reproducer is (original uses real .h header file, possibly to make sure C header is parsed correctly as valid C++): ```shell $ g++-10.2.0 -x c++-header -fsyntax-only /dev/null <ok> $ g++-11.0.0 -x c++-header -fsyntax-only /dev/null cc1plus: error: output filename specified twice ```
Thanks for the report. Started with Nathan's r11-5615-g10ee6da64c574947.
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>: https://gcc.gnu.org/g:492b90f33dfb37576dc7ae424d67b2be8b959bf2 commit r11-6724-g492b90f33dfb37576dc7ae424d67b2be8b959bf2 Author: Nathan Sidwell <nathan@acm.org> Date: Fri Jan 15 08:48:54 2021 -0800 c++: Fix langspecs with -fsyntax-only [PR98591] -fsyntax-only is handled specially in the driver and causes it to add '-o /dev/null' (or a suitable OS-specific variant thereof). PCH is handled in the language driver. I'd not sufficiently protected the -fmodule-only action of adding a dummy assembler from the actions of -fsyntax-only, so we ended up with two -o options. PR c++/98591 gcc/cp/ * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
492b90f33df 2021-01-15 | c++: Fix langspecs with -fsyntax-only [PR98591]