summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-12-13 22:28:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-12-13 22:28:48 +0000
commit6cda8ee96f8987e8f5d8918089e319303d223431 (patch)
tree46e5d812aca157e61f5b973353b7bb9da91011a5
parent3c9198fce327077d991017906e4540ae379a6032 (diff)
downloadbcm5719-llvm-6cda8ee96f8987e8f5d8918089e319303d223431.tar.gz
bcm5719-llvm-6cda8ee96f8987e8f5d8918089e319303d223431.zip
Add a testcase and a FIXME for an accepts-invalid.
llvm-svn: 197280
-rw-r--r--clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp b/clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp
index 99358fa5f45..5da00837cc0 100644
--- a/clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp
+++ b/clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp
@@ -51,16 +51,27 @@ void test2() {
}
namespace PR12709 {
+ template<class T> class TemplateClass {
+ void member_function() { specialized_member_template<false>(); }
-template<class T> class TemplateClass {
- void member_function() { specialized_member_template<false>(); }
+ template<bool b> void specialized_member_template() {}
- 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>() {
- // expected-warning@-1 {{explicit specialization of 'specialized_member_template' within class scope is a Microsoft extension}}
- }
-};
+ void f() { TemplateClass<int> t; }
+}
+
+namespace Duplicates {
+ template<typename T> struct A {
+ template<typename U> void f();
+ template<> void f<int>() {} // expected-warning {{Microsoft extension}}
+ template<> void f<T>() {} // expected-warning {{Microsoft extension}}
+ };
-void f() { TemplateClass<int> t; }
+ // FIXME: We should diagnose the duplicate explicit specialization definitions
+ // here.
+ template struct A<int>;
}
OpenPOWER on IntegriCloud