]> granicus.if.org Git - clang/commit
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)
commit75f794b36977628281921472eaf4bc63d9cb336c
tree64749b2b91d56aff80d86947dea59a50a27ee068
parent35e89432a6e23c582fb17636ef4908a022964b2e
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298853 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaStmt.cpp
test/SemaCXX/warn-unused-value.cpp