Fix 'unqualified call to std::move' errors in clang 15+

This commit is contained in:
Konstantinos Margaritis
2023-10-03 20:24:39 +03:00
parent 4918f81ea3
commit 0d2f9ccbaa
37 changed files with 224 additions and 224 deletions

View File

@@ -103,7 +103,7 @@ void ComponentAlternation::accept(ConstComponentVisitor &v) const {
}
void ComponentAlternation::append(unique_ptr<Component> component) {
children.emplace_back(move(component));
children.emplace_back(std::move(component));
}
vector<PositionInfo> ComponentAlternation::first() const {

View File

@@ -50,7 +50,7 @@ ComponentCondReference::ComponentCondReference(const string &name)
: kind(CONDITION_NAME), ref_id(0), ref_name(name), hasBothBranches(false) {}
ComponentCondReference::ComponentCondReference(unique_ptr<Component> c)
: kind(CONDITION_ASSERTION), ref_id(0), assertion(move(c)),
: kind(CONDITION_ASSERTION), ref_id(0), assertion(std::move(c)),
hasBothBranches(false) {}
ComponentCondReference::~ComponentCondReference() {}

View File

@@ -60,7 +60,7 @@ static constexpr u32 MAX_POSITIONS_EXPANDED = 500000; // arbitrarily huge
* extent is effectively zero. */
ComponentRepeat::ComponentRepeat(unique_ptr<Component> sub_comp_in, u32 min,
u32 max, enum RepeatType t)
: type(t), sub_comp(move(sub_comp_in)), m_min(min), m_max(max),
: type(t), sub_comp(std::move(sub_comp_in)), m_min(min), m_max(max),
posFirst(GlushkovBuildState::POS_UNINITIALIZED),
posLast(GlushkovBuildState::POS_UNINITIALIZED) {
assert(sub_comp);
@@ -361,7 +361,7 @@ void ComponentRepeat::postSubNotePositionHook() {
unique_ptr<ComponentRepeat> makeComponentRepeat(unique_ptr<Component> sub_comp,
u32 min, u32 max,
ComponentRepeat::RepeatType t) {
return std::make_unique<ComponentRepeat>(move(sub_comp), min, max, t);
return std::make_unique<ComponentRepeat>(std::move(sub_comp), min, max, t);
}
} // namespace ue2

View File

@@ -116,7 +116,7 @@ void ComponentSequence::accept(ConstComponentVisitor &v) const {
}
void ComponentSequence::addComponent(unique_ptr<Component> comp) {
children.emplace_back(move(comp));
children.emplace_back(std::move(comp));
}
bool ComponentSequence::addRepeat(u32 min, u32 max,
@@ -131,7 +131,7 @@ bool ComponentSequence::addRepeat(u32 min, u32 max,
return false;
}
children.back() = makeComponentRepeat(move(children.back()), min, max,
children.back() = makeComponentRepeat(std::move(children.back()), min, max,
type);
assert(children.back());
return true;
@@ -144,14 +144,14 @@ void ComponentSequence::addAlternation() {
auto seq = std::make_unique<ComponentSequence>();
seq->children.swap(children);
alternation->append(move(seq));
alternation->append(std::move(seq));
}
void ComponentSequence::finalize() {
if (alternation) {
addAlternation();
assert(children.empty());
children.emplace_back(move(alternation));
children.emplace_back(std::move(alternation));
alternation = nullptr;
}
}

View File

@@ -163,7 +163,7 @@ ComponentSequence *enterSequence(ComponentSequence *parent,
assert(child);
ComponentSequence *seq = child.get();
parent->addComponent(move(child));
parent->addComponent(std::move(child));
return seq;
}
@@ -175,7 +175,7 @@ void addLiteral(ComponentSequence *currentSeq, char c, const ParseMode &mode) {
assert(cc);
cc->add(c);
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
} else {
currentSeq->addComponent(getLiteralComponentClass(c, mode.caseless));
}
@@ -190,7 +190,7 @@ void addEscaped(ComponentSequence *currentSeq, unichar accum,
assert(cc);
cc->add(accum);
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
} else {
if (accum > 255) {
throw LocatedParseError(err_msg);
@@ -330,7 +330,7 @@ unichar readUtf8CodePoint4c(const char *s) {
PUSH_SEQUENCE;
auto seq = std::make_unique<ComponentSequence>();
seq->setCaptureIndex(groupIndex++);
currentSeq = enterSequence(currentSeq, move(seq));
currentSeq = enterSequence(currentSeq, std::move(seq));
}
# enter a NAMED CAPTURING group ( e.g. (?'<hatstand>blah) )
@@ -347,7 +347,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto seq = std::make_unique<ComponentSequence>();
seq->setCaptureIndex(groupIndex++);
seq->setCaptureName(label);
currentSeq = enterSequence(currentSeq, move(seq));
currentSeq = enterSequence(currentSeq, std::move(seq));
}
# enter a NON-CAPTURING group where we're modifying flags
@@ -724,7 +724,7 @@ unichar readUtf8CodePoint4c(const char *s) {
([^^] ${ fhold; fcall readUCP; })
'}' ${ if (!inCharClass) { // not inside [..]
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
})
@@ -735,7 +735,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_C, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -743,7 +743,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_L, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -751,7 +751,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_M, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -759,7 +759,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_N, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -767,7 +767,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_P, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -775,7 +775,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_S, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -783,7 +783,7 @@ unichar readUtf8CodePoint4c(const char *s) {
currentCls->add(CLASS_UCP_Z, negated);
if (!inCharClass) {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
}
fret;
};
@@ -1106,7 +1106,7 @@ unichar readUtf8CodePoint4c(const char *s) {
']' => {
currentCls->finalize();
currentSeq->addComponent(move(currentCls));
currentSeq->addComponent(std::move(currentCls));
inCharClass = false;
fgoto main;
};
@@ -1163,7 +1163,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint2c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
utf8_3c when is_utf8 => {
@@ -1172,7 +1172,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint3c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
utf8_4c when is_utf8 => {
@@ -1181,7 +1181,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint4c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
hi_byte when is_utf8 => {
@@ -1618,52 +1618,52 @@ unichar readUtf8CodePoint4c(const char *s) {
# Word character
'\\w' => {
auto cc = generateComponent(CLASS_WORD, false, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Non word character
'\\W' => {
auto cc = generateComponent(CLASS_WORD, true, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Whitespace character
'\\s' => {
auto cc = generateComponent(CLASS_SPACE, false, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Non whitespace character
'\\S' => {
auto cc = generateComponent(CLASS_SPACE, true, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Digit character
'\\d' => {
auto cc = generateComponent(CLASS_DIGIT, false, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Non digit character
'\\D' => {
auto cc = generateComponent(CLASS_DIGIT, true, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Horizontal whitespace
'\\h' => {
auto cc = generateComponent(CLASS_HORZ, false, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Not horizontal whitespace
'\\H' => {
auto cc = generateComponent(CLASS_HORZ, true, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Vertical whitespace
'\\v' => {
auto cc = generateComponent(CLASS_VERT, false, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
# Not vertical whitespace
'\\V' => {
auto cc = generateComponent(CLASS_VERT, true, mode);
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
'\\p{' => {
@@ -1787,7 +1787,7 @@ unichar readUtf8CodePoint4c(const char *s) {
ComponentAssertion *a_seq = a.get();
PUSH_SEQUENCE;
currentSeq = enterSequence(currentSeq,
std::make_unique<ComponentCondReference>(move(a)));
std::make_unique<ComponentCondReference>(std::move(a)));
PUSH_SEQUENCE;
currentSeq = a_seq;
};
@@ -1798,7 +1798,7 @@ unichar readUtf8CodePoint4c(const char *s) {
ComponentAssertion *a_seq = a.get();
PUSH_SEQUENCE;
currentSeq = enterSequence(currentSeq,
std::make_unique<ComponentCondReference>(move(a)));
std::make_unique<ComponentCondReference>(std::move(a)));
PUSH_SEQUENCE;
currentSeq = a_seq;
};
@@ -1809,7 +1809,7 @@ unichar readUtf8CodePoint4c(const char *s) {
ComponentAssertion *a_seq = a.get();
PUSH_SEQUENCE;
currentSeq = enterSequence(currentSeq,
std::make_unique<ComponentCondReference>(move(a)));
std::make_unique<ComponentCondReference>(std::move(a)));
PUSH_SEQUENCE;
currentSeq = a_seq;
};
@@ -1820,7 +1820,7 @@ unichar readUtf8CodePoint4c(const char *s) {
ComponentAssertion *a_seq = a.get();
PUSH_SEQUENCE;
currentSeq = enterSequence(currentSeq,
std::make_unique<ComponentCondReference>(move(a)));
std::make_unique<ComponentCondReference>(std::move(a)));
PUSH_SEQUENCE;
currentSeq = a_seq;
};
@@ -1861,7 +1861,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint2c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
utf8_3c when is_utf8 => {
@@ -1870,7 +1870,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint3c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
utf8_4c when is_utf8 => {
@@ -1879,7 +1879,7 @@ unichar readUtf8CodePoint4c(const char *s) {
auto cc = getComponentClass(mode);
cc->add(readUtf8CodePoint4c(ts));
cc->finalize();
currentSeq->addComponent(move(cc));
currentSeq->addComponent(std::move(cc));
};
hi_byte when is_utf8 => {
@@ -2024,7 +2024,7 @@ unique_ptr<Component> parse(const char *ptr, ParseMode &globalMode) {
// Ensure that all references are valid.
checkReferences(*rootSeq, groupIndex, groupNames);
return move(rootSeq);
return std::move(rootSeq);
} catch (LocatedParseError &error) {
if (ts >= ptr && ts <= pe) {
error.locate(ts - ptr);