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 |
|
|
|