]> granicus.if.org Git - clang/commit
Implement P1771
authorErich Keane <erich.keane@intel.com>
Thu, 25 Jul 2019 15:10:56 +0000 (15:10 +0000)
committerErich Keane <erich.keane@intel.com>
Thu, 25 Jul 2019 15:10:56 +0000 (15:10 +0000)
commit609d9a60a793588b1602d49e1e710f73d70fe465
treee47fbc40303658595e3c0670c792a4c702637475
parenta6c6faa2b4d8a96dc6a383e93e61a4fd27eb8140
Implement P1771

As passed in the Cologne meeting and treated by Core as a DR,
[[nodiscard]] was applied to constructors so that they can be diagnosed
in cases where the user forgets a variable name for a type.

The intent is to enable the library to start using this on the
constructors of scope_guard/lock_guard.

Differential Revision: https://reviews.llvm.org/D64914

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367027 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/AST/Expr.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaStmt.cpp
test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p2.cpp
test/Preprocessor/has_attribute.cpp
www/cxx_status.html