aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-14 07:59:17 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-14 07:59:17 +0000
commit8f456a6ce43fe0975caa5aa59f98b8a8e9617b91 (patch)
tree94af79b047c219c7c613a0f7ed8f88497eae0ae4 /clang/test
parent562069800c0643dec3759ab2cce74b3372bf87e1 (diff)
downloadllvm-8f456a6ce43fe0975caa5aa59f98b8a8e9617b91.zip
llvm-8f456a6ce43fe0975caa5aa59f98b8a8e9617b91.tar.gz
llvm-8f456a6ce43fe0975caa5aa59f98b8a8e9617b91.tar.bz2
Merging r197305:
------------------------------------------------------------------------ r197305 | rsmith | 2013-12-13 19:18:05 -0800 (Fri, 13 Dec 2013) | 7 lines PR18246: When performing template argument deduction to decide which template is specialized by an explicit specialization, start from the first declaration in case we've got a member of a class template (redeclarations might not number the template parameters the same way). Our recover here is still far from ideal. ------------------------------------------------------------------------ llvm-svn: 197319
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/explicit-specialization-member.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/explicit-specialization-member.cpp b/clang/test/SemaTemplate/explicit-specialization-member.cpp
index 9ddbc04..07d7389 100644
--- a/clang/test/SemaTemplate/explicit-specialization-member.cpp
+++ b/clang/test/SemaTemplate/explicit-specialization-member.cpp
@@ -28,3 +28,22 @@ namespace PR12331 {
};
template<> struct S<int>::U { static const int n = sizeof(int); }; // expected-error {{explicit specialization of 'U' after instantiation}}
}
+
+namespace PR18246 {
+ template<typename T>
+ class Baz {
+ public:
+ template<int N> void bar();
+ };
+
+ template<typename T>
+ template<int N>
+ void Baz<T>::bar() {
+ }
+
+ // FIXME: Don't suggest the 'template<>' correction here, because this cannot
+ // be an explicit specialization.
+ template<typename T>
+ void Baz<T>::bar<0>() { // expected-error {{requires 'template<>'}}
+ }
+}