@@ -261,16 +261,12 @@ template <typename T> static bool isRecordWithAttr(QualType Type) {
261261 RD = CTSD->getSpecializedTemplate ()->getTemplatedDecl ();
262262 return RD->hasAttr <T>();
263263}
264- } // namespace clang::sema
265264
266- namespace clang {
267- bool Sema::isPointerLikeType (QualType QT) {
268- return sema::isRecordWithAttr<PointerAttr>(QT) || QT->isPointerType () ||
265+ bool isPointerLikeType (QualType QT) {
266+ return isRecordWithAttr<PointerAttr>(QT) || QT->isPointerType () ||
269267 QT->isNullPtrType ();
270268}
271- } // namespace clang
272269
273- namespace clang ::sema {
274270// Decl::isInStdNamespace will return false for iterators in some STL
275271// implementations due to them being defined in a namespace outside of the std
276272// namespace.
@@ -298,7 +294,7 @@ static bool isContainerOfPointer(const RecordDecl *Container) {
298294 return false ;
299295 const auto &TAs = CTSD->getTemplateArgs ();
300296 return TAs.size () > 0 && TAs[0 ].getKind () == TemplateArgument::Type &&
301- Sema:: isPointerLikeType (TAs[0 ].getAsType ());
297+ isPointerLikeType (TAs[0 ].getAsType ());
302298 }
303299 return false ;
304300}
@@ -322,7 +318,7 @@ static bool isStdInitializerListOfPointer(const RecordDecl *RD) {
322318 return isInStlNamespace (RD) && RD->getIdentifier () &&
323319 RD->getName () == " initializer_list" && TAs.size () > 0 &&
324320 TAs[0 ].getKind () == TemplateArgument::Type &&
325- Sema:: isPointerLikeType (TAs[0 ].getAsType ());
321+ isPointerLikeType (TAs[0 ].getAsType ());
326322 }
327323 return false ;
328324}
@@ -338,7 +334,7 @@ static bool shouldTrackImplicitObjectArg(const CXXMethodDecl *Callee) {
338334 Callee->getFunctionObjectParameterType ()) &&
339335 !isRecordWithAttr<OwnerAttr>(Callee->getFunctionObjectParameterType ()))
340336 return false ;
341- if (Sema:: isPointerLikeType (Callee->getReturnType ())) {
337+ if (isPointerLikeType (Callee->getReturnType ())) {
342338 if (!Callee->getIdentifier ())
343339 return false ;
344340 return llvm::StringSwitch<bool >(Callee->getName ())
@@ -1446,7 +1442,7 @@ checkExprLifetimeImpl(Sema &SemaRef, const InitializedEntity *InitEntity,
14461442 break ;
14471443 }
14481444 case LK_LifetimeCapture: {
1449- if (Sema:: isPointerLikeType (Init->getType ()))
1445+ if (isPointerLikeType (Init->getType ()))
14501446 Path.push_back ({IndirectLocalPathEntry::GslPointerInit, Init});
14511447 break ;
14521448 }
0 commit comments