lib/Sema/SemaDeclAttr.cpp
static bool threadSafetyCheckIsPointer(Sema &S, const Decl *D,
                                       const ParsedAttr &AL) {
  const auto *VD = cast<ValueDecl>(D);
  QualType QT = VD->getType();
  if (QT->isAnyPointerType())
    return true;

  if (const auto *RT = QT->getAs<RecordType>()) {
    // If it's an incomplete type, it could be a smart pointer; skip it.
    // (We don't want to force template instantiation if we can avoid it,
    // since that would alter the order in which templates are instantiated.)
    if (RT->isIncompleteType())
      return true;

    if (threadSafetyCheckIsSmartPointer(S, RT))
      return true;
  }

  S.Diag(AL.getLoc(), diag::warn_thread_attribute_decl_not_pointer) << AL << QT;
  return false;
}
/// Check if passed in Decl is a pointer type.
/// Note that this function may produce an error message.
/// \return true if the Decl is a pointer type; false otherwise
Check if passed in Decl is a pointer type.
Note that this function may produce an error message.
\return true if the Decl is a pointer type; false otherwise
Check if passed in Decl is a pointer type . Note that this function may produce an error message . \ return true if the Decl is a pointer type ; false otherwise
static bool threadSafetyCheckIsPointer(Sema &S, const Decl *D,
                                       const ParsedAttr &AL) {
  const auto *VD = cast<ValueDecl>(D);
  QualType QT = VD->getType();
  if (QT->isAnyPointerType())
    return true;
  if (const auto *RT = QT->getAs<RecordType>()) {
    if (RT->isIncompleteType())
      return true;
    if (threadSafetyCheckIsSmartPointer(S, RT))
      return true;
  }
  S.Diag(AL.getLoc(), diag::warn_thread_attribute_decl_not_pointer) << AL << QT;
  return false;
}
static bool threadSafetyCheckIsPointer ( Sema & S , const Decl * D , const ParsedAttr & AL ) { const auto * VD = cast < ValueDecl > ( D ) ; QualType QT = VD -> getType ( ) ; if ( QT -> isAnyPointerType ( ) ) return true ; if ( const auto * RT = QT -> getAs < RecordType > ( ) ) { if ( RT -> isIncompleteType ( ) ) return true ; if ( threadSafetyCheckIsSmartPointer ( S , RT ) ) return true ; } S . Diag ( AL . getLoc ( ) , diag :: warn_thread_attribute_decl_not_pointer ) << AL << QT ; return false ; }
Check if passed in Decl is a pointer type.
Check if passed in Decl is a pointer type .
// If it's an incomplete type, it could be a smart pointer; skip it. // (We don't want to force template instantiation if we can avoid it, // since that would alter the order in which templates are instantiated.)