GCC Code Coverage Report


Directory: ../
File: src/model/Struct.cpp
Date: 2024-11-22 23:10:59
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 2 2 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // Copyright (c) 2021-2024 ChilliBits. All rights reserved.
2
3 #include "Struct.h"
4
5 #include <ast/ASTNodes.h>
6
7 namespace spice::compiler {
8
9 /**
10 * Checks at least one field is a reference.
11 * This is used to prohibit constant instantiations.
12 *
13 * @return Has reference as field type or not
14 */
15 162 bool Struct::hasReferenceFields() const {
16 427 return std::ranges::any_of(fieldTypes, [](const QualType &fieldType) { return fieldType.isRef(); });
17 }
18
19 } // namespace spice::compiler
20