Lines Matching defs:VDecl
8710 VarDecl *VDecl = dyn_cast<VarDecl>(RealDecl);
8711 if (!VDecl) {
8720 if (TypeMayContainAuto && VDecl->getType()->isUndeducedType()) {
8743 VDecl->isInitCapture() ? diag::err_init_capture_no_expression
8745 << VDecl->getDeclName() << VDecl->getType()
8746 << VDecl->getSourceRange();
8751 VDecl->isInitCapture()
8754 << VDecl->getDeclName() << VDecl->getType()
8755 << VDecl->getSourceRange();
8763 << VDecl->getDeclName() << VDecl->getType()
8764 << VDecl->getSourceRange();
8774 VDecl->setInvalidDecl();
8782 if (DeduceAutoType(VDecl->getTypeSourceInfo(), DeduceInit, DeducedType) ==
8784 DiagnoseAutoDeductionFailure(VDecl, DeduceInit);
8789 VDecl->setType(DeducedType);
8790 assert(VDecl->isLinkageValid());
8793 if (getLangOpts().ObjCAutoRefCount && inferObjCARCLifetime(VDecl))
8794 VDecl->setInvalidDecl();
8803 VDecl->getTypeSourceInfo()->getTypeLoc().getBeginLoc();
8805 << VDecl->getDeclName() << DeduceInit->getSourceRange();
8810 if (VarDecl *Old = VDecl->getPreviousDecl()) {
8813 MergeVarDeclTypes(VDecl, Old, /*MergeTypeWithPrevious*/false);
8817 CheckVariableDeclarationType(VDecl);
8818 if (VDecl->isInvalidDecl())
8831 if (VDecl->hasAttr<DLLImportAttr>() && !VDecl->isStaticDataMember()) {
8832 Diag(VDecl->getLocation(), diag::err_attribute_dllimport_data_definition);
8833 VDecl->setInvalidDecl();
8837 if (VDecl->isLocalVarDecl() && VDecl->hasExternalStorage()) {
8839 Diag(VDecl->getLocation(), diag::err_block_extern_cant_init);
8840 VDecl->setInvalidDecl();
8844 if (!VDecl->getType()->isDependentType()) {
8848 QualType BaseDeclType = VDecl->getType();
8851 if (RequireCompleteType(VDecl->getLocation(), BaseDeclType,
8858 if (RequireNonAbstractType(VDecl->getLocation(), VDecl->getType(),
8861 VDecl->setInvalidDecl();
8865 if ((Def = VDecl->getDefinition()) && Def != VDecl) {
8866 Diag(VDecl->getLocation(), diag::err_redefinition)
8867 << VDecl->getDeclName();
8869 VDecl->setInvalidDecl();
8887 if (VDecl->isStaticDataMember() && VDecl->getAnyInitializer(PrevInit)) {
8889 << VDecl->getDeclName();
8894 if (VDecl->hasLocalStorage())
8898 VDecl->setInvalidDecl();
8905 if (VDecl->getStorageClass() == SC_OpenCLWorkGroupLocal) {
8906 Diag(VDecl->getLocation(), diag::err_local_cant_init);
8907 VDecl->setInvalidDecl();
8913 QualType DclT = VDecl->getType(), SavT = DclT;
8921 VDecl->setInvalidDecl();
8928 if (!VDecl->isInvalidDecl()) {
8929 InitializedEntity Entity = InitializedEntity::InitializeVariable(VDecl);
8932 CXXDirectInit ? InitializationKind::CreateDirect(VDecl->getLocation(),
8936 VDecl->getLocation())
8937 : InitializationKind::CreateCopy(VDecl->getLocation(),
8953 VDecl->setInvalidDecl();
8958 if (VDecl->isInvalidDecl())
8964 VDecl->setInvalidDecl();
8974 if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
8975 VDecl->getType()->isReferenceType()) {
8983 if (!VDecl->isInvalidDecl() && (DclT != SavT))
8984 VDecl->setType(DclT);
8986 if (!VDecl->isInvalidDecl()) {
8987 checkUnsafeAssigns(VDecl->getLocation(), VDecl->getType(), Init);
8989 if (VDecl->hasAttr<BlocksAttr>())
8990 checkRetainCycles(VDecl, Init);
8999 if (VDecl->getType().getObjCLifetime() == Qualifiers::OCL_Strong &&
9016 ExprResult Result = ActOnFinishFullExpr(Init, VDecl->getLocation(),
9018 VDecl->isConstexpr());
9020 VDecl->setInvalidDecl();
9026 VDecl->setInit(Init);
9028 if (VDecl->isLocalVarDecl()) {
9032 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl()) {
9034 if (VDecl->getStorageClass() == SC_Static)
9040 else if (!getLangOpts().C99 && VDecl->getType()->isAggregateType() &&
9047 } else if (VDecl->isStaticDataMember() &&
9048 VDecl->getLexicalDeclContext()->isRecord()) {
9076 } else if (VDecl->isConstexpr()) {
9080 Diag(VDecl->getLocation(), diag::err_in_class_initializer_non_const)
9082 VDecl->setInvalidDecl();
9091 Diag(VDecl->getLocation(), diag::err_in_class_initializer_volatile);
9106 VDecl->setInvalidDecl();
9114 Diag(VDecl->getLocation(),
9117 Diag(VDecl->getLocStart(),
9119 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
9121 Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type)
9127 VDecl->setInvalidDecl();
9133 Diag(VDecl->getLocation(), diag::err_in_class_initializer_literal_type)
9135 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
9136 VDecl->setConstexpr(true);
9139 Diag(VDecl->getLocation(), diag::err_in_class_initializer_bad_type)
9141 VDecl->setInvalidDecl();
9143 } else if (VDecl->isFileVarDecl()) {
9144 if (VDecl->getStorageClass() == SC_Extern &&
9146 !(Context.getBaseElementType(VDecl->getType()).isConstQualified() ||
9147 VDecl->isExternC())) &&
9148 !isTemplateInstantiation(VDecl->getTemplateSpecializationKind()))
9149 Diag(VDecl->getLocation(), diag::warn_extern_init);
9152 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl())
9172 VDecl->setInitStyle(VarDecl::CallInit);
9175 VDecl->setInitStyle(VarDecl::ListInit);
9178 CheckCompleteVariableDeclaration(VDecl);