|
@@ -2167,13 +2167,12 @@ public:
|
|
ExprResult RebuildDeclRefExpr(NestedNameSpecifierLoc QualifierLoc,
|
|
ExprResult RebuildDeclRefExpr(NestedNameSpecifierLoc QualifierLoc,
|
|
ValueDecl *VD,
|
|
ValueDecl *VD,
|
|
const DeclarationNameInfo &NameInfo,
|
|
const DeclarationNameInfo &NameInfo,
|
|
|
|
+ NamedDecl *Found,
|
|
TemplateArgumentListInfo *TemplateArgs) {
|
|
TemplateArgumentListInfo *TemplateArgs) {
|
|
CXXScopeSpec SS;
|
|
CXXScopeSpec SS;
|
|
SS.Adopt(QualifierLoc);
|
|
SS.Adopt(QualifierLoc);
|
|
-
|
|
|
|
- // FIXME: loses template args.
|
|
|
|
-
|
|
|
|
- return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD);
|
|
|
|
|
|
+ return getSema().BuildDeclarationNameExpr(SS, NameInfo, VD, Found,
|
|
|
|
+ TemplateArgs);
|
|
}
|
|
}
|
|
|
|
|
|
/// Build a new expression in parentheses.
|
|
/// Build a new expression in parentheses.
|
|
@@ -9204,6 +9203,14 @@ TreeTransform<Derived>::TransformDeclRefExpr(DeclRefExpr *E) {
|
|
if (!ND)
|
|
if (!ND)
|
|
return ExprError();
|
|
return ExprError();
|
|
|
|
|
|
|
|
+ NamedDecl *Found = ND;
|
|
|
|
+ if (E->getFoundDecl() != E->getDecl()) {
|
|
|
|
+ Found = cast_or_null<NamedDecl>(
|
|
|
|
+ getDerived().TransformDecl(E->getLocation(), E->getFoundDecl()));
|
|
|
|
+ if (!Found)
|
|
|
|
+ return ExprError();
|
|
|
|
+ }
|
|
|
|
+
|
|
DeclarationNameInfo NameInfo = E->getNameInfo();
|
|
DeclarationNameInfo NameInfo = E->getNameInfo();
|
|
if (NameInfo.getName()) {
|
|
if (NameInfo.getName()) {
|
|
NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
|
|
NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
|
|
@@ -9236,7 +9243,7 @@ TreeTransform<Derived>::TransformDeclRefExpr(DeclRefExpr *E) {
|
|
}
|
|
}
|
|
|
|
|
|
return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
|
|
return getDerived().RebuildDeclRefExpr(QualifierLoc, ND, NameInfo,
|
|
- TemplateArgs);
|
|
|
|
|
|
+ Found, TemplateArgs);
|
|
}
|
|
}
|
|
|
|
|
|
template<typename Derived>
|
|
template<typename Derived>
|