Lines Matching refs:VDecl
7850 VarDecl *VDecl = dyn_cast<VarDecl>(RealDecl);
7851 if (!VDecl) {
7860 if (TypeMayContainAuto && VDecl->getType()->isUndeducedType()) {
7870 << VDecl->getDeclName() << VDecl->getType()
7871 << VDecl->getSourceRange();
7877 << VDecl->getDeclName() << VDecl->getType()
7878 << VDecl->getSourceRange();
7892 VDecl->setInvalidDecl();
7900 if (DeduceAutoType(VDecl->getTypeSourceInfo(), DeduceInit, DeducedType) ==
7902 DiagnoseAutoDeductionFailure(VDecl, DeduceInit);
7907 VDecl->setType(DeducedType);
7908 assert(VDecl->isLinkageValid());
7911 if (getLangOpts().ObjCAutoRefCount && inferObjCARCLifetime(VDecl))
7912 VDecl->setInvalidDecl();
7921 VDecl->getTypeSourceInfo()->getTypeLoc().getBeginLoc();
7923 << VDecl->getDeclName() << DeduceInit->getSourceRange();
7928 if (VarDecl *Old = VDecl->getPreviousDecl())
7929 MergeVarDeclTypes(VDecl, Old, /*OldWasHidden*/ false);
7932 CheckVariableDeclarationType(VDecl);
7933 if (VDecl->isInvalidDecl())
7937 if (VDecl->isLocalVarDecl() && VDecl->hasExternalStorage()) {
7939 Diag(VDecl->getLocation(), diag::err_block_extern_cant_init);
7940 VDecl->setInvalidDecl();
7944 if (!VDecl->getType()->isDependentType()) {
7948 QualType BaseDeclType = VDecl->getType();
7951 if (RequireCompleteType(VDecl->getLocation(), BaseDeclType,
7958 if (RequireNonAbstractType(VDecl->getLocation(), VDecl->getType(),
7961 VDecl->setInvalidDecl();
7965 if ((Def = VDecl->getDefinition()) && Def != VDecl) {
7966 Diag(VDecl->getLocation(), diag::err_redefinition)
7967 << VDecl->getDeclName();
7969 VDecl->setInvalidDecl();
7987 if (VDecl->isStaticDataMember() && VDecl->getAnyInitializer(PrevInit)) {
7988 Diag(VDecl->getLocation(), diag::err_redefinition)
7989 << VDecl->getDeclName();
7994 if (VDecl->hasLocalStorage())
7998 VDecl->setInvalidDecl();
8005 if (VDecl->getStorageClass() == SC_OpenCLWorkGroupLocal) {
8006 Diag(VDecl->getLocation(), diag::err_local_cant_init);
8007 VDecl->setInvalidDecl();
8013 QualType DclT = VDecl->getType(), SavT = DclT;
8021 VDecl->setInvalidDecl();
8028 if (!VDecl->isInvalidDecl()) {
8029 InitializedEntity Entity = InitializedEntity::InitializeVariable(VDecl);
8032 CXXDirectInit ? InitializationKind::CreateDirect(VDecl->getLocation(),
8036 VDecl->getLocation())
8037 : InitializationKind::CreateCopy(VDecl->getLocation(),
8048 VDecl->setInvalidDecl();
8058 if (!VDecl->hasLocalStorage() || VDecl->getType()->isRecordType() ||
8059 VDecl->getType()->isReferenceType()) {
8067 if (!VDecl->isInvalidDecl() && (DclT != SavT))
8068 VDecl->setType(DclT);
8070 if (!VDecl->isInvalidDecl()) {
8071 checkUnsafeAssigns(VDecl->getLocation(), VDecl->getType(), Init);
8073 if (VDecl->hasAttr<BlocksAttr>())
8074 checkRetainCycles(VDecl, Init);
8083 if (VDecl->getType().getObjCLifetime() == Qualifiers::OCL_Strong) {
8103 ExprResult Result = ActOnFinishFullExpr(Init, VDecl->getLocation(),
8105 VDecl->isConstexpr());
8107 VDecl->setInvalidDecl();
8113 VDecl->setInit(Init);
8115 if (VDecl->isLocalVarDecl()) {
8119 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl()) {
8120 if (VDecl->getStorageClass() == SC_Static)
8126 else if (!getLangOpts().C99 && VDecl->getType()->isAggregateType() &&
8133 } else if (VDecl->isStaticDataMember() &&
8134 VDecl->getLexicalDeclContext()->isRecord()) {
8162 } else if (VDecl->isConstexpr()) {
8166 Diag(VDecl->getLocation(), diag::err_in_class_initializer_non_const)
8168 VDecl->setInvalidDecl();
8177 Diag(VDecl->getLocation(), diag::err_in_class_initializer_volatile);
8192 VDecl->setInvalidDecl();
8200 Diag(VDecl->getLocation(),
8203 Diag(VDecl->getLocStart(),
8205 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
8207 Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type)
8213 VDecl->setInvalidDecl();
8219 Diag(VDecl->getLocation(), diag::err_in_class_initializer_literal_type)
8221 << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr ");
8222 VDecl->setConstexpr(true);
8225 Diag(VDecl->getLocation(), diag::err_in_class_initializer_bad_type)
8227 VDecl->setInvalidDecl();
8229 } else if (VDecl->isFileVarDecl()) {
8230 if (VDecl->getStorageClass() == SC_Extern &&
8232 !(Context.getBaseElementType(VDecl->getType()).isConstQualified() ||
8233 VDecl->isExternC())))
8234 Diag(VDecl->getLocation(), diag::warn_extern_init);
8237 if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl())
8239 else if (VDecl->getTLSKind() == VarDecl::TLS_Static &&
8240 !VDecl->isInvalidDecl() && !DclT->isDependentType() &&
8241 !Init->isValueDependent() && !VDecl->isConstexpr() &&
8243 Context, VDecl->getType()->isReferenceType())) {
8248 Diag(VDecl->getLocation(), diag::err_thread_dynamic_init);
8250 Diag(VDecl->getLocation(), diag::note_use_thread_local);
8270 VDecl->setInitStyle(VarDecl::CallInit);
8273 VDecl->setInitStyle(VarDecl::ListInit);
8276 CheckCompleteVariableDeclaration(VDecl);