reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Sema/SemaDecl.cpp
11565   if (!VDecl) {
11573   if (VDecl->getType()->isUndeducedType()) {
11577     ExprResult Res = CorrectDelayedTyposInExpr(Init, VDecl);
11584     if (DeduceVariableDeclarationType(VDecl, DirectInit, Init))
11589   if (VDecl->hasAttr<DLLImportAttr>() && !VDecl->isStaticDataMember()) {
11589   if (VDecl->hasAttr<DLLImportAttr>() && !VDecl->isStaticDataMember()) {
11590     Diag(VDecl->getLocation(), diag::err_attribute_dllimport_data_definition);
11591     VDecl->setInvalidDecl();
11595   if (VDecl->isLocalVarDecl() && VDecl->hasExternalStorage()) {
11595   if (VDecl->isLocalVarDecl() && VDecl->hasExternalStorage()) {
11597     Diag(VDecl->getLocation(), diag::err_block_extern_cant_init);
11598     VDecl->setInvalidDecl();
11602   if (!VDecl->getType()->isDependentType()) {
11606     QualType BaseDeclType = VDecl->getType();
11609     if (RequireCompleteType(VDecl->getLocation(), BaseDeclType,
11616     if (RequireNonAbstractType(VDecl->getLocation(), VDecl->getType(),
11616     if (RequireNonAbstractType(VDecl->getLocation(), VDecl->getType(),
11619       VDecl->setInvalidDecl();
11626   if ((Def = VDecl->getDefinition()) && Def != VDecl &&
11626   if ((Def = VDecl->getDefinition()) && Def != VDecl &&
11627       (!VDecl->isStaticDataMember() || VDecl->isOutOfLine()) &&
11627       (!VDecl->isStaticDataMember() || VDecl->isOutOfLine()) &&
11628       !VDecl->isThisDeclarationADemotedDefinition() &&
11629       checkVarDeclRedefinition(Def, VDecl))
11645     if (VDecl->isStaticDataMember() && VDecl->getCanonicalDecl()->hasInit()) {
11645     if (VDecl->isStaticDataMember() && VDecl->getCanonicalDecl()->hasInit()) {
11647           << VDecl->getDeclName();
11648       Diag(VDecl->getCanonicalDecl()->getInit()->getExprLoc(),
11654     if (VDecl->hasLocalStorage())
11658       VDecl->setInvalidDecl();
11665   if (VDecl->getType().getAddressSpace() == LangAS::opencl_local) {
11666     Diag(VDecl->getLocation(), diag::err_local_cant_init);
11667     VDecl->setInvalidDecl();
11673   QualType DclT = VDecl->getType(), SavT = DclT;
11681       VDecl->setInvalidDecl();
11689   if (!VDecl->isInvalidDecl()) {
11690     InitializedEntity Entity = InitializedEntity::InitializeVariable(VDecl);
11692         VDecl->getLocation(), DirectInit, Init);
11702           Args[Idx], VDecl, [this, Entity, Kind](Expr *E) {
11707         VDecl->setInvalidDecl();
11712     if (VDecl->isInvalidDecl())
11720       VDecl->setInvalidDecl();
11732     if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
11732     if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
11733         VDecl->getType()->isReferenceType()) {
11742   if (!VDecl->isInvalidDecl() && (DclT != SavT))
11743     VDecl->setType(DclT);
11745   if (!VDecl->isInvalidDecl()) {
11746     checkUnsafeAssigns(VDecl->getLocation(), VDecl->getType(), Init);
11746     checkUnsafeAssigns(VDecl->getLocation(), VDecl->getType(), Init);
11748     if (VDecl->hasAttr<BlocksAttr>())
11749       checkRetainCycles(VDecl, Init);
11759       if ((VDecl->getType().getObjCLifetime() == Qualifiers::OCL_Strong ||
11760            VDecl->getType().isNonWeakInMRRWithObjCWeak(Context)) &&
11778       ActOnFinishFullExpr(Init, VDecl->getLocation(),
11779                           /*DiscardedValue*/ false, VDecl->isConstexpr());
11781     VDecl->setInvalidDecl();
11787   VDecl->setInit(Init);
11789   if (VDecl->isLocalVarDecl()) {
11791     if (VDecl->isInvalidDecl()) {
11796     } else if (VDecl->getType().getAddressSpace() == LangAS::opencl_constant) {
11805     } else if (VDecl->getStorageClass() == SC_Static) {
11812     } else if (!getLangOpts().C99 && VDecl->getType()->isAggregateType() &&
11824         if (VDecl->hasLocalStorage())
11826   } else if (VDecl->isStaticDataMember() && !VDecl->isInline() &&
11826   } else if (VDecl->isStaticDataMember() && !VDecl->isInline() &&
11827              VDecl->getLexicalDeclContext()->isRecord()) {
11855     } else if (VDecl->isConstexpr()) {
11859       Diag(VDecl->getLocation(), diag::err_in_class_initializer_non_const)
11861       VDecl->setInvalidDecl();
11870         Diag(VDecl->getLocation(), diag::err_in_class_initializer_volatile);
11888         VDecl->setInvalidDecl();
11896         Diag(VDecl->getLocation(),
11899         Diag(VDecl->getBeginLoc(),
11901             << FixItHint::CreateInsertion(VDecl->getBeginLoc(), "constexpr ");
11903         Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type)
11909           VDecl->setInvalidDecl();
11915       Diag(VDecl->getLocation(), diag::err_in_class_initializer_literal_type)
11917           << FixItHint::CreateInsertion(VDecl->getBeginLoc(), "constexpr ");
11918       VDecl->setConstexpr(true);
11921       Diag(VDecl->getLocation(), diag::err_in_class_initializer_bad_type)
11923       VDecl->setInvalidDecl();
11925   } else if (VDecl->isFileVarDecl()) {
11933     if (VDecl->getStorageClass() == SC_Extern &&
11934         ((!getLangOpts().CPlusPlus && !VDecl->hasAttr<SelectAnyAttr>()) ||
11935          !Context.getBaseElementType(VDecl->getType()).isConstQualified()) &&
11936         !(getLangOpts().CPlusPlus && VDecl->isExternC()) &&
11937         !isTemplateInstantiation(VDecl->getTemplateSpecializationKind()))
11938       Diag(VDecl->getLocation(), diag::warn_extern_init);
11944         getLangOpts().CPlusPlus && VDecl->getType().isConstQualified() &&
11945         VDecl->hasAttr<DLLExportAttr>() && VDecl->getDefinition())
11945         VDecl->hasAttr<DLLExportAttr>() && VDecl->getDefinition())
11946       VDecl->setStorageClass(SC_Extern);
11949     if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl())
11975     VDecl->setInitStyle(VarDecl::CallInit);
11978     VDecl->setInitStyle(VarDecl::ListInit);
11981   CheckCompleteVariableDeclaration(VDecl);