Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprs
authorDaniel Jasper <djasper@google.com>
Mon, 27 Mar 2017 16:29:41 +0000 (16:29 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 27 Mar 2017 16:29:41 +0000 (16:29 +0000)
commit9c81a727eba60e6eece36e6e25ae76748c5f2a49
tree1958b144605fb75f040ebe72b485822352e4c9a2
parentc512d44845a52b4ade20e42365ffd83889e62f85
Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprs
for unused values.

This fixes a regression caused by r298676, where constructor calls to
classes with non-trivial dtor were marked as unused if the first
argument is an initializer list. This is inconsistent (as the test
shows) and also warns on a reasonbly common code pattern where people
just call constructors to create and immediately destroy an object.

llvm-svn: 298853
clang/lib/Sema/SemaStmt.cpp
clang/test/SemaCXX/warn-unused-value.cpp