Add a testcase and a FIXME for an accepts-invalid.

llvm-svn: 197280
This commit is contained in:
Richard Smith 2013-12-13 22:28:48 +00:00
parent 3c9198fce3
commit 6cda8ee96f

View File

@ -51,16 +51,27 @@ void test2() {
} }
namespace PR12709 { namespace PR12709 {
template<class T> class TemplateClass {
void member_function() { specialized_member_template<false>(); }
template<class T> class TemplateClass { template<bool b> void specialized_member_template() {}
void member_function() { specialized_member_template<false>(); }
template<bool b> void specialized_member_template() {} template<> void specialized_member_template<false>() {
// expected-warning@-1 {{explicit specialization of 'specialized_member_template' within class scope is a Microsoft extension}}
}
};
template<> void specialized_member_template<false>() { void f() { TemplateClass<int> t; }
// expected-warning@-1 {{explicit specialization of 'specialized_member_template' within class scope is a Microsoft extension}} }
}
}; namespace Duplicates {
template<typename T> struct A {
void f() { TemplateClass<int> t; } template<typename U> void f();
template<> void f<int>() {} // expected-warning {{Microsoft extension}}
template<> void f<T>() {} // expected-warning {{Microsoft extension}}
};
// FIXME: We should diagnose the duplicate explicit specialization definitions
// here.
template struct A<int>;
} }