On Thu, Dec 15, 2022 at 04:01:33PM +0100, Thomas Schwinge wrote: > Or, options are applicable to just one front end, and can just be a no-op > for others, for shared-language compilation. For example, '-nostdinc++', > or '-frust-incomplete-and-experimental-compiler-do-not-use' need not > necessarily emit a diagnostic, but can just just be ignored by 'cc1', > 'f951', 'lto1'.
One simple change could be to add a new warning option and use it for complain_wrong_lang warnings: else if (ok_langs[0] != '\0') /* Eventually this should become a hard error IMO. */ warning (0, "command-line option %qs is valid for %s but not for %s", text, ok_langs, bad_lang); else /* Happens for -Werror=warning_name. */ warning (0, "%<-Werror=%> argument %qs is not valid for %s", text, bad_lang); We could keep the existing behavior, but give users (and our testsuite) a way to silence that warning if they are ok with it applying only to a subset of languages. Then one could use -frust-incomplete-and-experimental-compiler-do-not-use -Wno-whatever or add that -Wno-whatever in check_compile if the snippet is different language from main language of the testsuite (or always) etc. Jakub