mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 08:47:59 +00:00
cmStateSnapshot: CanPop* should be const
Checking if the policy/diagnostic stack is non-empty doesn't require a mutable state snapshot. Mark the relevant methods `const`.
This commit is contained in:
@@ -169,7 +169,7 @@ bool cmStateSnapshot::PopPolicy()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cmStateSnapshot::CanPopPolicyScope()
|
||||
bool cmStateSnapshot::CanPopPolicyScope() const
|
||||
{
|
||||
return this->Position->Policies != this->Position->PolicyScope;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ bool cmStateSnapshot::PopDiagnostic()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cmStateSnapshot::CanPopDiagnosticScope()
|
||||
bool cmStateSnapshot::CanPopDiagnosticScope() const
|
||||
{
|
||||
return this->Position->Diagnostics != this->Position->DiagnosticScope;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
bool parent_scope = false) const;
|
||||
void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
|
||||
bool PopPolicy();
|
||||
bool CanPopPolicyScope();
|
||||
bool CanPopPolicyScope() const;
|
||||
|
||||
void SetDiagnostic(cmDiagnostics::DiagnosticCategory category,
|
||||
cmDiagnostics::DiagnosticAction action, bool recursive);
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
}
|
||||
void PushDiagnostic(cmDiagnostics::DiagnosticMap entry, bool weak);
|
||||
bool PopDiagnostic();
|
||||
bool CanPopDiagnosticScope();
|
||||
bool CanPopDiagnosticScope() const;
|
||||
|
||||
cmState* GetState() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user