forked from OSchip/llvm-project
[modules] Add testcase for a bug reduced from a selfhost issue. This bug was
never present in Clang trunk, but was present in some of my development work, and it seems like a useful test to have. llvm-svn: 214154
This commit is contained in:
parent
08b9515f45
commit
049fcd8c64
|
@ -75,3 +75,10 @@ template<typename T> struct MergeTemplateDefinitions {
|
|||
template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
|
||||
|
||||
template<typename T> using AliasTemplate = T;
|
||||
|
||||
template<typename T> struct PartiallyInstantiatePartialSpec {};
|
||||
template<typename T> struct PartiallyInstantiatePartialSpec<T*> {
|
||||
static T *foo() { return reinterpret_cast<T*>(0); }
|
||||
static T *bar() { return reinterpret_cast<T*>(0); }
|
||||
};
|
||||
typedef PartiallyInstantiatePartialSpec<int*> PartiallyInstantiatePartialSpecHelper;
|
||||
|
|
|
@ -73,4 +73,5 @@ template<typename T> void UseDefinedInBImplIndirectly(T &v) {
|
|||
void TriggerInstantiation() {
|
||||
UseDefinedInBImpl<void>();
|
||||
Std::f<int>();
|
||||
PartiallyInstantiatePartialSpec<int*>::foo();
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ void g() {
|
|||
|
||||
int &p = WithPartialSpecializationUse().f();
|
||||
int &q = WithExplicitSpecializationUse().inner_template<int>();
|
||||
int *r = PartiallyInstantiatePartialSpec<int*>::bar();
|
||||
}
|
||||
|
||||
static_assert(Outer<int>::Inner<int>::f() == 1, "");
|
||||
|
|
Loading…
Reference in New Issue