Suppress -Wwarn-unused-variables when we don't know the constructor
authorErich Keane <erich.keane@intel.com>
Thu, 12 Dec 2019 19:27:10 +0000 (11:27 -0800)
committerErich Keane <erich.keane@intel.com>
Thu, 12 Dec 2019 19:34:17 +0000 (11:34 -0800)
commit654c0daef75a41eede06b413a5ecdd8ad2640240
tree05ffcdd2ce918fd567451ff12310b6eecb045394
parent61368c8e98c567fa76d45e8f928306db9d00dde2
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.
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaCXX/warn-unused-variables.cpp