forked from OSchip/llvm-project
Fix assert when instantiating a default argument of a template defined in a
module. llvm-svn: 187556
This commit is contained in:
parent
302ae6b002
commit
b71782b7e5
|
@ -1959,7 +1959,10 @@ TemplateSpecializationKind VarDecl::getTemplateSpecializationKind() const {
|
|||
}
|
||||
|
||||
MemberSpecializationInfo *VarDecl::getMemberSpecializationInfo() const {
|
||||
return getASTContext().getInstantiatedFromStaticDataMember(this);
|
||||
if (isStaticDataMember())
|
||||
return getASTContext().getInstantiatedFromStaticDataMember(this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void VarDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK,
|
||||
|
|
|
@ -20,3 +20,5 @@ template<typename T> void PerformDelayedLookup(T &t) {
|
|||
typename T::Inner inner;
|
||||
FoundByADL(t);
|
||||
}
|
||||
|
||||
template<typename T> void PerformDelayedLookupInDefaultArgument(T &t, int a = (FoundByADL(T()), 0)) {}
|
||||
|
|
|
@ -51,6 +51,9 @@ void g() {
|
|||
// 'common'. That type is not visible here.
|
||||
PerformDelayedLookup(defined_in_common);
|
||||
|
||||
// Likewise, but via a default argument.
|
||||
PerformDelayedLookupInDefaultArgument(defined_in_common);
|
||||
|
||||
// Trigger the instantiation of a template in 'b' that uses a type defined in
|
||||
// 'b_impl'. That type is not visible here.
|
||||
UseDefinedInBImpl<int>();
|
||||
|
|
Loading…
Reference in New Issue