forked from OSchip/llvm-project
When looking for a redeclaration of a static variable, only look for redeclarations. Fixes PR6449
llvm-svn: 97478
This commit is contained in:
parent
d8425df136
commit
79e31db9a9
|
@ -233,7 +233,7 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
|
|||
bool Redeclaration = false;
|
||||
// FIXME: having to fake up a LookupResult is dumb.
|
||||
LookupResult Previous(SemaRef, Var->getDeclName(), Var->getLocation(),
|
||||
Sema::LookupOrdinaryName);
|
||||
Sema::LookupOrdinaryName, Sema::ForRedeclaration);
|
||||
if (D->isStaticDataMember())
|
||||
SemaRef.LookupQualifiedName(Previous, Owner, false);
|
||||
SemaRef.CheckVariableDeclaration(Var, Previous, Redeclaration);
|
||||
|
|
|
@ -92,3 +92,26 @@ struct SizeOf {
|
|||
void MyTest3() {
|
||||
Y3().Foo(X3<SizeOf<char>::value>());
|
||||
}
|
||||
|
||||
namespace PR6449 {
|
||||
template<typename T>
|
||||
struct X0 {
|
||||
static const bool var = false;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
const bool X0<T>::var;
|
||||
|
||||
template<typename T>
|
||||
struct X1 : public X0<T> {
|
||||
static const bool var = false;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
const bool X1<T>::var;
|
||||
|
||||
template class X0<char>;
|
||||
template class X1<char>;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue