Skip to content

Commit

Permalink
🚨🏁 address compiler warnings on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
  • Loading branch information
burgholzer committed Feb 4, 2025
1 parent 01c6a80 commit e7a8e15
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/mqt-core/qasm3/passes/TypeCheckPass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class TypeCheckPass final : public CompilerPass,
visitConstantExpression(std::shared_ptr<Constant> constantInt) override;
InferredType visitIdentifierExpression(
std::shared_ptr<IdentifierExpression> identifierExpression) override;
[[noreturn]] InferredType
InferredType
visitIdentifierList(std::shared_ptr<IdentifierList> identifierList) override;
InferredType visitMeasureExpression(
std::shared_ptr<MeasureExpression> measureExpression) override;
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/Grover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ auto appendGroverOracle(QuantumComputation& qc,
const GroverBitString& targetValue) -> void {
const auto nDataQubits = static_cast<Qubit>(qc.getNqubits() - 1);
Controls controls{};
for (std::size_t i = 0; i < nDataQubits; ++i) {
for (Qubit i = 0; i < nDataQubits; ++i) {
controls.emplace(i, targetValue.test(i) ? Control::Type::Pos
: Control::Type::Neg);
}
Expand Down
5 changes: 3 additions & 2 deletions src/ir/QuantumComputation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ void QuantumComputation::addQubitRegister(std::size_t nq,
"qubits have been added");
}

quantumRegisters.try_emplace(regName, nqubits, nq, regName);
quantumRegisters.try_emplace(regName, static_cast<Qubit>(nqubits), nq,
regName);
for (std::size_t i = 0; i < nq; ++i) {
auto j = static_cast<Qubit>(nqubits + i);
initialLayout.insert({j, j});
Expand Down Expand Up @@ -404,7 +405,7 @@ void QuantumComputation::addAncillaryRegister(std::size_t nq,
"[addAncillaryRegister] New register size must be larger than 0");
}

const auto totalqubits = nqubits + nancillae;
const auto totalqubits = static_cast<Qubit>(nqubits + nancillae);
ancillaRegisters.try_emplace(regName, totalqubits, nq, regName);
ancillary.resize(totalqubits + nq);
garbage.resize(totalqubits + nq);
Expand Down
2 changes: 1 addition & 1 deletion src/qasm3/passes/TypeCheckPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ InferredType TypeCheckPass::visitIdentifierExpression(
return type->second;
}

[[noreturn]] InferredType TypeCheckPass::visitIdentifierList(
InferredType TypeCheckPass::visitIdentifierList(
std::shared_ptr<IdentifierList> /*identifierList*/) {
throw TypeCheckError("TypeCheckPass::visitIdentifierList not implemented");
}
Expand Down
1 change: 0 additions & 1 deletion test/zx/test_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ TEST_F(ExpressionTest, Arithmetic) {
const auto beta = zx::PiRational(1, 2);

EXPECT_EQ(beta * 2, zx::PiRational(1, 1));
EXPECT_EQ(beta * 2., zx::PiRational(1, 1));

const auto betaExpr = zx::PiExpression{beta};
EXPECT_EQ(betaExpr * 2., zx::PiExpression{zx::PiRational(1, 1)});
Expand Down

0 comments on commit e7a8e15

Please sign in to comment.