llvm-project/clang/test/CXX
Aaron Ballman fb6deeb984 Refactor the way we handle diagnosing unused expression results.
Rather than sprinkle calls to DiagnoseUnusedExprResult() around in places where we want diagnostics, we now diagnose unused expression statements and full expressions in a more generic way when acting on the final expression statement. This results in more appropriate diagnostics for [[nodiscard]] where we were previously lacking them, such as when the body of a for loop is not a compound statement.

This patch fixes PR39837.

llvm-svn: 350404
2019-01-04 16:58:14 +00:00
..
basic Restore pre-r335182 behavior for naming inherited constructors as 2018-06-22 19:50:19 +00:00
class Related to PR37768: improve diagnostics for class name shadowing. 2018-06-20 21:58:20 +00:00
class.access Diagnose invalid cv-qualifiers for friend decls. 2018-08-03 22:09:44 +00:00
class.derived [cxx2a] P0641R2: (Some) type mismatches on defaulted functions only 2018-09-28 01:16:43 +00:00
concepts-ts Remove old concepts parsing code 2017-12-07 00:34:20 +00:00
conv Specify an explicit underlying type for this enum to fix Windows 2018-06-29 20:41:23 +00:00
cpp/cpp.predefined P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we 2016-09-30 22:41:36 +00:00
dcl.dcl Diagnose an unused result from a call through a function pointer whose return type is marked [[nodiscard]]. 2019-01-03 14:24:31 +00:00
dcl.decl [cxx2a] P0641R2: (Some) type mismatches on defaulted functions only 2018-09-28 01:16:43 +00:00
drs [Sema] Produce diagnostics when C++17 aligned allocation/deallocation 2018-12-21 07:05:36 +00:00
except Revert "[CodeGenCXX] Treat 'this' as noalias in constructors" 2018-10-15 15:43:00 +00:00
expr P0859R0: List-initialization is potentially-constant-evaluated and 2018-09-26 04:36:55 +00:00
lex
modules-ts Bring r325915 back. 2018-02-23 19:30:48 +00:00
over DR1687: When overload resolution selects a built-in operator, implicit 2018-06-27 20:30:34 +00:00
special PR24164, PR39336: init-captures are not distinct full-expressions. 2018-10-19 19:01:34 +00:00
stmt.stmt Refactor the way we handle diagnosing unused expression results. 2019-01-04 16:58:14 +00:00
temp [NFC] Test commit: tweak whitespace in comment 2018-12-17 19:53:22 +00:00