summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-unused-value.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprsDaniel Jasper2017-03-271-0/+6
| | | | | | | | | | | | 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
* Lit C++11 Compatibility Patch #8Charles Li2016-04-141-1/+6
| | | | | | 24 tests have been updated for C++11 compatibility. llvm-svn: 266387
* Volatile reads are side-effecting operations, but in the general case of ↵Aaron Ballman2015-01-031-3/+4
| | | | | | | | | | | access through a volatile-qualified type, we're not certain of the underlying object's side-effects on access. Treat volatile accesses as "maybe" instead of "definite" side effects for the purposes of warning on evaluations in an unevaluated context. No longer diagnose on idiomatic code like: int * volatile v; (void)sizeof(*v); llvm-svn: 225116
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-171-3/+30
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* Sema: Reject templates in all extern "C" contexts.Benjamin Kramer2014-02-021-1/+1
| | | | | | | Otherwise we'd accept them if the LinkageDecl was not the direct parent DeclContext. PR17968. llvm-svn: 200641
* report unused-value warning also for warn_unused typesLubos Lunak2013-07-211-0/+20
| | | | llvm-svn: 186793
* Add a warning to diagnose statements in C++ like "*(volatile int*)x;". ↵Eli Friedman2012-05-241-1/+1
| | | | | | Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>. llvm-svn: 157362
* When emitting a diagnostic about two-phase name lookup, don't do uselessNick Lewycky2012-03-141-0/+19
| | | | | | qualified name lookups into transparent contexts. llvm-svn: 152739
* Fix a QoI bug with overloaded operators inside macros.Matt Beaumont-Gay2011-09-191-0/+15
| | | | | | | | We were failing to set source locations and ranges in isUnusedResultAWarning for CXXOperatorCallExprs, leading to an "expression result unused" warning with absolutely no context if the expression was inside a macro. llvm-svn: 140036
* Improve the unused-value check to look into comma expressions and filter outJohn McCall2010-03-121-0/+17
voids in sub-expressions. Patch by Mike M! Fixes PR4806. llvm-svn: 98335
OpenPOWER on IntegriCloud