Kaydet (Commit) 6d57d6c4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Adapt lopluign:constparams to variadic CXXOperatorCallExpr

Change-Id: I21c7a0fb447b5ba0a7aa0ddc690b969b156a91f3
üst 9a81c693
......@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <algorithm>
#include <string>
#include <unordered_set>
#include <unordered_map>
......@@ -328,7 +329,10 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
if (operatorCallExpr->getArg(0) == stmt) {
return calleeMethodDecl->isConst();
}
for (unsigned i = 1; i < operatorCallExpr->getNumArgs(); ++i)
unsigned const n = std::min(
operatorCallExpr->getNumArgs(),
calleeMethodDecl->getNumParams());
for (unsigned i = 1; i < n; ++i)
if (operatorCallExpr->getArg(i) == stmt) {
return isPointerOrReferenceToConst(calleeMethodDecl->getParamDecl(i - 1)->getType());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment