Skip to content

Commit 01b39dd

Browse files
committed
Fix compilation error with gcc 11
error: loop variable 'verification_pair' creates a copy from type 'const std::pair<bool (*)(const jwt::claim&, void*), void*>' [-Werror=range-loop-construct]
1 parent 6b0cc40 commit 01b39dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scitokens_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class Validator {
390390
}
391391
}
392392
// std::cout << "Running claim " << claim_pair.first << " through validation." << std::endl;
393-
if (iter != m_validators.end()) for (const auto verification_func : iter->second) {
393+
if (iter != m_validators.end()) for (const auto &verification_func : iter->second) {
394394
const jwt::claim &claim = jwt.get_payload_claim(claim_pair.first);
395395
if (claim.get_type() != jwt::claim::type::string) {
396396
std::stringstream ss;
@@ -409,7 +409,7 @@ class Validator {
409409
}
410410
}
411411
}
412-
if (iter_claim != m_claim_validators.end()) for (const auto verification_pair : iter_claim->second) {
412+
if (iter_claim != m_claim_validators.end()) for (const auto &verification_pair : iter_claim->second) {
413413
const jwt::claim &claim = jwt.get_payload_claim(claim_pair.first);
414414
if (verification_pair.first(claim, verification_pair.second) == false) {
415415
std::stringstream ss;

0 commit comments

Comments
 (0)