This revision was automatically updated to reflect the committed changes.
Closed by commit rL337394: [CodeComplete] Allow getDeclaration on RK_Pattern 
result. (authored by ioeric, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D49484

Files:
  cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h


Index: cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
===================================================================
--- cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
+++ cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
@@ -895,9 +895,11 @@
     computeCursorKindAndAvailability();
   }
 
-  /// Retrieve the declaration stored in this result.
+  /// Retrieve the declaration stored in this result. This might be nullptr if
+  /// Kind is RK_Pattern.
   const NamedDecl *getDeclaration() const {
-    assert(Kind == RK_Declaration && "Not a declaration result");
+    assert(((Kind == RK_Declaration) || (Kind == RK_Pattern)) &&
+           "Not a declaration or pattern result");
     return Declaration;
   }
 


Index: cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
===================================================================
--- cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
+++ cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
@@ -895,9 +895,11 @@
     computeCursorKindAndAvailability();
   }
 
-  /// Retrieve the declaration stored in this result.
+  /// Retrieve the declaration stored in this result. This might be nullptr if
+  /// Kind is RK_Pattern.
   const NamedDecl *getDeclaration() const {
-    assert(Kind == RK_Declaration && "Not a declaration result");
+    assert(((Kind == RK_Declaration) || (Kind == RK_Pattern)) &&
+           "Not a declaration or pattern result");
     return Declaration;
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to