diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/Sema.h | 14 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
4 files changed, 19 insertions, 11 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 38f7540afe..c04f80d0ee 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -270,7 +270,8 @@ public: //===--------------------------------------------------------------------===// // Symbol table / Decl tracking callbacks: SemaDecl.cpp. // - virtual TypeTy *isTypeName(const IdentifierInfo &II, Scope *S); + virtual TypeTy *isTypeName(const IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS); virtual std::string getTypeAsString(TypeTy *Type); virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup); virtual DeclTy *ActOnParamDeclarator(Scope *S, Declarator &D); @@ -300,8 +301,9 @@ public: virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS); virtual DeclTy *ActOnTag(Scope *S, unsigned TagType, TagKind TK, - SourceLocation KWLoc, IdentifierInfo *Name, - SourceLocation NameLoc, AttributeList *Attr); + SourceLocation KWLoc, const CXXScopeSpec &SS, + IdentifierInfo *Name, SourceLocation NameLoc, + AttributeList *Attr); DeclTy* ActOnTagStruct(Scope *S, TagDecl::TagKind Kind, TagKind TK, SourceLocation KWLoc, IdentifierInfo *Name, @@ -585,7 +587,8 @@ public: // Primary Expressions. virtual ExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc, IdentifierInfo &II, - bool HasTrailingLParen); + bool HasTrailingLParen, + const CXXScopeSpec *SS = 0); virtual ExprResult ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind); virtual ExprResult ActOnNumericConstant(const Token &); @@ -797,7 +800,8 @@ public: //===--------------------------------------------------------------------===// // C++ Classes // - virtual bool isCurrentClassName(const IdentifierInfo &II, Scope *S); + virtual bool isCurrentClassName(const IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS); virtual void ActOnStartCXXClassDef(Scope *S, DeclTy *TagDecl, SourceLocation LBrace); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 18d77c4a18..57a5aa8419 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -28,7 +28,8 @@ #include "llvm/ADT/StringExtras.h" using namespace clang; -Sema::TypeTy *Sema::isTypeName(const IdentifierInfo &II, Scope *S) { +Sema::TypeTy *Sema::isTypeName(const IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS) { Decl *IIDecl = LookupDecl(&II, Decl::IDNS_Ordinary, S, false); if (IIDecl && (isa<TypedefDecl>(IIDecl) || @@ -2067,8 +2068,9 @@ TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T, /// TagType indicates what kind of tag this is. TK indicates whether this is a /// reference/declaration/definition of a tag. Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK, - SourceLocation KWLoc, IdentifierInfo *Name, - SourceLocation NameLoc, AttributeList *Attr) { + SourceLocation KWLoc, const CXXScopeSpec &SS, + IdentifierInfo *Name, SourceLocation NameLoc, + AttributeList *Attr) { // If this is a use of an existing tag, it must have a name. assert((Name != 0 || TK == TK_Definition) && "Nameless record must be a definition!"); diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index fe7efbae5f..2ac5804d1e 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -262,7 +262,8 @@ void Sema::CheckCXXDefaultArguments(FunctionDecl *FD) { /// name of the class type currently being defined. In the case of /// nested classes, this will only return true if II is the name of /// the innermost class. -bool Sema::isCurrentClassName(const IdentifierInfo &II, Scope *) { +bool Sema::isCurrentClassName(const IdentifierInfo &II, Scope *, + const CXXScopeSpec *SS) { if (CXXRecordDecl *CurDecl = dyn_cast_or_null<CXXRecordDecl>(CurContext)) return &II == CurDecl->getIdentifier(); else @@ -614,7 +615,7 @@ Sema::ActOnMemInitializer(DeclTy *ConstructorD, } // It didn't name a member, so see if it names a class. - TypeTy *BaseTy = isTypeName(*MemberOrBase, S); + TypeTy *BaseTy = isTypeName(*MemberOrBase, S, 0/*SS*/); if (!BaseTy) return Diag(IdLoc, diag::err_mem_init_not_member_or_class, MemberOrBase->getName(), SourceRange(IdLoc, RParenLoc)); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d3650c8ae1..d638b8dc98 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -337,7 +337,8 @@ static bool ShouldSnapshotBlockValueReference(BlockSemaInfo *CurBlock, /// identifier is used in a function call context. Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc, IdentifierInfo &II, - bool HasTrailingLParen) { + bool HasTrailingLParen, + const CXXScopeSpec *SS) { // Could be enum-constant, value decl, instance variable, etc. Decl *D = LookupDecl(&II, Decl::IDNS_Ordinary, S); |