Author: Chaoshuai Lu
Date: 2022-01-24T14:52:57-08:00
New Revision: f1c9e7bdc921cec0cc3f61c19c4ac4a7f1bd8525

URL: 
https://github.com/llvm/llvm-project/commit/f1c9e7bdc921cec0cc3f61c19c4ac4a7f1bd8525
DIFF: 
https://github.com/llvm/llvm-project/commit/f1c9e7bdc921cec0cc3f61c19c4ac4a7f1bd8525.diff

LOG: [ObjC Availability] Add missing const to getVersion function of 
ObjCAvailabilityCheckExpr class

Add missing const to `getVersion` function of `ObjCAvailabilityCheckExpr` class.

This feels like a bug on the original change D22171. We cannot really call this 
function from a const object pointer because the function is not marked as 
const.

This diff adds the missing const specifier to fix the issue.

Reviewed By: manmanren

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

Added: 
    

Modified: 
    clang/include/clang/AST/ExprObjC.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/ExprObjC.h 
b/clang/include/clang/AST/ExprObjC.h
index b0f057dbaa02f..3b7ad8662ad95 100644
--- a/clang/include/clang/AST/ExprObjC.h
+++ b/clang/include/clang/AST/ExprObjC.h
@@ -1706,7 +1706,7 @@ class ObjCAvailabilityCheckExpr : public Expr {
 
   /// This may be '*', in which case this should fold to true.
   bool hasVersion() const { return !VersionToCheck.empty(); }
-  VersionTuple getVersion() { return VersionToCheck; }
+  VersionTuple getVersion() const { return VersionToCheck; }
 
   child_range children() {
     return child_range(child_iterator(), child_iterator());


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to