Change in -Werror behavior in clang 14?

I happened to come across a small behavior change for -Werror in clang 14. If you have a command line like this

clang -Werror -Wno-error=unused-variable -Wunused-variable test.c

In clang 13 and below, -Wunused-variable is an error in this case (I guess because the -Wno-error only applies to warnings enabled earlier on the command line). In clang 14, -Wno-error takes effect for -Wunused-variable.

Can reproduce here: Compiler Explorer

I was wondering if this was intentional (I didn’t track down a specific commit that changed it). Just curious, I guess it’s debatable which behavior is preferable :slight_smile:

I think this was changed for https://github.com/llvm/llvm-project/issues/51179 (although that didn’t explicitly mention this effect). The new behavior also matches GCC.