Lines Matching refs:VDecl
9421 QualType Sema::deduceVarTypeFromInitializer(VarDecl *VDecl, in deduceVarTypeFromInitializer() argument
9426 bool IsInitCapture = !VDecl; in deduceVarTypeFromInitializer()
9427 assert((!VDecl || !VDecl->isInitCapture()) && in deduceVarTypeFromInitializer()
9481 DiagnoseAutoDeductionFailure(VDecl, DeduceInit); in deduceVarTypeFromInitializer()
9531 VarDecl *VDecl = dyn_cast<VarDecl>(RealDecl); in AddInitializerToDecl() local
9532 if (!VDecl) { in AddInitializerToDecl()
9540 if (TypeMayContainAuto && VDecl->getType()->isUndeducedType()) { in AddInitializerToDecl()
9544 ExprResult Res = CorrectDelayedTyposInExpr(Init, VDecl); in AddInitializerToDecl()
9552 VDecl, VDecl->getDeclName(), VDecl->getType(), in AddInitializerToDecl()
9553 VDecl->getTypeSourceInfo(), VDecl->getSourceRange(), DirectInit, Init); in AddInitializerToDecl()
9559 VDecl->setType(DeducedType); in AddInitializerToDecl()
9560 assert(VDecl->isLinkageValid()); in AddInitializerToDecl()
9563 if (getLangOpts().ObjCAutoRefCount && inferObjCARCLifetime(VDecl)) in AddInitializerToDecl()
9564 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9568 if (VarDecl *Old = VDecl->getPreviousDecl()) { in AddInitializerToDecl()
9571 MergeVarDeclTypes(VDecl, Old, /*MergeTypeWithPrevious*/ false); in AddInitializerToDecl()
9575 CheckVariableDeclarationType(VDecl); in AddInitializerToDecl()
9576 if (VDecl->isInvalidDecl()) in AddInitializerToDecl()
9581 if (VDecl->hasAttr<DLLImportAttr>() && !VDecl->isStaticDataMember()) { in AddInitializerToDecl()
9582 Diag(VDecl->getLocation(), diag::err_attribute_dllimport_data_definition); in AddInitializerToDecl()
9583 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9587 if (VDecl->isLocalVarDecl() && VDecl->hasExternalStorage()) { in AddInitializerToDecl()
9589 Diag(VDecl->getLocation(), diag::err_block_extern_cant_init); in AddInitializerToDecl()
9590 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9594 if (!VDecl->getType()->isDependentType()) { in AddInitializerToDecl()
9598 QualType BaseDeclType = VDecl->getType(); in AddInitializerToDecl()
9601 if (RequireCompleteType(VDecl->getLocation(), BaseDeclType, in AddInitializerToDecl()
9608 if (RequireNonAbstractType(VDecl->getLocation(), VDecl->getType(), in AddInitializerToDecl()
9611 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9615 if ((Def = VDecl->getDefinition()) && Def != VDecl) { in AddInitializerToDecl()
9618 (VDecl->getFormalLinkage() == InternalLinkage || in AddInitializerToDecl()
9619 VDecl->getDescribedVarTemplate() || in AddInitializerToDecl()
9620 VDecl->getNumTemplateParameterLists() || in AddInitializerToDecl()
9621 VDecl->getDeclContext()->isDependentContext())) { in AddInitializerToDecl()
9625 Diag(VDecl->getLocation(), diag::err_redefinition) in AddInitializerToDecl()
9626 << VDecl->getDeclName(); in AddInitializerToDecl()
9628 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9646 if (VDecl->isStaticDataMember() && VDecl->getCanonicalDecl()->hasInit()) { in AddInitializerToDecl()
9648 << VDecl->getDeclName(); in AddInitializerToDecl()
9649 Diag(VDecl->getCanonicalDecl()->getInit()->getExprLoc(), in AddInitializerToDecl()
9655 if (VDecl->hasLocalStorage()) in AddInitializerToDecl()
9659 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9666 if (VDecl->getType().getAddressSpace() == LangAS::opencl_local) { in AddInitializerToDecl()
9667 Diag(VDecl->getLocation(), diag::err_local_cant_init); in AddInitializerToDecl()
9668 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9674 QualType DclT = VDecl->getType(), SavT = DclT; in AddInitializerToDecl()
9682 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9690 if (!VDecl->isInvalidDecl()) { in AddInitializerToDecl()
9691 InitializedEntity Entity = InitializedEntity::InitializeVariable(VDecl); in AddInitializerToDecl()
9695 ? InitializationKind::CreateDirect(VDecl->getLocation(), in AddInitializerToDecl()
9698 : InitializationKind::CreateDirectList(VDecl->getLocation()) in AddInitializerToDecl()
9699 : InitializationKind::CreateCopy(VDecl->getLocation(), in AddInitializerToDecl()
9710 Args[Idx], VDecl, [this, Entity, Kind](Expr *E) { in AddInitializerToDecl()
9715 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9720 if (VDecl->isInvalidDecl()) in AddInitializerToDecl()
9728 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9738 if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() || in AddInitializerToDecl()
9739 VDecl->getType()->isReferenceType()) { in AddInitializerToDecl()
9747 if (!VDecl->isInvalidDecl() && (DclT != SavT)) in AddInitializerToDecl()
9748 VDecl->setType(DclT); in AddInitializerToDecl()
9750 if (!VDecl->isInvalidDecl()) { in AddInitializerToDecl()
9751 checkUnsafeAssigns(VDecl->getLocation(), VDecl->getType(), Init); in AddInitializerToDecl()
9753 if (VDecl->hasAttr<BlocksAttr>()) in AddInitializerToDecl()
9754 checkRetainCycles(VDecl, Init); in AddInitializerToDecl()
9763 if (VDecl->getType().getObjCLifetime() == Qualifiers::OCL_Strong && in AddInitializerToDecl()
9780 ExprResult Result = ActOnFinishFullExpr(Init, VDecl->getLocation(), in AddInitializerToDecl()
9782 VDecl->isConstexpr()); in AddInitializerToDecl()
9784 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9790 VDecl->setInit(Init); in AddInitializerToDecl()
9792 if (VDecl->isLocalVarDecl()) { in AddInitializerToDecl()
9796 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl()) { in AddInitializerToDecl()
9798 if (VDecl->getStorageClass() == SC_Static) in AddInitializerToDecl()
9804 else if (!getLangOpts().C99 && VDecl->getType()->isAggregateType() && in AddInitializerToDecl()
9811 } else if (VDecl->isStaticDataMember() && !VDecl->isInline() && in AddInitializerToDecl()
9812 VDecl->getLexicalDeclContext()->isRecord()) { in AddInitializerToDecl()
9840 } else if (VDecl->isConstexpr()) { in AddInitializerToDecl()
9844 Diag(VDecl->getLocation(), diag::err_in_class_initializer_non_const) in AddInitializerToDecl()
9846 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9855 Diag(VDecl->getLocation(), diag::err_in_class_initializer_volatile); in AddInitializerToDecl()
9870 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9878 Diag(VDecl->getLocation(), in AddInitializerToDecl()
9881 Diag(VDecl->getLocStart(), in AddInitializerToDecl()
9883 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr "); in AddInitializerToDecl()
9885 Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type) in AddInitializerToDecl()
9891 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9897 Diag(VDecl->getLocation(), diag::err_in_class_initializer_literal_type) in AddInitializerToDecl()
9899 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr "); in AddInitializerToDecl()
9900 VDecl->setConstexpr(true); in AddInitializerToDecl()
9903 Diag(VDecl->getLocation(), diag::err_in_class_initializer_bad_type) in AddInitializerToDecl()
9905 VDecl->setInvalidDecl(); in AddInitializerToDecl()
9907 } else if (VDecl->isFileVarDecl()) { in AddInitializerToDecl()
9908 if (VDecl->getStorageClass() == SC_Extern && in AddInitializerToDecl()
9910 !(Context.getBaseElementType(VDecl->getType()).isConstQualified() || in AddInitializerToDecl()
9911 VDecl->isExternC())) && in AddInitializerToDecl()
9912 !isTemplateInstantiation(VDecl->getTemplateSpecializationKind())) in AddInitializerToDecl()
9913 Diag(VDecl->getLocation(), diag::warn_extern_init); in AddInitializerToDecl()
9916 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl()) in AddInitializerToDecl()
9936 VDecl->setInitStyle(VarDecl::CallInit); in AddInitializerToDecl()
9939 VDecl->setInitStyle(VarDecl::ListInit); in AddInitializerToDecl()
9942 CheckCompleteVariableDeclaration(VDecl); in AddInitializerToDecl()