We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1b019f9 + acfbb0f commit 288e191Copy full SHA for 288e191
clang-tools-extra/clang-tidy/bsl/NonSafeIntegralTypesAreForbiddenCheck.cpp
@@ -134,6 +134,16 @@ void NonSafeIntegralTypesAreForbiddenCheck::check_field_decl(const MatchFinder::
134
if (Record->isStruct())
135
return;
136
137
+ auto const *DC = Record->getParent();
138
+ while (!isa<TranslationUnitDecl>(Decl::castFromDeclContext(DC))) {
139
+ if (const auto *Rec = dyn_cast<RecordDecl>(DC)) {
140
+ if (Rec->isStruct()) {
141
+ return;
142
+ }
143
144
+ DC = DC->getParent();
145
146
+
147
auto const QT = FD->getType().getNonReferenceType().getCanonicalType().getUnqualifiedType();
148
if (!QT->isIntegerType())
149
0 commit comments