Home | History | Annotate | Download | only in Sema

Lines Matching refs:Name

233 /// \brief If the identifier refers to a type name within this scope,
236 /// This routine performs ordinary name lookup of the identifier II
238 /// determine whether the name refers to a type. If so, returns an
248 // Determine where we will perform name lookup.
261 // nested-name-specifier depends on a template-parameter (14.6.2)
266 // We therefore do not perform any name lookup if the result would
271 // We know from the grammar that this name refers to a type,
296 // Perform "qualified" name lookup into the declaration context we
299 // nested-name-specifier.
304 // If the unqualified-id is ~type-name, the type-name is looked up
306 // the object expression is of a class type C, the type-name is also
308 // find a name that refers to (possibly cv-qualified) T.
312 // Perform unqualified name lookup.
398 // perform this lookup again (e.g., as an object name), which
400 // a type name.
408 // perform the name lookup again.
426 name (in such a case, the scope specifier
481 // instantiation time. The name specifier isn't dependent, so template
502 /// to determine if the specified name is a valid tag name ("struct foo"). If
507 // Do a tag name lookup in this scope.
564 // There may have been a typo in the name of the type. Look up typo
606 UnqualifiedId Name;
607 Name.setIdentifier(II, IILoc);
612 Name, ParsedType(), true, TemplateResult,
649 /// \brief Determine whether the given result set contains either a type name
668 IdentifierInfo *&Name,
670 LookupResult R(SemaRef, Name, NameLoc, Sema::LookupTagName);
698 << Name << TagName << SemaRef.getLangOpts().CPlusPlus
704 << Name << TagName;
715 /// Build a ParsedType for a simple-type-specifier with a nested-name-specifier.
731 Sema::ClassifyName(Scope *S, CXXScopeSpec &SS, IdentifierInfo *&Name,
735 DeclarationNameInfo NameInfo(Name, NameLoc);
739 BuildCXXNestedNameSpecifier(S, *Name, NameLoc, NextToken.getLocation(),
743 LookupResult Result(*this, Name, NameLoc, LookupOrdinaryName);
750 recoverFromTypeInKnownDependentBase(*this, *Name, NameLoc))
759 ExprResult E = LookupInObjCMethod(Result, S, Name, true);
790 if (NamedDecl *D = ImplicitlyDefineFunction(NameLoc, *Name, S)) {
797 // In C, we first see whether there is a tag type by the same name, in
801 isTagTypeWithMissingTag(*this, Result, S, SS, Name, NameLoc)) {
805 // Perform typo correction to determine if there is another name that is
806 // close to this name.
832 diagnoseTypo(Corrected, PDiag(UnqualifiedDiag) << Name);
836 Name->getName().equals(CorrectedStr);
838 << Name << computeDeclContext(SS, false)
842 // Update the name, so that the caller has the new name.
843 Name = Corrected.getCorrectionAsIdentifierInfo();
847 return Name;
875 // We performed name lookup into the current instantiation, and there were
877 // dependent nested-name-specifier.
880 // A name used in a template declaration or definition and that is
881 // dependent on a template-parameter is assumed not to name a type
882 // unless the applicable name lookup finds a type name or the name is
903 // A lookup that finds an injected-class-name (10.2) can result in an
906 // refer to specializations of the same class template, and if the name
927 // After name lookup (3.4) finds that a name is a template-name or that
1014 isTagTypeWithMissingTag(*this, Result, S, SS, Name, NameLoc)) {
1103 /// of a declarator's nested name specifier.
1107 // A name used in the definition of a static data member of class
1109 // if the name was used in a member function of X.
1112 // scope of its namespace then any name used in the definition of
1247 // isn't strictly lexical, which breaks name lookup. Be careful to insert
1264 void Sema::pushExternalDeclIntoScope(NamedDecl *D, DeclarationName Name) {
1265 if (IdResolver.tryAddTopLevelDecl(D, Name) && TUScope)
1581 // MS inline assembly label name.
1617 // Remove this name from our lexical scope.
1624 /// \param Id The name of the Objective-C class we're looking for. If
1625 /// typo-correction fixes this name, the Id will be updated
1626 /// to the fixed name.
1628 /// \param IdLoc The location of the name in the translation unit.
1631 /// if there is no class with the given name.
1644 // find an Objective-C class name.
1829 // If both declarations give a tag declaration a typedef name for linkage
1878 /// same name and scope as a previous declaration 'Old'. Figure out
1926 // Fall through - the typedef name was not a builtin type.
1998 // redefine the name of any type declared in that scope to refer
2005 // any class-name declared in that scope that is not also a typedef-name
2608 // which specifies the same unqualified name,
2611 // -- exactly one declaration shall declare a class name or enumeration
2612 // name that is not a typedef name and the other declarations shall all
2614 // and function templates; in this case the class name or enumeration
2615 // name is hidden (3.3.10).
2619 // same name and the same parameter-type-list as a function introduced
2655 /// declarator D which has the same name and scope as a previous
2918 // -- Member function declarations with the same name and the
3249 /// MergeVarDeclTypes - We parsed a variable 'New' which has the same name and
3373 /// MergeVarDecl - We just parsed a variable 'New' which has the same name
3649 // Do nothing if the tag already has a name for linkage purposes.
3665 // adding a typedef name for the anonymous decl can change that
3667 // unsupported and ignore the typedef name. TODO: we should
3786 // nested-name-specifier unless it is an explicit instantiation
3863 // Customize diagnostic for a typedef missing a name.
3885 // names into the program, or shall redeclare a name introduced by a
3959 DeclarationName Name,
3962 LookupResult R(SemaRef, Name, NameLoc, Sema::LookupMemberName,
3977 << IsUnion << Name;
4007 // Look every FieldDecl and IndirectFieldDecl with a name.
4022 // For the purpose of name lookup, after the anonymous union
4342 // context and into the identifier resolver chain for name lookup
4411 // context and into the identifier resolver chain for name lookup
4428 /// GetNameForDeclarator - Determine the full declaration name for the
4434 /// \brief Retrieves the declaration name from a parsed unqualified-id.
4436 Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) {
4438 NameInfo.setLoc(Name.StartLocation);
4440 switch (Name.getKind()) {
4444 NameInfo.setName(Name.Identifier);
4445 NameInfo.setLoc(Name.StartLocation);
4450 Name.OperatorFunctionId.Operator));
4451 NameInfo.setLoc(Name.StartLocation);
4453 = Name.OperatorFunctionId.SymbolLocations[0];
4455 = Name.EndLocation.getRawEncoding();
4460 Name.Identifier));
4461 NameInfo.setLoc(Name.StartLocation);
4462 NameInfo.setCXXLiteralOperatorNameLoc(Name.EndLocation);
4467 QualType Ty = GetTypeFromParser(Name.ConversionFunctionId, &TInfo);
4472 NameInfo.setLoc(Name.StartLocation);
4479 QualType Ty = GetTypeFromParser(Name.ConstructorName, &TInfo);
4484 NameInfo.setLoc(Name.StartLocation);
4494 if (!CurClass || CurClass->getIdentifier() != Name.TemplateId->Name)
4501 // CurClassType, and that the template-id does not occur when the name
4506 NameInfo.setLoc(Name.StartLocation);
4514 QualType Ty = GetTypeFromParser(Name.DestructorName, &TInfo);
4519 NameInfo.setLoc(Name.StartLocation);
4525 TemplateName TName = Name.TemplateId->Template.get();
4526 SourceLocation TNameLoc = Name.TemplateId->TemplateNameLoc;
4530 } // switch (Name.getKind())
4532 llvm_unreachable("Unknown name kind");
4585 /// Any bits of declarator which appear before the name are valid for
4589 DeclarationName Name) {
4615 TSI = S.RebuildTypeInCurrentInstantiation(TSI, D.getIdentifierLoc(), Name);
4643 // before the declaration name is the base type of a member
4669 /// If T is the name of a class, then each of the following shall have a
4670 /// name different from T:
4674 /// \returns true if the declaration name violates these rules.
4677 DeclarationName Name = NameInfo.getName();
4680 if (Record->getIdentifier() && Record->getDeclName() == Name) {
4681 Diag(NameInfo.getLoc(), diag::err_member_name_of_class) << Name;
4689 /// nested-name-specifier.
4691 /// \param SS The nested-name-specifier of the declarator-id.
4693 /// \param DC The declaration context to which the nested-name-specifier
4696 /// \param Name The name of the entity being declared.
4698 /// \param Loc The location of the name of the entity being declared.
4702 DeclarationName Name,
4721 << Name << FixItHint::CreateRemoval(SS.getRange());
4724 Diag(Loc, diag::warn_namespace_member_extra_qualification) << Name;
4734 << Name << SS.getRange();
4737 << Name << SS.getRange();
4740 << Name << SS.getRange();
4743 << Name << SS.getRange();
4746 << Name << cast<NamedDecl>(Cur) << cast<NamedDecl>(DC) << SS.getRange();
4754 << Name << SS.getRange();
4760 if ((Name.getNameKind() == DeclarationName::CXXConstructorName ||
4761 Name.getNameKind() == DeclarationName::CXXDestructorName) &&
4762 !Context.hasSameType(Name.getCXXNameType(),
4770 // [...] "The nested-name-specifier of the qualified declarator-id shall
4787 DeclarationName Name = NameInfo.getName();
4791 if (!Name) {
4837 << Name << DC << D.getCXXScopeSpec().getRange();
4842 Name, D.getIdentifierLoc())) {
4855 if (RebuildDeclaratorInCurrentInstantiation(*this, D, Name))
4888 // the same name.
4933 // the nested-name-specifier of the declarator-id.
5145 // Note that we have a locally-scoped external with this name.
5149 NamedDecl *Sema::findLocallyScopedExternCDecl(DeclarationName Name) {
5151 auto Result = Context.getExternCContextDecl()->lookup(Name);
5221 // C99 6.7.7p2: If a typedef name specifies a variably modified type
5258 /// declares a typedef-name, either using the 'typedef' type specifier or via
5293 /// This routine should be invoked when name lookup has found a
5295 /// new declaration by the same name is being introduced. If the new
5300 /// \param PrevDecl the previous declaration found by name
5307 /// for a new delcaration with the same name.
5320 // having the same name and type, ignoring entities declared
5704 DeclarationName Name = GetNameForDeclarator(D).getName();
5762 IdentifierInfo *II = Name.getAsIdentifierInfo();
5765 << Name;
5859 << Name << RD->getDeclName();
5867 : diag::ext_static_data_member_in_union) << Name;
5872 << Name << RD->isUnion();
5944 VarTemplateDecl::Create(Context, DC, D.getIdentifierLoc(), Name,
6206 << Name << computeDeclContext(D.getCXXScopeSpec(), true)
6261 if (Name.isIdentifier() && Name.getAsIdentifierInfo()->isStr("main") &&
6298 /// \param S the scope in which the shadowing name is being declared
6299 /// \param R the lookup of the name
6365 DeclarationName Name = R.getLookupName();
6370 Diag(R.getNameLoc(), diag::warn_decl_shadow) << Name << Kind << OldDC;
6435 // FIXME: If we have any other entity with this name in global scope,
6437 // 'stat' hack, for instance. Only variables can have mangled name
6467 /// with the same name that appear in different scopes refer to the same
6469 /// the same name as an entity in global scope.
6706 // If we did not find anything by this name, look for a non-visible
6707 // extern "C" declaration with the same name.
6731 DeclarationName Name
6734 if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
6739 Name = S->Context.DeclarationNames.getCXXDestructorName(CT);
6742 for (Path.Decls = BaseRecord->lookup(Name); !Path.Decls.empty();
6877 /// the same name.
6880 /// the new declaration name does not cause new errors.
6884 DeclarationName Name = NewFD->getDeclName();
6892 LookupResult Prev(SemaRef, Name, NewFD->getLocation(),
6918 // If the qualified name lookup yielded nothing, try typo correction
6974 << Name << NewDC << IsDefinition);
6979 ExtraArgs.D.SetIdentifier(Name.getAsIdentifierInfo(),
6983 Previous.setLookupName(Name);
6987 << Name << NewDC << IsDefinition << NewFD->getLocation();
7062 DeclarationName Name = NameInfo.getName();
7072 // to a type name (which eventually refers to a function type).
7099 if (Name.getNameKind() == DeclarationName::CXXConstructorName) {
7111 } else if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
7142 D.getIdentifierLoc(), Name, R, TInfo,
7147 } else if (Name.getNameKind() == DeclarationName::CXXConversionFunctionName) {
7162 // If the name of the function is the same as the name of the record,
7166 if (Name.getAsIdentifierInfo() &&
7167 Name.getAsIdentifierInfo() == cast<CXXRecordDecl>(DC)->getIdentifier()){
7389 DeclarationName Name = NameInfo.getName();
7484 if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
7501 Name, TemplateParams,
7523 // If we remove the template<> and the name is not a
7527 // we need to insert '<>' after the name.
7535 << Name << RemoveRange
7610 diag::err_inline_declaration_block_scope) << Name
7775 if ((Name.getCXXOverloadedOperator() == OO_Delete ||
7776 Name.getCXXOverloadedOperator() == OO_Array_Delete) &&
8324 // the same name, if appropriate.
8353 // If a function name
8354 // with that name must be marked "overloadable".
8370 // Check for a previous extern "C" declaration with this name.
8374 // This is an extern "C" declaration with the same name as a previous
8489 DeclarationName Name
8492 if (NewFD->getDeclName() != Name) {
9087 DeclarationName Name, QualType Type,
9110 << Name << Type << Range;
9118 << Name << Type << Range;
9127 << isa<InitListExpr>(Init) << Name << Type << Range;
9150 << Name
9156 << Name << TSI->getType()
9170 Diag(Loc, diag::warn_auto_var_is_id) << Name << Range;
9966 // change if it's later given a typedef name.
10428 // Ensure we have a valid name
10455 // Recover by removing the name
10560 SourceLocation NameLoc, IdentifierInfo *Name,
10586 ParmVarDecl *New = ParmVarDecl::Create(Context, DC, StartLoc, NameLoc, Name,
10925 // If the decl has a non-null name, make accessible in the current scope.
11325 // this name as a function or variable. If so, use that
11481 IdentifierInfo *Name = FD->getIdentifier();
11482 if (!Name)
11494 if (Name->isStr("asprintf") || Name->isStr("vasprintf")) {
11500 Name->isStr("vasprintf") ? 0 : 3,
11504 if (Name->isStr("__CFStringMakeConstantString")) {
11548 // enum), the first typedef-name declared by the declaration
11657 const IdentifierInfo *Name) {
11661 // declaration to which the name in the elaborated-type-specifier
11663 // elaborated-type-specifier that declares a class-name or
11686 << getRedeclDiagFromTagKind(NewTag) << isTemplate << Name
11705 << getRedeclDiagFromTagKind(NewTag) << isTemplate << Name
11727 << getRedeclDiagFromTagKind(NewTag) << isTemplate << Name
11744 /// Add a minimal nested name specifier fixit hint to allow lookup of a tag name
11755 // While the decl is in a namespace, do repeated lookup of that name and see
11787 /// be redeclared with an unqualfied name in \p NewDC (assuming name lookup
11808 /// former case, Name will be non-null. In the later case, Name will be null.
11819 IdentifierInfo *Name, SourceLocation NameLoc,
11828 // If this is not a definition, it must have a name.
11829 IdentifierInfo *OrigName = Name;
11830 assert((Name != nullptr || TUK == TUK_Definition) &&
11865 SS, Name, NameLoc, Attr,
11876 << TypeWithKeyword::getTagTypeKindName(Kind) << Name;
11894 // C++0x 7.2p2: The type-specifier-seq of an enum-base shall name an
11925 LookupResult Previous(*this, Name, NameLoc, LookupTagName, Redecl);
11926 if (Name && SS.isNotEmpty()) {
11927 // We have a nested-name tag ('struct foo::bar').
11931 Name = nullptr;
11956 // Look-up name inside 'foo::'.
11963 // Name lookup did not find anything. However, if the
11964 // nested-name-specifier refers to the current instantiation,
11977 << Kind << Name << DC << SS.getRange();
11978 Name = nullptr;
11982 } else if (Name) {
11984 // If T is the name of a class, then each of the following shall have a
11985 // name different from T:
11988 DiagnoseClassNameShadow(SearchDC, DeclarationNameInfo(Name, NameLoc)))
12012 // If the name in a friend declaration is neither qualified nor
12072 if (getLangOpts().CPlusPlus && Name && DC && StdNamespace &&
12073 DC->Equals(getStdNamespace()) && Name->isStr("bad_alloc")) {
12079 // name lookup). Fill in this implicit declaration as the previous
12089 if (Name && Previous.empty() &&
12103 // declared as a class-name in the namespace that contains
12178 if (Tag->getDeclName() == Name &&
12221 Name)) {
12227 << Name
12231 Diag(KWLoc, diag::err_use_with_wrong_tag) << Name;
12238 Name = nullptr;
12329 Diag(NameLoc, diag::warn_redefinition_in_param_list) << Name;
12331 Diag(NameLoc, diag::err_redefinition) << Name;
12336 Name = nullptr;
12345 Diag(NameLoc, diag::err_nested_redefinition) << Name;
12348 Name = nullptr;
12419 << Name << Kind << TND->getUnderlyingType();
12425 // The tag name clashes with something else in the target scope,
12427 Diag(NameLoc, diag::err_redefinition_different_kind) << Name;
12429 Name = nullptr;
12459 New = EnumDecl::Create(Context, SearchDC, KWLoc, Loc, Name,
12506 New = CXXRecordDecl::Create(Context, Kind, SearchDC, KWLoc, Loc, Name,
12512 New = RecordDecl::Create(Context, Kind, SearchDC, KWLoc, Loc, Name,
12528 // nested-name-specifier against the current context. We don't do this
12582 if ((Name || Kind == TTK_Enum) &&
12589 << Name;
12611 // the tag name visible.
12631 if (Name) // can be null along some error paths
12634 } else if (Name) {
12705 // [...] The class-name is also inserted into the scope of the
12706 // class itself; this is known as the injected-class-name. For
12707 // purposes of access checking, the injected-class-name is treated
12708 // as if it were a public member name.
12722 "Broken injected-class-name");
12933 // Check to see if this name was declared as a member previously
12979 // with the same name in the same scope.
12990 /// This routine builds a new FieldDecl given the fields name, type,
12992 /// with the same name and in the same scope as the field to be
12998 FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
13006 IdentifierInfo *II = Name.getAsIdentifierInfo();
14060 // Verify that there isn't already something declared with this name in this
14072 // If T is the name of a class, then each of the following shall have a name
14086 // When in C++, we may get a TagDecl with the same name; in this case the
14710 void Sema::ActOnPragmaRedefineExtname(IdentifierInfo* Name,
14715 NamedDecl *PrevDecl = LookupSingleName(TUScope, Name, NameLoc,
14732 (void)ExtnameUndeclaredIdentifiers.insert(std::make_pair(Name, Attr));
14735 void Sema::ActOnPragmaWeakID(IdentifierInfo* Name,
14738 Decl *PrevDecl = LookupSingleName(TUScope, Name, NameLoc, LookupOrdinaryName);
14745 (Name, WeakInfo((IdentifierInfo*)nullptr, NameLoc)));
14749 void Sema::ActOnPragmaWeakAlias(IdentifierInfo* Name,
14756 WeakInfo W = WeakInfo(Name, NameLoc);