Author: Timm Bäder
Date: 2023-07-04T16:16:17+02:00
New Revision: 1c8c5a89c59cee16d6500a4e83c8c29b8a4a37a4

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

LOG: [clang][Interp][NFC] Merge two if statements

Added: 
    

Modified: 
    clang/lib/AST/Interp/Interp.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp
index f646e876554cad..d68accdf3bf850 100644
--- a/clang/lib/AST/Interp/Interp.cpp
+++ b/clang/lib/AST/Interp/Interp.cpp
@@ -296,12 +296,10 @@ bool CheckInit(InterpState &S, CodePtr OpPC, const 
Pointer &Ptr) {
 
 bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
 
-  if (F->isVirtual()) {
-    if (!S.getLangOpts().CPlusPlus20) {
-      const SourceLocation &Loc = S.Current->getLocation(OpPC);
-      S.CCEDiag(Loc, diag::note_constexpr_virtual_call);
-      return false;
-    }
+  if (F->isVirtual() && !S.getLangOpts().CPlusPlus20) {
+    const SourceLocation &Loc = S.Current->getLocation(OpPC);
+    S.CCEDiag(Loc, diag::note_constexpr_virtual_call);
+    return false;
   }
 
   if (!F->isConstexpr()) {


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

Reply via email to