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

Method getSpecializations

lib/templatesimplifier.cpp:3521–3540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3519}
3520
3521void TemplateSimplifier::getSpecializations()
3522{
3523 // try to locate a matching declaration for each user defined specialization
3524 for (const auto& spec : mTemplateDeclarations) {
3525 if (spec.isSpecialization()) {
3526 auto it = std::find_if(mTemplateDeclarations.cbegin(), mTemplateDeclarations.cend(), [&](const TokenAndName& decl) {
3527 return specMatch(spec, decl);
3528 });
3529 if (it != mTemplateDeclarations.cend())
3530 mTemplateSpecializationMap[spec.token()] = it->token();
3531 else {
3532 it = std::find_if(mTemplateForwardDeclarations.cbegin(), mTemplateForwardDeclarations.cend(), [&](const TokenAndName& decl) {
3533 return specMatch(spec, decl);
3534 });
3535 if (it != mTemplateForwardDeclarations.cend())
3536 mTemplateSpecializationMap[spec.token()] = it->token();
3537 }
3538 }
3539 }
3540}
3541
3542void TemplateSimplifier::getPartialSpecializations()
3543{

Callers

nothing calls this directly

Calls 3

specMatchFunction · 0.85
isSpecializationMethod · 0.80
tokenMethod · 0.80

Tested by

no test coverage detected