[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

Michael Benfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 29 16:49:14 PDT 2021


mbenfield added a comment.

In D100581#2727357 <https://reviews.llvm.org/D100581#2727357>, @dblaikie wrote:

> 



> Got a link/examples of cases GCC does and doesn't warn about? I'd assume it'd have something to do with the triviality or non-triviality of certain operations of the nonscalar types (eg: is the type trivially assignable/trivially destructible)

This doesn't seem to be what determines it. AFAICT it never warns for a struct in C++. However, if I do

  gcc -fsyntax-only -Wunused-but-set-variable clang/test/Sema/vector-gcc-compat.c

I get warnings for the variables v2i64_r and v4i32_r.

But if I do

  g++ -fsyntax-only -Wunused-but-set-variable clang/test/Sema/vector-gcc-compat.c

I only get warnings for the variable v2i64_r.

I will investigate a little more tomorrow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100581/new/

https://reviews.llvm.org/D100581



More information about the cfe-commits mailing list