From: Eli Friedman Date: Mon, 16 Jan 2012 21:00:51 +0000 (+0000) Subject: Add some calls to MarkDeclarationReferenced, towards a point where every declaration... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf7c14c3451658311aeaed84c6395082fa91e60d;p=clang Add some calls to MarkDeclarationReferenced, towards a point where every declaration which is used is marked as used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148253 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 918f97245e..5e328ec841 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2366,7 +2366,9 @@ BuildImplicitBaseInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, bool Moving = ImplicitInitKind == IIK_Move; ParmVarDecl *Param = Constructor->getParamDecl(0); QualType ParamType = Param->getType().getNonReferenceType(); - + + SemaRef.MarkDeclarationReferenced(Constructor->getLocation(), Param); + Expr *CopyCtorArg = DeclRefExpr::Create(SemaRef.Context, NestedNameSpecifierLoc(), Param, Constructor->getLocation(), ParamType, @@ -2436,6 +2438,8 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, ParmVarDecl *Param = Constructor->getParamDecl(0); QualType ParamType = Param->getType().getNonReferenceType(); + SemaRef.MarkDeclarationReferenced(Constructor->getLocation(), Param); + // Suppress copying zero-width bitfields. if (Field->isBitField() && Field->getBitWidthValue(SemaRef.Context) == 0) return false; diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index ee25591529..6476f4a512 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2043,6 +2043,9 @@ ExprResult Sema::CheckConditionVariable(VarDecl *ConditionVar, ConditionVar->getLocation(), ConditionVar->getType().getNonReferenceType(), VK_LValue)); + + MarkDeclarationReferenced(ConditionVar->getLocation(), ConditionVar); + if (ConvertToBoolean) { Condition = CheckBooleanCondition(Condition.take(), StmtLoc); if (Condition.isInvalid())