[modules] PR20475: merging support for alias template declarations.

llvm-svn: 214124
This commit is contained in:
Richard Smith 2014-07-28 21:16:37 +00:00
parent 2101a7fbcf
commit f59b735a80
3 changed files with 7 additions and 0 deletions

View File

@ -2075,6 +2075,9 @@ void ASTDeclReader::mergeTemplatePattern(RedeclarableTemplateDecl *D,
Result);
if (auto *DVar = dyn_cast<VarDecl>(DPattern))
return mergeRedeclarable(DVar, cast<VarDecl>(ExistingPattern), Result);
if (auto *DAlias = dyn_cast<TypeAliasDecl>(DPattern))
return mergeRedeclarable(DAlias, cast<TypedefNameDecl>(ExistingPattern),
Result);
llvm_unreachable("merged an unknown kind of redeclarable template");
}

View File

@ -73,3 +73,5 @@ template<typename T> struct MergeTemplateDefinitions {
static constexpr int g();
};
template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
template<typename T> using AliasTemplate = T;

View File

@ -63,6 +63,8 @@ template<> struct MergeSpecializations<double> {
typedef int explicitly_specialized_in_b;
};
template<typename U> using AliasTemplate = U;
@import cxx_templates_a;
template<typename T> void UseDefinedInBImplIndirectly(T &v) {
PerformDelayedLookup(v);