forked from OSchip/llvm-project
When computing the canonical profile of a DeclRefExpr or MemberExpr,
don't include the nested-name-specifier or template arguments: they were only relevant when resolving the declaration. Fixes PR7460. llvm-svn: 108235
This commit is contained in:
parent
603d81bf8d
commit
f5b160f89c
|
@ -211,9 +211,11 @@ void StmtProfiler::VisitExpr(Expr *S) {
|
|||
|
||||
void StmtProfiler::VisitDeclRefExpr(DeclRefExpr *S) {
|
||||
VisitExpr(S);
|
||||
VisitNestedNameSpecifier(S->getQualifier());
|
||||
if (!Canonical)
|
||||
VisitNestedNameSpecifier(S->getQualifier());
|
||||
VisitDecl(S->getDecl());
|
||||
VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
|
||||
if (!Canonical)
|
||||
VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
|
||||
}
|
||||
|
||||
void StmtProfiler::VisitPredefinedExpr(PredefinedExpr *S) {
|
||||
|
@ -307,7 +309,8 @@ void StmtProfiler::VisitCallExpr(CallExpr *S) {
|
|||
void StmtProfiler::VisitMemberExpr(MemberExpr *S) {
|
||||
VisitExpr(S);
|
||||
VisitDecl(S->getMemberDecl());
|
||||
VisitNestedNameSpecifier(S->getQualifier());
|
||||
if (!Canonical)
|
||||
VisitNestedNameSpecifier(S->getQualifier());
|
||||
ID.AddBoolean(S->isArrow());
|
||||
}
|
||||
|
||||
|
|
|
@ -86,3 +86,15 @@ namespace PR6851 {
|
|||
template <bool w>
|
||||
S< S<w>::cond && 1 > N::foo() { }
|
||||
}
|
||||
|
||||
namespace PR7460 {
|
||||
template <typename T>
|
||||
struct TemplateClass2
|
||||
{
|
||||
enum { SIZE = 100 };
|
||||
static T member[SIZE];
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T TemplateClass2<T>::member[TemplateClass2<T>::SIZE];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue