Home | History | Annotate | Download | only in Sema

Lines Matching refs:NewVD

3610   VarDecl *NewVD;
3612 NewVD = VarDecl::Create(Context, DC, D.getSourceRange().getBegin(),
3617 NewVD->setInvalidDecl();
3678 NewVD = VarDecl::Create(Context, DC, D.getSourceRange().getBegin(),
3686 ParsingInitForAutoVars.insert(NewVD);
3689 NewVD->setInvalidDecl();
3691 SetNestedNameSpecifier(NewVD, D);
3694 NewVD->setTemplateParameterListsInfo(Context,
3701 if (NewVD->hasLocalStorage())
3706 NewVD->setThreadSpecified(true);
3711 NewVD->setLexicalDeclContext(CurContext);
3714 ProcessDeclAttributes(S, NewVD, D);
3718 if (getLangOptions().ObjCAutoRefCount && inferObjCARCLifetime(NewVD))
3719 NewVD->setInvalidDecl();
3743 NewVD->addAttr(::new (Context) AsmLabelAttr(SE->getStrTokenLoc(0),
3749 CheckShadow(S, NewVD, Previous);
3754 FilterLookupForScope(Previous, DC, S, NewVD->hasLinkage(),
3758 CheckVariableDeclaration(NewVD, Previous, Redeclaration);
3767 Diag(NewVD->getLocation(), diag::err_nonstatic_member_out_of_line)
3770 NewVD->setInvalidDecl();
3777 NewVD->setInvalidDecl();
3780 CheckVariableDeclaration(NewVD, Previous, Redeclaration);
3783 if (isExplicitSpecialization && !NewVD->isInvalidDecl() &&
3784 CheckMemberSpecialization(NewVD, Previous))
3785 NewVD->setInvalidDecl();
3794 Def != NewVD && D.hasAttributes()) {
3795 Diag(NewVD->getLocation(), diag::warn_attribute_precede_definition);
3802 if (CurContext->isFunctionOrMethod() && NewVD->isExternC() &&
3803 !NewVD->isInvalidDecl())
3804 RegisterLocallyScopedExternCDecl(NewVD, Previous, S);
3808 if (NewVD->getLinkage() == ExternalLinkage && !DC->isRecord())
3809 AddPushedVisibilityAttribute(NewVD);
3811 MarkUnusedFileScopedDecl(NewVD);
3813 return NewVD;
3920 /// Sets NewVD->isInvalidDecl() if an error was encountered.
3921 void Sema::CheckVariableDeclaration(VarDecl *NewVD,
3925 if (NewVD->isInvalidDecl())
3928 QualType T = NewVD->getType();
3931 Diag(NewVD->getLocation(), diag::err_statically_allocated_object);
3932 return NewVD->setInvalidDecl();
3939 if (NewVD->hasLocalStorage() && T.getAddressSpace() != 0) {
3940 Diag(NewVD->getLocation(), diag::err_as_qualified_auto_decl);
3941 return NewVD->setInvalidDecl();
3944 if (NewVD->hasLocalStorage() && T.isObjCGCWeak()
3945 && !NewVD->hasAttr<BlocksAttr>()) {
3947 Diag(NewVD->getLocation(), diag::warn_gc_attribute_weak_on_local);
3949 Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
3953 if (isVM || NewVD->hasAttr<CleanupAttr>() ||
3954 NewVD->hasAttr<BlocksAttr>())
3957 if ((isVM && NewVD->hasLinkage()) ||
3958 (T->isVariableArrayType() && NewVD->hasGlobalStorage())) {
3971 if (NewVD->isFileVarDecl())
3972 Diag(NewVD->getLocation(), diag::err_vla_decl_in_file_scope)
3974 else if (NewVD->getStorageClass() == SC_Static)
3975 Diag(NewVD->getLocation(), diag::err_vla_decl_has_static_storage)
3978 Diag(NewVD->getLocation(), diag::err_vla_decl_has_extern_linkage)
3980 return NewVD->setInvalidDecl();
3984 if (NewVD->isFileVarDecl())
3985 Diag(NewVD->getLocation(), diag::err_vm_decl_in_file_scope);
3987 Diag(NewVD->getLocation(), diag::err_vm_decl_has_extern_linkage);
3988 return NewVD->setInvalidDecl();
3991 Diag(NewVD->getLocation(), diag::warn_illegal_constant_array_size);
3992 NewVD->setType(FixedTy);
3995 if (Previous.empty() && NewVD->isExternC()) {
4000 = LocallyScopedExternalDecls.find(NewVD->getDeclName());
4005 if (T->isVoidType() && !NewVD->hasExternalStorage()) {
4006 Diag(NewVD->getLocation(), diag::err_typecheck_decl_incomplete_type)
4008 return NewVD->setInvalidDecl();
4011 if (!NewVD->hasLocalStorage() && NewVD->hasAttr<BlocksAttr>()) {
4012 Diag(NewVD->getLocation(), diag::err_block_on_nonlocal);
4013 return NewVD->setInvalidDecl();
4016 if (isVM && NewVD->hasAttr<BlocksAttr>()) {
4017 Diag(NewVD->getLocation(), diag::err_block_on_vm);
4018 return NewVD->setInvalidDecl();
4033 Diag(NewVD->getLocation(), diag::err_invalid_qualified_function_pointer)
4035 return NewVD->setInvalidDecl();
4040 MergeVarDecl(NewVD, Previous);