r214124 - [modules] PR20475: merging support for alias template declarations.
Richard Smith
richard-llvm at metafoo.co.uk
Mon Jul 28 14:16:38 PDT 2014
Author: rsmith
Date: Mon Jul 28 16:16:37 2014
New Revision: 214124
URL: http://llvm.org/viewvc/llvm-project?rev=214124&view=rev
Log:
[modules] PR20475: merging support for alias template declarations.
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
cfe/trunk/test/Modules/Inputs/cxx-templates-a.h
cfe/trunk/test/Modules/Inputs/cxx-templates-b.h
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=214124&r1=214123&r2=214124&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Mon Jul 28 16:16:37 2014
@@ -2075,6 +2075,9 @@ void ASTDeclReader::mergeTemplatePattern
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");
}
Modified: cfe/trunk/test/Modules/Inputs/cxx-templates-a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-templates-a.h?rev=214124&r1=214123&r2=214124&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-templates-a.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-templates-a.h Mon Jul 28 16:16:37 2014
@@ -73,3 +73,5 @@ template<typename T> struct MergeTemplat
static constexpr int g();
};
template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
+
+template<typename T> using AliasTemplate = T;
Modified: cfe/trunk/test/Modules/Inputs/cxx-templates-b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/cxx-templates-b.h?rev=214124&r1=214123&r2=214124&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/cxx-templates-b.h (original)
+++ cfe/trunk/test/Modules/Inputs/cxx-templates-b.h Mon Jul 28 16:16:37 2014
@@ -63,6 +63,8 @@ template<> struct MergeSpecializations<d
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);
More information about the cfe-commits
mailing list