MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getPartialSpecializations

Method getPartialSpecializations

lib/templatesimplifier.cpp:3542–3561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3540}
3541
3542void TemplateSimplifier::getPartialSpecializations()
3543{
3544 // try to locate a matching declaration for each user defined partial specialization
3545 for (const auto& spec : mTemplateDeclarations) {
3546 if (spec.isPartialSpecialization()) {
3547 auto it = std::find_if(mTemplateDeclarations.cbegin(), mTemplateDeclarations.cend(), [&](const TokenAndName& decl) {
3548 return specMatch(spec, decl);
3549 });
3550 if (it != mTemplateDeclarations.cend())
3551 mTemplatePartialSpecializationMap[spec.token()] = it->token();
3552 else {
3553 it = std::find_if(mTemplateForwardDeclarations.cbegin(), mTemplateForwardDeclarations.cend(), [&](const TokenAndName& decl) {
3554 return specMatch(spec, decl);
3555 });
3556 if (it != mTemplateForwardDeclarations.cend())
3557 mTemplatePartialSpecializationMap[spec.token()] = it->token();
3558 }
3559 }
3560 }
3561}
3562
3563void TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues()
3564{

Callers

nothing calls this directly

Calls 3

specMatchFunction · 0.85
tokenMethod · 0.80

Tested by

no test coverage detected