diff --git a/framaCIRGen_src/ClangVisitor.cpp b/framaCIRGen_src/ClangVisitor.cpp
index f1aa8285ccf3b72bcf73033e28cbe21d407fbf73..dc5ae3f6f6a50c8c1111f3a7cc9f7548085dde4b 100644
--- a/framaCIRGen_src/ClangVisitor.cpp
+++ b/framaCIRGen_src/ClangVisitor.cpp
@@ -1086,7 +1086,11 @@ exp_node FramacVisitor::makeNewExpression(
       expression exp_size_elt = expression_cons(copy_loc(loc), size_to_alloc);
       // length
       expression exp_length;
+#if CLANG_VERSION_MAJOR >= 15
+      if (!newExpr->getArraySize().has_value())
+#else
       if (!newExpr->getArraySize().hasValue())
+#endif
         exp_length = makeIntLiteral(copy_loc(loc), IINT, 0);
       else
         exp_length =
@@ -1118,7 +1122,11 @@ exp_node FramacVisitor::makeNewExpression(
       result = exp_node_Malloc(type->plain_type);
   } else {
       expression size;
+#if CLANG_VERSION_MAJOR >= 15
+      if (!newExpr->getArraySize().has_value())
+#else
       if (!newExpr->getArraySize().hasValue())
+#endif
         size = makeIntLiteral(makeLocation(newExpr->getSourceRange()), IINT, 0);
       else
         size =
@@ -1261,7 +1269,11 @@ exp_node FramacVisitor::makeNewExpression(
                 loopVariableAsExpr)));
         // length
         expression size =
+#if CLANG_VERSION_MAJOR >= 15
+          (!newExpr->getArraySize().has_value())
+#else
           (!newExpr->getArraySize().hasValue())
+#endif
             ? makeIntLiteral(copy_loc(loc), IINT, 0)
             : makeLocExpression(
                 *newExpr->getArraySize(),