[all-commits] [llvm/llvm-project] 654c0d: Suppress -Wwarn-unused-variables when we don't kno...
Erich Keane via All-commits
all-commits at lists.llvm.org
Thu Dec 12 11:36:28 PST 2019
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 654c0daef75a41eede06b413a5ecdd8ad2640240
https://github.com/llvm/llvm-project/commit/654c0daef75a41eede06b413a5ecdd8ad2640240
Author: Erich Keane <erich.keane at intel.com>
Date: 2019-12-12 (Thu, 12 Dec 2019)
Changed paths:
M clang/lib/Sema/SemaDecl.cpp
M clang/test/SemaCXX/warn-unused-variables.cpp
Log Message:
-----------
Suppress -Wwarn-unused-variables when we don't know the constructor
This warning is supposed to be suppressed when the
constructor/destructor are non-trivial, since it might be a RAII type.
However, if the type has a trivial destructor and the constructor hasn't
been resolved (since it is called with dependent arguments), we were
still warning.
This patch suppresses the warning if the type could possibly have a
be a non-trivial constructor call. Note that this does not take the
arity of the constructors into consideration, so it might suppress
the warning in cases where it isn't possible to call a non-trivial
constructor.
More information about the All-commits
mailing list