We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22fdc57 commit 59904d8Copy full SHA for 59904d8
clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp
@@ -58,10 +58,10 @@ getDerivedParameter(const ClassTemplateSpecializationDecl *CRTP,
58
Arg.getAsType()->getAsCXXRecordDecl() == Derived;
59
});
60
61
- return AnyOf ? CRTP->getSpecializedTemplate()
62
- ->getTemplateParameters()
63
- ->getParam(Idx - 1)
64
- : nullptr;
+ return AnyOf && Idx > 0 ? CRTP->getSpecializedTemplate()
+ ->getTemplateParameters()
+ ->getParam(Idx - 1)
+ : nullptr;
65
}
66
67
static std::vector<FixItHint>
0 commit comments