r342950 - Annotate LookupResult::clear() as LLVM_ATTRIBUTE_REINITIALIZES to silence bugprone-use-after-move after rC342925

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 25 01:07:42 PDT 2018


Author: maskray
Date: Tue Sep 25 01:07:42 2018
New Revision: 342950

URL: http://llvm.org/viewvc/llvm-project?rev=342950&view=rev
Log:
Annotate LookupResult::clear() as LLVM_ATTRIBUTE_REINITIALIZES to silence bugprone-use-after-move after rC342925

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

Modified:
    cfe/trunk/include/clang/Sema/Lookup.h

Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=342950&r1=342949&r2=342950&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Tue Sep 25 01:07:42 2018
@@ -540,7 +540,7 @@ public:
   }
 
   /// Clears out any current state.
-  void clear() {
+  LLVM_ATTRIBUTE_REINITIALIZES void clear() {
     ResultKind = NotFound;
     Decls.clear();
     if (Paths) deletePaths(Paths);




More information about the cfe-commits mailing list